aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common20
-rw-r--r--NEWS3
-rw-r--r--backends/platform/PalmOS/Src/modules.cpp6
-rw-r--r--backends/platform/PalmOS/Src/prefixes/compile.h40
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_agi.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_agos.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_cine.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_cruise.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_drascula.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_gob.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_igor.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_kyra.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_lure.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_parallaction.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_queen.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_saga.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_scumm.h6
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_sky.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_sword1.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_sword2.h2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_touche.h2
-rw-r--r--backends/platform/dc/Makefile4
-rw-r--r--backends/platform/dc/README2
-rw-r--r--backends/platform/dc/plugin.syms10
-rw-r--r--backends/platform/ds/arm9/makefile154
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp4
-rw-r--r--backends/platform/ds/arm9/source/wordcompletion.cpp2
-rw-r--r--backends/platform/gp32/Makefile30
-rw-r--r--backends/platform/wince/Makefile47
-rw-r--r--backends/plugins/dc/dc-provider.cpp43
-rw-r--r--backends/plugins/dc/dc-provider.h13
-rw-r--r--backends/plugins/posix/posix-provider.cpp41
-rw-r--r--backends/plugins/posix/posix-provider.h6
-rw-r--r--backends/plugins/sdl/sdl-provider.cpp43
-rw-r--r--backends/plugins/sdl/sdl-provider.h6
-rw-r--r--backends/plugins/win32/win32-provider.cpp44
-rw-r--r--backends/plugins/win32/win32-provider.h11
-rw-r--r--base/commandLine.cpp14
-rw-r--r--base/main.cpp6
-rw-r--r--base/plugins.cpp103
-rw-r--r--base/plugins.h34
-rw-r--r--common/array.h18
-rw-r--r--common/func.h8
-rw-r--r--common/hashmap.h66
-rw-r--r--common/list.h20
-rw-r--r--common/noncopyable.h2
-rw-r--r--common/singleton.h23
-rw-r--r--common/stack.h18
-rwxr-xr-xconfigure170
-rw-r--r--dists/msvc7/drascula.vcproj11
-rw-r--r--dists/msvc7/gob.vcproj3
-rw-r--r--dists/msvc7/kyra.vcproj109
-rw-r--r--dists/msvc7/made.vcproj12
-rw-r--r--dists/msvc71/drascula.vcproj11
-rw-r--r--dists/msvc71/gob.vcproj3
-rw-r--r--dists/msvc71/kyra.vcproj109
-rw-r--r--dists/msvc71/made.vcproj12
-rw-r--r--dists/msvc8/drascula.vcproj14
-rw-r--r--dists/msvc8/gob.vcproj4
-rw-r--r--dists/msvc8/kyra.vcproj124
-rw-r--r--dists/msvc8/made.vcproj14
-rw-r--r--dists/msvc9/drascula.vcproj14
-rw-r--r--dists/msvc9/gob.vcproj4
-rw-r--r--dists/msvc9/kyra.vcproj124
-rw-r--r--dists/msvc9/made.vcproj14
-rw-r--r--engines/agi/agi.h1
-rw-r--r--engines/agi/detection.cpp23
-rw-r--r--engines/agi/keyboard.cpp4
-rw-r--r--engines/agi/module.mk2
-rw-r--r--engines/agi/op_cmd.cpp10
-rw-r--r--engines/agos/detection.cpp6
-rw-r--r--engines/agos/module.mk2
-rw-r--r--engines/cine/detection.cpp6
-rw-r--r--engines/cine/module.mk2
-rw-r--r--engines/cruise/detection.cpp6
-rw-r--r--engines/cruise/module.mk2
-rw-r--r--engines/drascula/animation.cpp3422
-rw-r--r--engines/drascula/detection.cpp6
-rw-r--r--engines/drascula/drascula.cpp8562
-rw-r--r--engines/drascula/drascula.h490
-rw-r--r--engines/drascula/module.mk8
-rw-r--r--engines/drascula/rooms.cpp2036
-rw-r--r--engines/drascula/talk.cpp2053
-rw-r--r--engines/drascula/texts.cpp4342
-rw-r--r--engines/drascula/texts.h761
-rw-r--r--engines/engines.mk103
-rw-r--r--engines/gob/coktelvideo.cpp85
-rw-r--r--engines/gob/coktelvideo.h28
-rw-r--r--engines/gob/dataio.cpp10
-rw-r--r--engines/gob/detection.cpp25
-rw-r--r--engines/gob/draw_v2.cpp4
-rw-r--r--engines/gob/game.cpp3
-rw-r--r--engines/gob/game_v2.cpp2
-rw-r--r--engines/gob/global.cpp7
-rw-r--r--engines/gob/global.h7
-rw-r--r--engines/gob/gob.cpp15
-rw-r--r--engines/gob/goblin.h14
-rw-r--r--engines/gob/goblin_v4.cpp646
-rw-r--r--engines/gob/init.cpp6
-rw-r--r--engines/gob/inter_bargon.cpp48
-rw-r--r--engines/gob/inter_v2.cpp97
-rw-r--r--engines/gob/inter_v4.cpp39
-rw-r--r--engines/gob/module.mk3
-rw-r--r--engines/gob/mult.cpp11
-rw-r--r--engines/gob/mult.h21
-rw-r--r--engines/gob/mult_v1.cpp2
-rw-r--r--engines/gob/mult_v2.cpp77
-rw-r--r--engines/gob/scenery.cpp156
-rw-r--r--engines/gob/scenery.h1
-rw-r--r--engines/gob/util.cpp23
-rw-r--r--engines/gob/video.cpp43
-rw-r--r--engines/gob/video.h6
-rw-r--r--engines/gob/videoplayer.cpp399
-rw-r--r--engines/gob/videoplayer.h75
-rw-r--r--engines/igor/detection.cpp6
-rw-r--r--engines/igor/module.mk2
-rw-r--r--engines/kyra/animator_hof.cpp339
-rw-r--r--engines/kyra/animator_mr.cpp (renamed from engines/kyra/animator_v3.cpp)320
-rw-r--r--engines/kyra/animator_v1.cpp114
-rw-r--r--engines/kyra/animator_v1.h52
-rw-r--r--engines/kyra/animator_v2.cpp339
-rw-r--r--engines/kyra/debugger.cpp32
-rw-r--r--engines/kyra/debugger.h10
-rw-r--r--engines/kyra/detection.cpp42
-rw-r--r--engines/kyra/gui.cpp13
-rw-r--r--engines/kyra/gui.h4
-rw-r--r--engines/kyra/gui_hof.cpp1183
-rw-r--r--engines/kyra/gui_hof.h86
-rw-r--r--engines/kyra/gui_mr.cpp1223
-rw-r--r--engines/kyra/gui_mr.h88
-rw-r--r--engines/kyra/gui_v1.cpp19
-rw-r--r--engines/kyra/gui_v2.cpp1187
-rw-r--r--engines/kyra/gui_v2.h85
-rw-r--r--engines/kyra/gui_v3.cpp366
-rw-r--r--engines/kyra/items_hof.cpp448
-rw-r--r--engines/kyra/items_mr.cpp (renamed from engines/kyra/items_v3.cpp)232
-rw-r--r--engines/kyra/items_v2.cpp467
-rw-r--r--engines/kyra/kyra.cpp107
-rw-r--r--engines/kyra/kyra.h26
-rw-r--r--engines/kyra/kyra_hof.cpp2013
-rw-r--r--engines/kyra/kyra_hof.h916
-rw-r--r--engines/kyra/kyra_mr.cpp (renamed from engines/kyra/kyra_v3.cpp)833
-rw-r--r--engines/kyra/kyra_mr.h (renamed from engines/kyra/kyra_v3.h)482
-rw-r--r--engines/kyra/kyra_v1.cpp107
-rw-r--r--engines/kyra/kyra_v1.h334
-rw-r--r--engines/kyra/kyra_v2.cpp2259
-rw-r--r--engines/kyra/kyra_v2.h1184
-rw-r--r--engines/kyra/module.mk37
-rw-r--r--engines/kyra/resource.cpp1
-rw-r--r--engines/kyra/resource.h2
-rw-r--r--engines/kyra/saveload.cpp5
-rw-r--r--engines/kyra/saveload_hof.cpp (renamed from engines/kyra/saveload_v2.cpp)44
-rw-r--r--engines/kyra/saveload_mr.cpp262
-rw-r--r--engines/kyra/scene_hof.cpp763
-rw-r--r--engines/kyra/scene_mr.cpp (renamed from engines/kyra/scene_v3.cpp)268
-rw-r--r--engines/kyra/scene_v1.cpp48
-rw-r--r--engines/kyra/scene_v2.cpp772
-rw-r--r--engines/kyra/screen.cpp364
-rw-r--r--engines/kyra/screen.h49
-rw-r--r--engines/kyra/screen_hof.cpp279
-rw-r--r--engines/kyra/screen_hof.h63
-rw-r--r--engines/kyra/screen_mr.cpp (renamed from engines/kyra/screen_v3.cpp)50
-rw-r--r--engines/kyra/screen_mr.h (renamed from engines/kyra/screen_v3.h)20
-rw-r--r--engines/kyra/screen_v2.cpp458
-rw-r--r--engines/kyra/screen_v2.h64
-rw-r--r--engines/kyra/script.cpp66
-rw-r--r--engines/kyra/script.h64
-rw-r--r--engines/kyra/script_hof.cpp1735
-rw-r--r--engines/kyra/script_mr.cpp1383
-rw-r--r--engines/kyra/script_v1.cpp322
-rw-r--r--engines/kyra/script_v2.cpp1908
-rw-r--r--engines/kyra/script_v3.cpp1268
-rw-r--r--engines/kyra/sequences_hof.cpp2782
-rw-r--r--engines/kyra/sequences_mr.cpp249
-rw-r--r--engines/kyra/sequences_v2.cpp2778
-rw-r--r--engines/kyra/sequences_v3.cpp112
-rw-r--r--engines/kyra/sound.cpp4
-rw-r--r--engines/kyra/sound_digital.cpp7
-rw-r--r--engines/kyra/sound_v1.cpp4
-rw-r--r--engines/kyra/sprites.cpp2
-rw-r--r--engines/kyra/staticres.cpp454
-rw-r--r--engines/kyra/text_hof.cpp (renamed from engines/kyra/text_v2.cpp)100
-rw-r--r--engines/kyra/text_hof.h (renamed from engines/kyra/text_v2.h)10
-rw-r--r--engines/kyra/text_mr.cpp (renamed from engines/kyra/text_v3.cpp)286
-rw-r--r--engines/kyra/text_mr.h (renamed from engines/kyra/text_v3.h)16
-rw-r--r--engines/kyra/timer.cpp18
-rw-r--r--engines/kyra/timer_hof.cpp (renamed from engines/kyra/timer_v2.cpp)38
-rw-r--r--engines/kyra/timer_mr.cpp (renamed from engines/kyra/timer_v3.cpp)39
-rw-r--r--engines/kyra/timer_v1.cpp2
-rw-r--r--engines/kyra/wsamovie.cpp3
-rw-r--r--engines/kyra/wsamovie.h8
-rw-r--r--engines/lure/detection.cpp6
-rw-r--r--engines/lure/module.mk2
-rw-r--r--engines/m4/detection.cpp6
-rw-r--r--engines/m4/module.mk2
-rw-r--r--engines/made/database.cpp300
-rw-r--r--engines/made/database.h22
-rw-r--r--engines/made/detection.cpp67
-rw-r--r--engines/made/made.cpp45
-rw-r--r--engines/made/made.h10
-rw-r--r--engines/made/module.mk6
-rw-r--r--engines/made/music.cpp33
-rw-r--r--engines/made/music.h5
-rw-r--r--engines/made/pmvplayer.cpp5
-rw-r--r--engines/made/resource.cpp64
-rw-r--r--engines/made/resource.h28
-rw-r--r--engines/made/screen.cpp275
-rw-r--r--engines/made/screen.h50
-rw-r--r--engines/made/script.cpp140
-rw-r--r--engines/made/scriptfuncs.cpp199
-rw-r--r--engines/made/scriptfuncs.h134
-rw-r--r--engines/made/scriptfuncs_lgop2.cpp467
-rw-r--r--engines/made/scriptfuncs_mhne.cpp494
-rw-r--r--engines/made/scriptfuncs_rtz.cpp864
-rw-r--r--engines/made/sound.cpp29
-rw-r--r--engines/parallaction/callables_ns.cpp2
-rw-r--r--engines/parallaction/debug.cpp14
-rw-r--r--engines/parallaction/detection.cpp6
-rw-r--r--engines/parallaction/dialogue.cpp2
-rw-r--r--engines/parallaction/disk_br.cpp64
-rw-r--r--engines/parallaction/exec_br.cpp20
-rw-r--r--engines/parallaction/exec_ns.cpp16
-rw-r--r--engines/parallaction/module.mk2
-rw-r--r--engines/parallaction/objects.h2
-rw-r--r--engines/parallaction/parallaction.cpp70
-rw-r--r--engines/parallaction/parallaction.h74
-rw-r--r--engines/parallaction/parallaction_br.cpp2
-rw-r--r--engines/parallaction/parallaction_ns.cpp19
-rw-r--r--engines/parallaction/parser.cpp43
-rw-r--r--engines/parallaction/parser.h58
-rw-r--r--engines/parallaction/parser_br.cpp50
-rw-r--r--engines/parallaction/parser_ns.cpp69
-rw-r--r--engines/parallaction/walk.cpp8
-rw-r--r--engines/queen/module.mk2
-rw-r--r--engines/queen/queen.cpp6
-rw-r--r--engines/saga/detection.cpp6
-rw-r--r--engines/saga/module.mk2
-rw-r--r--engines/scumm/actor.cpp52
-rw-r--r--engines/scumm/akos.cpp6
-rw-r--r--engines/scumm/camera.cpp2
-rw-r--r--engines/scumm/charset.cpp18
-rw-r--r--engines/scumm/charset.h2
-rw-r--r--engines/scumm/detection.cpp12
-rw-r--r--engines/scumm/detection_tables.h12
-rw-r--r--engines/scumm/dialogs.cpp6
-rw-r--r--engines/scumm/gfx.cpp6
-rw-r--r--engines/scumm/gfx.h2
-rw-r--r--engines/scumm/he/cup_player_he.h2
-rw-r--r--engines/scumm/he/floodfill_he.h2
-rw-r--r--engines/scumm/he/intern_he.h6
-rw-r--r--engines/scumm/he/logic_he.h2
-rw-r--r--engines/scumm/he/resource_he.cpp2
-rw-r--r--engines/scumm/he/sprite_he.h2
-rw-r--r--engines/scumm/he/wiz_he.h2
-rw-r--r--engines/scumm/imuse_digi/dimuse.h2
-rw-r--r--engines/scumm/imuse_digi/dimuse_tables.h2
-rw-r--r--engines/scumm/imuse_digi/dimuse_track.h2
-rw-r--r--engines/scumm/input.cpp6
-rw-r--r--engines/scumm/insane/insane.h2
-rw-r--r--engines/scumm/intern.h4
-rw-r--r--engines/scumm/module.mk6
-rw-r--r--engines/scumm/nut_renderer.h2
-rw-r--r--engines/scumm/object.cpp8
-rw-r--r--engines/scumm/palette.cpp2
-rw-r--r--engines/scumm/resource.cpp8
-rw-r--r--engines/scumm/room.cpp4
-rw-r--r--engines/scumm/saveload.cpp6
-rw-r--r--engines/scumm/script_v6.cpp4
-rw-r--r--engines/scumm/scumm.cpp28
-rw-r--r--engines/scumm/scumm.h1
-rw-r--r--engines/scumm/smush/smush_player.h2
-rw-r--r--engines/scumm/sound.cpp12
-rw-r--r--engines/scumm/string.cpp59
-rw-r--r--engines/scumm/vars.cpp8
-rw-r--r--engines/scumm/verbs.cpp4
-rw-r--r--engines/sky/module.mk2
-rw-r--r--engines/sky/sky.cpp6
-rw-r--r--engines/sword1/module.mk2
-rw-r--r--engines/sword1/sword1.cpp6
-rw-r--r--engines/sword2/module.mk2
-rw-r--r--engines/sword2/sword2.cpp6
-rw-r--r--engines/touche/detection.cpp6
-rw-r--r--engines/touche/module.mk2
-rw-r--r--ports.mk13
-rw-r--r--rules.mk3
-rw-r--r--sound/mididrv.cpp4
286 files changed, 35770 insertions, 25836 deletions
diff --git a/Makefile.common b/Makefile.common
index 1261f75041..5a443644f2 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -15,17 +15,18 @@ all: $(EXECUTABLE) plugins
# Module settings
######################################################################
+PLUGINS :=
MODULES := test tools base $(MODULES)
-include $(srcdir)/engines/engines.mk
# After the game specific modules follow the shared modules
MODULES += \
- engines \
gui \
graphics \
sound \
common \
+ engines \
backends
ifdef USE_MT32EMU
@@ -177,28 +178,31 @@ dist-src: \
# Themes files
-DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,modern.ini modern.zip)
+DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,modern.ini modern.zip classic080.ini)
# Engine data files
DIST_FILES_ENGINEDATA=
-ifndef DISABLE_IGOR
+ifdef ENABLE_IGOR
DIST_FILES_ENGINEDATA+=igor.tbl
endif
-ifndef DISABLE_KYRA
+ifdef ENABLE_KYRA
DIST_FILES_ENGINEDATA+=kyra.dat
endif
-ifndef DISABLE_LURE
+ifdef ENABLE_LURE
DIST_FILES_ENGINEDATA+=lure.dat
endif
-ifndef DISABLE_M4
+ifdef ENABLE_M4
DIST_FILES_ENGINEDATA+=m4.dat
endif
-ifndef DISABLE_QUEEN
+ifdef ENABLE_QUEEN
DIST_FILES_ENGINEDATA+=queen.tbl
endif
-ifndef DISABLE_SKY
+ifdef ENABLE_SKY
DIST_FILES_ENGINEDATA+=sky.cpt
endif
DIST_FILES_ENGINEDATA:=$(addprefix $(srcdir)/dists/engine-data/,$(DIST_FILES_ENGINEDATA))
+# Plugin files
+DIST_FILES_PLUGINS:=$(addprefix $(srcdir)/,$(PLUGINS))
+
.PHONY: all clean distclean plugins dist-src
diff --git a/NEWS b/NEWS
index 6787d27f7b..ab83f09c3b 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
- Revived the PS2 port (was already in 0.11.1 but was forgotten in the
release notes).
+ AGOS:
+ - Fixed palette issues in Amiga versions of Simon the Sorcerer 1.
+
SCUMM:
- Rewrote parts of Digital iMUSE, fixing some bugs.
- Rewrote the internal timer code, fixing some speed issues in e.g. COMI.
diff --git a/backends/platform/PalmOS/Src/modules.cpp b/backends/platform/PalmOS/Src/modules.cpp
index f66d7d6ae6..b16e2cf7d5 100644
--- a/backends/platform/PalmOS/Src/modules.cpp
+++ b/backends/platform/PalmOS/Src/modules.cpp
@@ -87,9 +87,9 @@ static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
#ifdef PALMOS_NATIVE
result = GET_MODEARM;
#else
-# if !defined(DISABLE_SCUMM) || \
- !defined(DISABLE_AGOS) || \
- !defined(DISABLE_SWORD1)
+# if defined(ENABLE_SCUMM) || \
+ defined(ENABLE_AGOS) || \
+ defined(ENABLE_SWORD1)
result = GET_DATACOMMON|GET_DATAENGINE|GET_MODE68K;
# else
result = GET_DATACOMMON|GET_MODE68K;
diff --git a/backends/platform/PalmOS/Src/prefixes/compile.h b/backends/platform/PalmOS/Src/prefixes/compile.h
index 40485a5927..c2bb51385a 100644
--- a/backends/platform/PalmOS/Src/prefixes/compile.h
+++ b/backends/platform/PalmOS/Src/prefixes/compile.h
@@ -26,27 +26,27 @@
#ifndef __COMPILE_H__
#define __COMPILE_H__
-#define DISABLE_SCUMM
-#define DISABLE_SCUMM_7_8
-#define DISABLE_HE
+#undef ENABLE_SCUMM
+#undef ENABLE_SCUMM_7_8
+#undef ENABLE_HE
-#define DISABLE_AGOS
-#define DISABLE_SKY
-#define DISABLE_SWORD1
-#define DISABLE_SWORD2
-#define DISABLE_QUEEN
-#define DISABLE_SAGA
-#define DISABLE_KYRA
-#define DISABLE_AWE
-#define DISABLE_GOB
-#define DISABLE_LURE
-#define DISABLE_CINE
-#define DISABLE_AGI
-#define DISABLE_TOUCHE
-#define DISABLE_PARALLACTION
-#define DISABLE_CRUISE
-#define DISABLE_DRASCULA
-#define DISABLE_IGOR
+#undef ENABLE_AGOS
+#undef ENABLE_SKY
+#undef ENABLE_SWORD1
+#undef ENABLE_SWORD2
+#undef ENABLE_QUEEN
+#undef ENABLE_SAGA
+#undef ENABLE_KYRA
+#undef ENABLE_AWE
+#undef ENABLE_GOB
+#undef ENABLE_LURE
+#undef ENABLE_CINE
+#undef ENABLE_AGI
+#undef ENABLE_TOUCHE
+#undef ENABLE_PARALLACTION
+#undef ENABLE_CRUISE
+#undef ENABLE_DRASCULA
+#undef ENABLE_IGOR
// ScummVM
#define DISABLE_HQ_SCALERS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_agi.h b/backends/platform/PalmOS/Src/prefixes/native_agi.h
index 790f108efa..f3feee8c70 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_agi.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_agi.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_AGI
+#define ENABLE_AGI STATIC_PLUGIN
#undef USE_MAD
#undef USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_agos.h b/backends/platform/PalmOS/Src/prefixes/native_agos.h
index f3b3476262..8a804e3116 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_agos.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_agos.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_AGOS
+#define ENABLE_AGOS STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_cine.h b/backends/platform/PalmOS/Src/prefixes/native_cine.h
index bacdfa2047..3d19d9c557 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_cine.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_cine.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_CINE
+#define ENABLE_CINE STATIC_PLUGIN
#define _DEBUG
#undef USE_MAD
diff --git a/backends/platform/PalmOS/Src/prefixes/native_cruise.h b/backends/platform/PalmOS/Src/prefixes/native_cruise.h
index 9bc0cdac13..89e6e65a70 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_cruise.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_cruise.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_CRUISE
+#define ENABLE_CRUISE STATIC_PLUGIN
#undef USE_MAD
#undef USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_drascula.h b/backends/platform/PalmOS/Src/prefixes/native_drascula.h
index 3904cc98ba..35bc381af4 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_drascula.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_drascula.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_DRASCULA
+#define ENABLE_DRASCULA STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_gob.h b/backends/platform/PalmOS/Src/prefixes/native_gob.h
index 16863cd5b6..9cb34099d0 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_gob.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_gob.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_GOB
+#define ENABLE_GOB STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_igor.h b/backends/platform/PalmOS/Src/prefixes/native_igor.h
index 749be9daaf..2808dd2331 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_igor.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_igor.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_IGOR
+#define ENABLE_IGOR STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_kyra.h b/backends/platform/PalmOS/Src/prefixes/native_kyra.h
index 7f6dd57565..c89b0a5b93 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_kyra.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_kyra.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_KYRA
+#define ENABLE_KYRA
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_lure.h b/backends/platform/PalmOS/Src/prefixes/native_lure.h
index b017c46fe6..71835ee644 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_lure.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_lure.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_LURE
+#define ENABLE_LURE STATIC_PLUGIN
#undef USE_MAD
#undef USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_parallaction.h b/backends/platform/PalmOS/Src/prefixes/native_parallaction.h
index 545cdd36fd..e8d46cc382 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_parallaction.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_parallaction.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_PARALLACTION
+#define ENABLE_PARALLACTION STATIC_PLUGIN
#undef USE_MAD
#undef USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_queen.h b/backends/platform/PalmOS/Src/prefixes/native_queen.h
index d2a1b44ef8..85bb5a0a04 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_queen.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_queen.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_QUEEN
+#define ENABLE_QUEEN STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_saga.h b/backends/platform/PalmOS/Src/prefixes/native_saga.h
index 1a728e6bcb..19db05b633 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_saga.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_saga.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_SAGA
+#define ENABLE_SAGA STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_scumm.h b/backends/platform/PalmOS/Src/prefixes/native_scumm.h
index 5014a8d5ff..b8433a3fa8 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_scumm.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_scumm.h
@@ -2,9 +2,9 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_SCUMM
-#undef DISABLE_SCUMM_7_8
-#undef DISABLE_HE
+#define ENABLE_SCUMM STATIC_PLUGIN
+#define ENABLE_SCUMM_7_8
+#define ENABLE_HE
#define USE_ARM_GFX_ASM
#define USE_ARM_SMUSH_ASM
diff --git a/backends/platform/PalmOS/Src/prefixes/native_sky.h b/backends/platform/PalmOS/Src/prefixes/native_sky.h
index 193c57e87d..49b157471f 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_sky.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_sky.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_SKY
+#define ENABLE_SKY STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_sword1.h b/backends/platform/PalmOS/Src/prefixes/native_sword1.h
index 8e52a978a8..aaae4c9b86 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_sword1.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_sword1.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_SWORD1
+#define ENABLE_SWORD1
#define USE_MPEG2
#define USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_sword2.h b/backends/platform/PalmOS/Src/prefixes/native_sword2.h
index f74a8bcc9a..5e9c45b047 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_sword2.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_sword2.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_SWORD2
+#define ENABLE_SWORD2 STATIC_PLUGIN
#undef _DEBUG
#define USE_MPEG2
#define USE_VORBIS
diff --git a/backends/platform/PalmOS/Src/prefixes/native_touche.h b/backends/platform/PalmOS/Src/prefixes/native_touche.h
index 486630b799..acf50e2787 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_touche.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_touche.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#undef DISABLE_TOUCHE
+#define ENABLE_TOUCHE STATIC_PLUGIN
#endif
diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile
index db56035b7b..0a048c45e9 100644
--- a/backends/platform/dc/Makefile
+++ b/backends/platform/dc/Makefile
@@ -3,7 +3,7 @@
ronindir = /usr/local/ronin
-BUILD_PLUGINS = 1
+DYNAMIC_MODULES = 1
srcdir = ../../..
VPATH = $(srcdir)
@@ -28,7 +28,7 @@ RANLIB = sh-elf-ranlib
HAVE_GCC3 = true
DISABLE_SCALERS = true
-ifdef BUILD_PLUGINS
+ifdef DYNAMIC_MODULES
DEFINES += -DDYNAMIC_MODULES
PRE_OBJS_FLAGS = -Wl,--whole-archive
POST_OBJS_FLAGS = -Wl,--no-whole-archive
diff --git a/backends/platform/dc/README b/backends/platform/dc/README
index 56579b74db..e4ebda840e 100644
--- a/backends/platform/dc/README
+++ b/backends/platform/dc/README
@@ -21,6 +21,6 @@ Edit the Makefile to contain the path to libronin if you installed it
somewhere other than /usr/local/ronin, then run `make dist', and you
should get a scrambled binary SCUMMVM.BIN and some plugins *.PLG.
-For serial/IP upload, remove the "BUILD_PLUGINS" line and just run `make',
+For serial/IP upload, remove the "DYNAMIC_MODULES" line and just run `make',
to get a static binary with the name `scummvm.elf'.
diff --git a/backends/platform/dc/plugin.syms b/backends/platform/dc/plugin.syms
index c8022d663a..2cab08c9c7 100644
--- a/backends/platform/dc/plugin.syms
+++ b/backends/platform/dc/plugin.syms
@@ -1,9 +1,7 @@
-_PLUGIN_copyright
-_PLUGIN_createEngine
-_PLUGIN_detectGames
-_PLUGIN_gameIDList
-_PLUGIN_findGameID
-_PLUGIN_name
+_PLUGIN_getVersion
+_PLUGIN_getType
+_PLUGIN_getTypeVersion
+_PLUGIN_getObject
___plugin_ctors
___plugin_ctors_end
___plugin_dtors
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile
index 116d75b191..ea98402d4e 100644
--- a/backends/platform/ds/arm9/makefile
+++ b/backends/platform/ds/arm9/makefile
@@ -1,4 +1,4 @@
-#BUILD_PLUGINS = 1
+#DYNAMIC_MODULES = 1
#libndsdir = $(DEVKITPRO)/libnds
libndsdir = /home/neil/devkitpror21/libnds
@@ -86,184 +86,54 @@ ARM = 1
ifdef DS_BUILD_A
DEFINES = -DDS_SCUMM_BUILD -DDS_BUILD_A -DUSE_ARM_GFX_ASM
LOGO = logoa.bmp
- DISABLE_HE = 1
- #DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- DISABLE_GOB = 1
- DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
+ ENABLE_SCUMM = STATIC_PLUGIN
USE_ARM_GFX_ASM = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
BUILD=scummvm-A
endif
ifdef DS_BUILD_B
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_B
LOGO = logob.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- #DISABLE_SKY = 1#
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- #DISABLE_QUEEN = 1#
- DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- DISABLE_GOB = 1
- DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_SKY = STATIC_PLUGIN
+ ENABLE_QUEEN = STATIC_PLUGIN
BUILD=scummvm-B
endif
ifdef DS_BUILD_C
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_C
LOGO = logoc.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- #DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- DISABLE_GOB = 1
- DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_AGOS = STATIC_PLUGIN
BUILD=scummvm-C
endif
ifdef DS_BUILD_D
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_D
LOGO = logod.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- #DISABLE_GOB = 1
- DISABLE_LURE = 1
- #DISABLE_CINE = 1
- #DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_GOB = STATIC_PLUGIN
+ ENABLE_CINE = STATIC_PLUGIN
+ ENABLE_AGI = STATIC_PLUGIN
BUILD=scummvm-D
endif
-
ifdef DS_BUILD_E
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_E
LOGO = logoe.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- #DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- DISABLE_GOB = 1
- DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_SAGA = STATIC_PLUGIN
BUILD=scummvm-E
endif
-
ifdef DS_BUILD_F
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_F
LOGO = logof.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- DISABLE_SAGA = 1
- #DISABLE_KYRA = 1
- DISABLE_GOB = 1
- DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_KYRA = STATIC_PLUGIN
BUILD=scummvm-F
-
endif
-
-
ifdef DS_BUILD_G
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_G
LOGO = logog.bmp
- DISABLE_HE = 1
- DISABLE_SCUMM = 1
- DISABLE_SCUMM_7_8 = 1
- DISABLE_AGOS = 1
- DISABLE_SKY = 1
- DISABLE_SWORD1 = 1
- DISABLE_SWORD2 = 1
- DISABLE_QUEEN = 1
- DISABLE_SAGA = 1
- DISABLE_KYRA = 1
- DISABLE_GOB = 1
- #DISABLE_LURE = 1
- DISABLE_CINE = 1
- DISABLE_AGI = 1
- DISABLE_TOUCHE = 1
- DISABLE_PARALLACTION = 1
- DISABLE_CRUISE = 1
- DISABLE_DRASCULA = 1
- DISABLE_IGOR = 1
+ ENABLE_LURE = STATIC_PLUGIN
BUILD=scummvm-G
-
endif
@@ -341,7 +211,7 @@ AS = arm-eabi-as
HAVE_GCC3 = true
DISABLE_SCALERS = true
-ifdef BUILD_PLUGINS
+ifdef DYNAMIC_MODULES
DEFINES += -DDYNAMIC_MODULES
PRE_OBJS_FLAGS = -Wl,--whole-archive
POST_OBJS_FLAGS = -Wl,--no-whole-archive
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index 0aed095244..d11e4e6f75 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -359,7 +359,7 @@ void initSprites() {
void saveGameBackBuffer() {
-#ifdef DISABLE_SCUMM
+#ifndef ENABLE_SCUMM
if (savedBuffer == NULL) savedBuffer = new u8[gameWidth * gameHeight];
for (int r = 0; r < gameHeight; r++) {
@@ -375,7 +375,7 @@ void saveGameBackBuffer() {
}
void restoreGameBackBuffer() {
-#ifdef DISABLE_SCUMM
+#ifndef ENABLE_SCUMM
if (savedBuffer) {
for (int r = 0; r < gameHeight; r++) {
diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp
index b5bebddb54..bf4ce7c909 100644
--- a/backends/platform/ds/arm9/source/wordcompletion.cpp
+++ b/backends/platform/ds/arm9/source/wordcompletion.cpp
@@ -2,7 +2,7 @@
#include "engines/agi/agi.h"
#include "osystem_ds.h"
-#ifndef DISABLE_AGI
+#ifdef ENABLE_AGI
namespace DS {
// Default dictionary is about 64Kb, so 128Kb should be enough for future expansion
diff --git a/backends/platform/gp32/Makefile b/backends/platform/gp32/Makefile
index 327bee9d10..f7145bf860 100644
--- a/backends/platform/gp32/Makefile
+++ b/backends/platform/gp32/Makefile
@@ -153,26 +153,26 @@ HAVE_GCC3 = 1
DISABLE_SCALERS = 1
DISABLE_HQ_SCALERS = 1
-#DISABLE_SCUMM = 1
+ENABLE_SCUMM = STATIC_PLUGIN
# We can play The Dig with GP32 -- without any movies/musics/voices. But who would do that?
-DISABLE_SCUMM_7_8 = 1
-DISABLE_HE = 1
-
-#DISABLE_AGOS = 1
-#DISABLE_SKY = 1
-#DISABLE_QUEEN = 1
-#DISABLE_GOB = 1
-#DISABLE_LURE = 1
-#DISABLE_CINE = 1
-#DISABLE_SAGA = 1
-#DISABLE_KYRA = 1
-#DISABLE_AGI = 1
+#ENABLE_SCUMM_7_8 = 1
+#ENABLE_HE = 1
+
+ENABLE_AGOS = STATIC_PLUGIN
+ENABLE_SKY = STATIC_PLUGIN
+ENABLE_QUEEN = STATIC_PLUGIN
+ENABLE_GOB = STATIC_PLUGIN
+ENABLE_LURE = STATIC_PLUGIN
+ENABLE_CINE = STATIC_PLUGIN
+ENABLE_SAGA = STATIC_PLUGIN
+ENABLE_KYRA = STATIC_PLUGIN
+ENABLE_AGI = STATIC_PLUGIN
# The engines below are not supported on the GP32 port so there is
# no point compiling support into the binary.
-DISABLE_SWORD1 = 1
-DISABLE_SWORD2 = 1
+#ENABLE_SWORD1 = STATIC_PLUGIN
+#ENABLE_SWORD2 = STATIC_PLUGIN
#######################################################################
# Misc stuff - you should normally never have to edit this #
diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile
index 51ff9d0a81..734bf82eaa 100644
--- a/backends/platform/wince/Makefile
+++ b/backends/platform/wince/Makefile
@@ -12,28 +12,29 @@
########################################################################
## Do you want a build using plugins?
-#BUILD_PLUGINS = 1
+#DYNAMIC_MODULES = 1
+# TODO: You'll need to change STATIC_PLUGIN to DYNAMIC_PLUGIN below
########################################################################
-## Disable whichever engines you want here
-
-#DISABLE_SCUMM = 1
-#DISABLE_SKY = 1
-#DISABLE_QUEEN = 1
-#DISABLE_GOB = 1
-#DISABLE_LURE = 1
-#DISABLE_CINE = 1
-#DISABLE_SAGA = 1
-#DISABLE_KYRA = 1
-#DISABLE_AGI = 1
-#DISABLE_AGOS = 1
-#DISABLE_SWORD1 = 1
-#DISABLE_SWORD2 = 1
-#DISABLE_TOUCHE = 1
-#DISABLE_PARALLACTION = 1
-DISABLE_CRUISE = 1
-DISABLE_DRASCULA = 1
-DISABLE_IGOR = 1
+## Enable whichever engines you want here
+
+ENABLE_SCUMM = STATIC_PLUGIN
+ENABLE_SKY = STATIC_PLUGIN
+ENABLE_QUEEN = STATIC_PLUGIN
+ENABLE_GOB = STATIC_PLUGIN
+ENABLE_LURE = STATIC_PLUGIN
+ENABLE_CINE = STATIC_PLUGIN
+ENABLE_SAGA = STATIC_PLUGIN
+ENABLE_KYRA = STATIC_PLUGIN
+ENABLE_AGI = STATIC_PLUGIN
+ENABLE_AGOS = STATIC_PLUGIN
+ENABLE_SWORD1 = STATIC_PLUGIN
+ENABLE_SWORD2 = STATIC_PLUGIN
+ENABLE_TOUCHE = STATIC_PLUGIN
+ENABLE_PARALLACTION = STATIC_PLUGIN
+#ENABLE_CRUISE = STATIC_PLUGIN
+#ENABLE_DRASCULA = STATIC_PLUGIN
+#ENABLE_IGOR = STATIC_PLUGIN
########################################################################
## Pick which libraries you want to use here
@@ -174,11 +175,11 @@ OBJS += $(srcdir)/gui/Actions.o $(srcdir)/gui/Key.o $(srcdir)/gui/KeysDialog.o
OBJS += ../sdl/sdl.o ../sdl/graphics.o ../sdl/events.o
OBJS += missing/missing.o
OBJS += ARMscaler.o
-ifndef BUILD_PLUGINS
+ifndef DYNAMIC_MODULES
OBJS += PocketSCUMM.o
endif
-ifdef BUILD_PLUGINS
+ifdef DYNAMIC_MODULES
EXECUTABLE = scummvm.dll
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .dll
@@ -194,7 +195,7 @@ include $(srcdir)/Makefile.common
########################################################################
## Our top level target, and what we deploy depends on whether we are
## building the plugin version or not...
-ifdef BUILD_PLUGINS
+ifdef DYNAMIC_MODULES
all: dist-plugins
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp
index 6ca524150b..1cae4bbd32 100644
--- a/backends/plugins/dc/dc-provider.cpp
+++ b/backends/plugins/dc/dc-provider.cpp
@@ -27,12 +27,8 @@
#include "backends/plugins/dc/dc-provider.h"
#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
#include "dcloader.h"
-#define PLUGIN_DIRECTORY "/"
-#define PLUGIN_PREFIX ""
-#define PLUGIN_SUFFIX ".PLG"
class DCPlugin : public DynamicPlugin {
@@ -75,6 +71,7 @@ public:
return ret;
}
+
void unloadPlugin() {
DynamicPlugin::unloadPlugin();
if (_dlHandle) {
@@ -86,42 +83,8 @@ public:
};
-PluginList DCPluginProvider::getPlugins() {
- PluginList pl;
-
-
- // Load dynamic plugins
- // TODO... this is right now just a nasty hack.
- // This should search one or multiple directories for all plugins it can
- // find (to this end, we maybe should use a special prefix/suffix; e.g.
- // instead of libscumm.so, use scumm.engine or scumm.plugin etc.).
- //
- // The list of directories to search could be e.g.:
- // User specified (via config file), ".", "./plugins", "$(prefix)/lib".
- //
- // We also need to add code which ensures what we are looking at is
- // a) a ScummVM engine and b) matches the version of the executable.
- // Hence one more symbol should be exported by plugins which returns
- // the "ABI" version the plugin was built for, and we can compare that
- // to the ABI version of the executable.
-
- // Load all plugins.
- // Scan for all plugins in this directory
- FilesystemNode dir(PLUGIN_DIRECTORY);
- FSList files;
- if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
- error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
- }
-
- for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- Common::String name(i->getName());
- if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
- pl.push_back(new DCPlugin(i->getPath()));
- }
- }
-
-
- return pl;
+Plugin* SDLPluginProvider::createPlugin(const Common::String &filename) const {
+ return new DCPlugin(filename);
}
diff --git a/backends/plugins/dc/dc-provider.h b/backends/plugins/dc/dc-provider.h
index f13bdf0636..1b96f55d4d 100644
--- a/backends/plugins/dc/dc-provider.h
+++ b/backends/plugins/dc/dc-provider.h
@@ -30,9 +30,16 @@
#if defined(DYNAMIC_MODULES) && defined(__DC__)
-class DCPluginProvider : public PluginProvider {
-public:
- virtual PluginList getPlugins();
+class DCPluginProvider : public FilePluginProvider {
+protected:
+ Plugin* createPlugin(const Common::String &filename) const;
+
+ virtual const char* getPrefix() const { return ""; }
+ virtual const char* getSuffix() const { return ".PLG"; }
+
+ virtual void addCustomDirectories(Common::StringList &dirs) const {
+ dirs.push_back("/");
+ }
};
#endif // defined(DYNAMIC_MODULES) && defined(__DC__)
diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp
index a268aa36e1..39847e53bf 100644
--- a/backends/plugins/posix/posix-provider.cpp
+++ b/backends/plugins/posix/posix-provider.cpp
@@ -27,10 +27,8 @@
#include "backends/plugins/posix/posix-provider.h"
#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
#include <dlfcn.h>
-#define PLUGIN_DIRECTORY "plugins/"
class POSIXPlugin : public DynamicPlugin {
@@ -68,6 +66,7 @@ public:
return DynamicPlugin::loadPlugin();
}
+
void unloadPlugin() {
DynamicPlugin::unloadPlugin();
if (_dlHandle) {
@@ -79,42 +78,8 @@ public:
};
-PluginList POSIXPluginProvider::getPlugins() {
- PluginList pl;
-
-
- // Load dynamic plugins
- // TODO... this is right now just a nasty hack.
- // This should search one or multiple directories for all plugins it can
- // find (to this end, we maybe should use a special prefix/suffix; e.g.
- // instead of libscumm.so, use scumm.engine or scumm.plugin etc.).
- //
- // The list of directories to search could be e.g.:
- // User specified (via config file), ".", "./plugins", "$(prefix)/lib".
- //
- // We also need to add code which ensures what we are looking at is
- // a) a ScummVM engine and b) matches the version of the executable.
- // Hence one more symbol should be exported by plugins which returns
- // the "ABI" version the plugin was built for, and we can compare that
- // to the ABI version of the executable.
-
- // Load all plugins.
- // Scan for all plugins in this directory
- FilesystemNode dir(PLUGIN_DIRECTORY);
- FSList files;
- if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
- error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
- }
-
- for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- Common::String name(i->getName());
- if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
- pl.push_back(new POSIXPlugin(i->getPath()));
- }
- }
-
-
- return pl;
+Plugin* POSIXPluginProvider::createPlugin(const Common::String &filename) const {
+ return new POSIXPlugin(filename);
}
diff --git a/backends/plugins/posix/posix-provider.h b/backends/plugins/posix/posix-provider.h
index 7a7b780fbe..40c16b3e11 100644
--- a/backends/plugins/posix/posix-provider.h
+++ b/backends/plugins/posix/posix-provider.h
@@ -30,9 +30,9 @@
#if defined(DYNAMIC_MODULES) && defined(UNIX)
-class POSIXPluginProvider : public PluginProvider {
-public:
- virtual PluginList getPlugins();
+class POSIXPluginProvider : public FilePluginProvider {
+protected:
+ Plugin* createPlugin(const Common::String &filename) const;
};
#endif // defined(DYNAMIC_MODULES) && defined(UNIX)
diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp
index 5cdc7223a5..6df1dec680 100644
--- a/backends/plugins/sdl/sdl-provider.cpp
+++ b/backends/plugins/sdl/sdl-provider.cpp
@@ -27,11 +27,9 @@
#include "backends/plugins/sdl/sdl-provider.h"
#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
#include "SDL.h"
#include "SDL_loadso.h"
-#define PLUGIN_DIRECTORY "plugins/"
class SDLPlugin : public DynamicPlugin {
@@ -69,6 +67,7 @@ public:
return DynamicPlugin::loadPlugin();
}
+
void unloadPlugin() {
DynamicPlugin::unloadPlugin();
if (_dlHandle) {
@@ -79,43 +78,9 @@ public:
};
-PluginList SDLPluginProvider::getPlugins() {
- PluginList pl;
-
-
- // Load dynamic plugins
- // TODO... this is right now just a nasty hack.
- // This should search one or multiple directories for all plugins it can
- // find (to this end, we maybe should use a special prefix/suffix; e.g.
- // instead of libscumm.so, use scumm.engine or scumm.plugin etc.).
- //
- // The list of directories to search could be e.g.:
- // User specified (via config file), ".", "./plugins", "$(prefix)/lib".
- //
- // We also need to add code which ensures what we are looking at is
- // a) a ScummVM engine and b) matches the version of the executable.
- // Hence one more symbol should be exported by plugins which returns
- // the "ABI" version the plugin was built for, and we can compare that
- // to the ABI version of the executable.
-
- // Load all plugins.
- // Scan for all plugins in this directory
- FilesystemNode dir(PLUGIN_DIRECTORY);
- FSList files;
- if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
- error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
- }
-
- for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- Common::String name(i->getName());
- if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
- pl.push_back(new SDLPlugin(i->getPath()));
- }
- }
-
-
- return pl;
+Plugin* SDLPluginProvider::createPlugin(const Common::String &filename) const {
+ return new SDLPlugin(filename);
}
-#endif // defined(DYNAMIC_MODULES) && defined(UNIX)
+#endif // defined(DYNAMIC_MODULES) && defined(SDL_BACKEND)
diff --git a/backends/plugins/sdl/sdl-provider.h b/backends/plugins/sdl/sdl-provider.h
index 7e03a4ec57..a9ec657e33 100644
--- a/backends/plugins/sdl/sdl-provider.h
+++ b/backends/plugins/sdl/sdl-provider.h
@@ -30,9 +30,9 @@
#if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND)
-class SDLPluginProvider : public PluginProvider {
-public:
- virtual PluginList getPlugins();
+class SDLPluginProvider : public FilePluginProvider {
+protected:
+ Plugin* createPlugin(const Common::String &filename) const;
};
#endif // defined(DYNAMIC_MODULES) && defined(UNIX)
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index 8cb9a762b2..0592638140 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -27,14 +27,9 @@
#include "backends/plugins/win32/win32-provider.h"
#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
#include <windows.h>
-#define PLUGIN_DIRECTORY ""
-#define PLUGIN_PREFIX ""
-#define PLUGIN_SUFFIX ".dll"
-
class Win32Plugin : public DynamicPlugin {
private:
@@ -94,6 +89,7 @@ public:
return DynamicPlugin::loadPlugin();
}
+
void unloadPlugin() {
DynamicPlugin::unloadPlugin();
if (_dlHandle) {
@@ -107,42 +103,8 @@ public:
};
-PluginList Win32PluginProvider::getPlugins() {
- PluginList pl;
-
-
- // Load dynamic plugins
- // TODO... this is right now just a nasty hack.
- // This should search one or multiple directories for all plugins it can
- // find (to this end, we maybe should use a special prefix/suffix; e.g.
- // instead of libscumm.so, use scumm.engine or scumm.plugin etc.).
- //
- // The list of directories to search could be e.g.:
- // User specified (via config file), ".", "./plugins", "$(prefix)/lib".
- //
- // We also need to add code which ensures what we are looking at is
- // a) a ScummVM engine and b) matches the version of the executable.
- // Hence one more symbol should be exported by plugins which returns
- // the "ABI" version the plugin was built for, and we can compare that
- // to the ABI version of the executable.
-
- // Load all plugins.
- // Scan for all plugins in this directory
- FilesystemNode dir(PLUGIN_DIRECTORY);
- FSList files;
- if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
- error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
- }
-
- for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- Common::String name(i->getName());
- if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
- pl.push_back(new Win32Plugin(i->getPath()));
- }
- }
-
-
- return pl;
+Plugin* Win32PluginProvider::createPlugin(const Common::String &filename) const {
+ return new Win32Plugin(filename);
}
diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h
index e80e77521d..e4b0be7395 100644
--- a/backends/plugins/win32/win32-provider.h
+++ b/backends/plugins/win32/win32-provider.h
@@ -30,9 +30,14 @@
#if defined(DYNAMIC_MODULES) && defined(_WIN32)
-class Win32PluginProvider : public PluginProvider {
-public:
- virtual PluginList getPlugins();
+class Win32PluginProvider : public FilePluginProvider {
+protected:
+ Plugin* createPlugin(const Common::String &filename) const;
+
+ virtual const char* getPrefix() const { return ""; }
+ virtual const char* getSuffix() const { return ".dll"; }
+
+ virtual void addCustomDirectories(Common::StringList &dirs) const {}
};
#endif // defined(DYNAMIC_MODULES) && defined(_WIN32)
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 573cb59c79..a4c867edee 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -116,14 +116,14 @@ static const char HELP_STRING[] =
" --render-mode=MODE Enable additional render modes (cga, ega, hercGreen,\n"
" hercAmber, amiga)\n"
"\n"
-#if !defined(DISABLE_SKY) || !defined(DISABLE_QUEEN)
+#if defined(ENABLE_SKY) || defined(ENABLE_QUEEN)
" --alt-intro Use alternative intro for CD versions of Beneath a\n"
" Steel Sky and Flight of the Amazon Queen\n"
#endif
" --copy-protection Enable copy protection in SCUMM games, when\n"
" ScummVM disables it by default.\n"
" --talkspeed=NUM Set talk speed for games (default: 60)\n"
-#ifndef DISABLE_SCUMM
+#ifdef ENABLE_SCUMM
" --demo-mode Start demo mode of Maniac Mansion\n"
" --tempo=NUM Set music tempo (in percent, 50-200) for SCUMM games\n"
" (default: 100)\n"
@@ -190,19 +190,19 @@ void registerDefaults() {
ConfMan.registerDefault("save_slot", -1);
ConfMan.registerDefault("autosave_period", 5 * 60); // By default, trigger autosave every 5 minutes
-#if !defined(DISABLE_SCUMM) || !defined(DISABLE_SWORD2)
+#if defined(ENABLE_SCUMM) || defined(ENABLE_SWORD2)
ConfMan.registerDefault("object_labels", true);
#endif
ConfMan.registerDefault("copy_protection", false);
ConfMan.registerDefault("talkspeed", 60);
-#ifndef DISABLE_SCUMM
+#ifdef ENABLE_SCUMM
ConfMan.registerDefault("demo_mode", false);
ConfMan.registerDefault("tempo", 0);
#endif
-#if !defined(DISABLE_SKY) || !defined(DISABLE_QUEEN)
+#if defined(ENABLE_SKY) || defined(ENABLE_QUEEN)
ConfMan.registerDefault("alt_intro", false);
#endif
@@ -513,7 +513,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
DO_LONG_OPTION("target-md5")
END_OPTION
-#ifndef DISABLE_SCUMM
+#ifdef ENABLE_SCUMM
DO_LONG_OPTION_INT("tempo")
END_OPTION
@@ -521,7 +521,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, char **ar
END_OPTION
#endif
-#if !defined(DISABLE_SKY) || !defined(DISABLE_QUEEN)
+#if defined(ENABLE_SKY) || defined(ENABLE_QUEEN)
DO_LONG_OPTION_BOOL("alt-intro")
END_OPTION
#endif
diff --git a/base/main.cpp b/base/main.cpp
index 257d691139..a666110b83 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -343,9 +343,9 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
launcherDialog(system);
}
PluginManager::instance().unloadPluginsExcept(NULL);
- PluginManager::instance().destroy();
- ConfMan.destroy();
- g_gui.destroy();
+ PluginManager::destroy();
+ Common::ConfigManager::destroy();
+ GUI::NewGui::destroy();
return 0;
}
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 188eb10475..9e2c2599ce 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -63,7 +63,6 @@ SaveStateList Plugin::listSaves(const char *target) const {
}
-#ifndef DYNAMIC_MODULES
class StaticPlugin : public Plugin {
public:
StaticPlugin(PluginObject *pluginobject, PluginType type) {
@@ -100,61 +99,61 @@ public:
// "Loader" for the static plugins.
// Iterate over all registered (static) plugins and load them.
- #ifndef DISABLE_SCUMM
+ #if PLUGIN_ENABLED_STATIC(SCUMM)
LINK_PLUGIN(SCUMM)
#endif
- #ifndef DISABLE_AGI
+ #if PLUGIN_ENABLED_STATIC(AGI)
LINK_PLUGIN(AGI)
#endif
- #ifndef DISABLE_AGOS
+ #if PLUGIN_ENABLED_STATIC(AGOS)
LINK_PLUGIN(AGOS)
#endif
- #ifndef DISABLE_CINE
+ #if PLUGIN_ENABLED_STATIC(CINE)
LINK_PLUGIN(CINE)
#endif
- #ifndef DISABLE_CRUISE
+ #if PLUGIN_ENABLED_STATIC(CRUISE)
LINK_PLUGIN(CRUISE)
#endif
- #ifndef DISABLE_DRASCULA
+ #if PLUGIN_ENABLED_STATIC(DRASCULA)
LINK_PLUGIN(DRASCULA)
#endif
- #ifndef DISABLE_GOB
+ #if PLUGIN_ENABLED_STATIC(GOB)
LINK_PLUGIN(GOB)
#endif
- #ifndef DISABLE_IGOR
+ #if PLUGIN_ENABLED_STATIC(IGOR)
LINK_PLUGIN(IGOR)
#endif
- #ifndef DISABLE_KYRA
+ #if PLUGIN_ENABLED_STATIC(KYRA)
LINK_PLUGIN(KYRA)
#endif
- #ifndef DISABLE_LURE
+ #if PLUGIN_ENABLED_STATIC(LURE)
LINK_PLUGIN(LURE)
#endif
- #ifndef DISABLE_M4
+ #if PLUGIN_ENABLED_STATIC(M4)
LINK_PLUGIN(M4)
#endif
- #ifndef DISABLE_MADE
+ #if PLUGIN_ENABLED_STATIC(MADE)
LINK_PLUGIN(MADE)
#endif
- #ifndef DISABLE_PARALLACTION
+ #if PLUGIN_ENABLED_STATIC(PARALLACTION)
LINK_PLUGIN(PARALLACTION)
#endif
- #ifndef DISABLE_QUEEN
+ #if PLUGIN_ENABLED_STATIC(QUEEN)
LINK_PLUGIN(QUEEN)
#endif
- #ifndef DISABLE_SAGA
+ #if PLUGIN_ENABLED_STATIC(SAGA)
LINK_PLUGIN(SAGA)
#endif
- #ifndef DISABLE_SKY
+ #if PLUGIN_ENABLED_STATIC(SKY)
LINK_PLUGIN(SKY)
#endif
- #ifndef DISABLE_SWORD1
+ #if PLUGIN_ENABLED_STATIC(SWORD1)
LINK_PLUGIN(SWORD1)
#endif
- #ifndef DISABLE_SWORD2
+ #if PLUGIN_ENABLED_STATIC(SWORD2)
LINK_PLUGIN(SWORD2)
#endif
- #ifndef DISABLE_TOUCHE
+ #if PLUGIN_ENABLED_STATIC(TOUCHE)
LINK_PLUGIN(TOUCHE)
#endif
@@ -162,19 +161,75 @@ public:
}
};
+#ifdef DYNAMIC_MODULES
+
+PluginList FilePluginProvider::getPlugins() {
+ PluginList pl;
+
+ // Prepare the list of directories to search
+ Common::StringList pluginDirs;
+ // TODO: Add the user specified directory (via config file)
+ pluginDirs.push_back(".");
+ pluginDirs.push_back("plugins");
+
+ // Add the provider's custom directories
+ addCustomDirectories(pluginDirs);
+
+ Common::StringList::const_iterator d;
+ for (d = pluginDirs.begin(); d != pluginDirs.end(); d++) {
+ // Load all plugins.
+ // Scan for all plugins in this directory
+ FilesystemNode dir(*d);
+ FSList files;
+ if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
+ debug(1, "Couldn't open plugin directory '%s'", d->c_str());
+ continue;
+ } else {
+ debug(1, "Reading plugins from plugin directory '%s'", d->c_str());
+ }
+
+ for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
+ Common::String name(i->getName());
+ if (name.hasPrefix(getPrefix()) && name.hasSuffix(getSuffix())) {
+ pl.push_back(createPlugin(i->getPath()));
+ }
+ }
+ }
+
+ return pl;
+}
+
+const char* FilePluginProvider::getPrefix() const {
+#ifdef PLUGIN_PREFIX
+ return PLUGIN_PREFIX;
+#else
+ return "";
+#endif
+}
+
+const char* FilePluginProvider::getSuffix() const {
+#ifdef PLUGIN_SUFFIX
+ return PLUGIN_SUFFIX;
+#else
+ return "";
+#endif
+}
+void FilePluginProvider::addCustomDirectories(Common::StringList &dirs) const {
+#ifdef PLUGIN_DIRECTORY
+ dirs.push_back(PLUGIN_DIRECTORY);
#endif
+}
+
+#endif // DYNAMIC_MODULES
#pragma mark -
DECLARE_SINGLETON(PluginManager);
PluginManager::PluginManager() {
-#ifndef DYNAMIC_MODULES
- // Add the static plugin provider if we do not build with dynamic
- // plugins.
+ // Always add the static plugin provider.
addPluginProvider(new StaticPluginProvider());
-#endif
}
PluginManager::~PluginManager() {
diff --git a/base/plugins.h b/base/plugins.h
index da48a7c22a..ca08a0c628 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -100,6 +100,15 @@ public:
};
+#define STATIC_PLUGIN 1
+#define DYNAMIC_PLUGIN 2
+
+#define PLUGIN_ENABLED_STATIC(ID) \
+ (defined(ENABLE_##ID) && !PLUGIN_ENABLED_DYNAMIC(ID))
+
+#define PLUGIN_ENABLED_DYNAMIC(ID) \
+ (defined(ENABLE_##ID) && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
+
/**
* REGISTER_PLUGIN is a convenience macro meant to ease writing
* the plugin interface for our modules. In particular, using it
@@ -109,15 +118,16 @@ public:
* @todo add some means to query the plugin API version etc.
*/
-#ifndef DYNAMIC_MODULES
-#define REGISTER_PLUGIN(ID,TYPE,PLUGINCLASS) \
+#define REGISTER_PLUGIN_STATIC(ID,TYPE,PLUGINCLASS) \
PluginType g_##ID##_type = TYPE; \
PluginObject *g_##ID##_getObject() { \
return new PLUGINCLASS(); \
} \
void dummyFuncToAllowTrailingSemicolon()
-#else
-#define REGISTER_PLUGIN(ID,TYPE,PLUGINCLASS) \
+
+#ifdef DYNAMIC_MODULES
+
+#define REGISTER_PLUGIN_DYNAMIC(ID,TYPE,PLUGINCLASS) \
extern "C" { \
PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
PLUGIN_EXPORT int32 PLUGIN_getType() { return TYPE; } \
@@ -127,7 +137,8 @@ public:
} \
} \
void dummyFuncToAllowTrailingSemicolon()
-#endif
+
+#endif // DYNAMIC_MODULES
/** List of plugins. */
@@ -147,6 +158,19 @@ public:
virtual PluginList getPlugins() = 0;
};
+class FilePluginProvider : public PluginProvider {
+public:
+ virtual PluginList getPlugins();
+
+protected:
+ virtual Plugin* createPlugin(const Common::String &filename) const = 0;
+
+ virtual const char* getPrefix() const;
+ virtual const char* getSuffix() const;
+
+ virtual void addCustomDirectories(Common::StringList &dirs) const;
+};
+
/**
* Instances of this class manage all plugins, including loading them,
* making wrapper objects of class Plugin available, and unloading them.
diff --git a/common/array.h b/common/array.h
index ff98ec4307..24a07b49bf 100644
--- a/common/array.h
+++ b/common/array.h
@@ -30,7 +30,7 @@
namespace Common {
-template <class T>
+template<class T>
class Array {
protected:
uint _capacity;
@@ -45,7 +45,7 @@ public:
public:
Array() : _capacity(0), _size(0), _data(0) {}
- Array(const Array<T>& array) : _capacity(0), _size(0), _data(0) {
+ Array(const Array<T> &array) : _capacity(0), _size(0), _data(0) {
_size = array._size;
_capacity = _size + 32;
_data = new T[_capacity];
@@ -53,21 +53,21 @@ public:
}
~Array() {
- delete [] _data;
+ delete[] _data;
}
- void push_back(const T& element) {
+ void push_back(const T &element) {
ensureCapacity(_size + 1);
_data[_size++] = element;
}
- void push_back(const Array<T>& array) {
+ void push_back(const Array<T> &array) {
ensureCapacity(_size + array._size);
copy(array._data, array._data + array._size, _data + _size);
_size += array._size;
}
- void insert_at(int idx, const T& element) {
+ void insert_at(int idx, const T &element) {
assert(idx >= 0 && (uint)idx <= _size);
ensureCapacity(_size + 1);
copy_backward(_data + idx, _data + _size, _data + _size + 1);
@@ -85,17 +85,17 @@ public:
// TODO: insert, remove, ...
- T& operator [](int idx) {
+ T& operator[](int idx) {
assert(idx >= 0 && (uint)idx < _size);
return _data[idx];
}
- const T& operator [](int idx) const {
+ const T& operator[](int idx) const {
assert(idx >= 0 && (uint)idx < _size);
return _data[idx];
}
- Array<T>& operator =(const Array<T>& array) {
+ Array<T>& operator=(const Array<T> &array) {
if (this == &array)
return *this;
diff --git a/common/func.h b/common/func.h
index fa8f0d2151..95df96123a 100644
--- a/common/func.h
+++ b/common/func.h
@@ -279,13 +279,13 @@ private:
* Base template for hash functor objects, used by HashMap.
* This needs to be specialized for every type that you need to hash.
*/
-template <typename T> struct Hash;
+template<typename T> struct Hash;
#define GENERATE_TRIVIAL_HASH_FUNCTOR(T) \
- template <> struct Hash<T> : public UnaryFunction<T, uint> { \
- uint operator()(T val) const { return (uint)val; } \
- }
+ template<> struct Hash<T> : public UnaryFunction<T, uint> { \
+ uint operator()(T val) const { return (uint)val; } \
+ }
GENERATE_TRIVIAL_HASH_FUNCTOR(bool);
GENERATE_TRIVIAL_HASH_FUNCTOR(char);
diff --git a/common/hashmap.h b/common/hashmap.h
index fb1de38fd1..81a4b0d17e 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -94,7 +94,7 @@ uint nextTableSize(uint x);
* triggered instead. Hence if you are not sure whether a key is contained in
* the map, use contains() first to check for its presence.
*/
-template <class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> >
+template<class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> >
class HashMap {
private:
#if defined (PALMOS_MODE)
@@ -113,17 +113,17 @@ public:
#ifdef USE_HASHMAP_MEMORY_POOL
MemoryPool _nodePool;
- Node *allocNode(const Key& key) {
+ Node *allocNode(const Key &key) {
void* mem = _nodePool.malloc();
return new (mem) Node(key);
}
- void freeNode(Node* node) {
+ void freeNode(Node *node) {
node->~Node();
_nodePool.free(node);
}
#else
- Node* allocNode(const Key& key) {
+ Node* allocNode(const Key &key) {
return new Node(key);
}
@@ -145,7 +145,7 @@ public:
mutable int _collisions, _lookups;
#endif
- void assign(const HM_t& map);
+ void assign(const HM_t &map);
int lookup(const Key &key) const;
int lookupAndCreateIfMissing(const Key &key);
void expand_array(uint newsize);
@@ -181,13 +181,13 @@ public:
template<class T>
IteratorImpl(const IteratorImpl<T> &c) : _idx(c._idx), _hashmap(c._hashmap) {}
- NodeType &operator *() const { return *deref(); }
+ NodeType &operator*() const { return *deref(); }
NodeType *operator->() const { return deref(); }
- bool operator ==(const IteratorImpl &iter) const { return _idx == iter._idx && _hashmap == iter._hashmap; }
- bool operator !=(const IteratorImpl &iter) const { return !(*this == iter); }
+ bool operator==(const IteratorImpl &iter) const { return _idx == iter._idx && _hashmap == iter._hashmap; }
+ bool operator!=(const IteratorImpl &iter) const { return !(*this == iter); }
- IteratorImpl &operator ++() {
+ IteratorImpl &operator++() {
assert(_hashmap);
do {
_idx++;
@@ -198,7 +198,7 @@ public:
return *this;
}
- IteratorImpl operator ++(int) {
+ IteratorImpl operator++(int) {
IteratorImpl old = *this;
operator ++();
return old;
@@ -210,10 +210,10 @@ public:
typedef IteratorImpl<const Node> const_iterator;
HashMap();
- HashMap(const HM_t& map);
+ HashMap(const HM_t &map);
~HashMap();
- HM_t &operator =(const HM_t &map) {
+ HM_t &operator=(const HM_t &map) {
if (this == &map)
return *this;
@@ -227,8 +227,8 @@ public:
bool contains(const Key &key) const;
- Val &operator [](const Key &key);
- const Val &operator [](const Key &key) const;
+ Val &operator[](const Key &key);
+ const Val &operator[](const Key &key) const;
Val &getVal(const Key &key);
const Val &getVal(const Key &key) const;
@@ -291,7 +291,7 @@ public:
/**
* Base constructor, creates an empty hashmap.
*/
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
HashMap<Key, Val, HashFunc, EqualFunc>::HashMap() :
#ifdef USE_HASHMAP_MEMORY_POOL
_nodePool(sizeof(Node)),
@@ -315,8 +315,8 @@ HashMap<Key, Val, HashFunc, EqualFunc>::HashMap() :
* We must provide a custom copy constructor as we use pointers
* to heap buffers for the internal storage.
*/
-template <class Key, class Val, class HashFunc, class EqualFunc>
-HashMap<Key, Val, HashFunc, EqualFunc>::HashMap(const HM_t& map) :
+template<class Key, class Val, class HashFunc, class EqualFunc>
+HashMap<Key, Val, HashFunc, EqualFunc>::HashMap(const HM_t &map) :
#ifdef USE_HASHMAP_MEMORY_POOL
_nodePool(sizeof(Node)),
#endif
@@ -327,7 +327,7 @@ HashMap<Key, Val, HashFunc, EqualFunc>::HashMap(const HM_t& map) :
/**
* Destructor, frees all used memory.
*/
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
for (uint ctr = 0; ctr < _arrsize; ++ctr)
if (_arr[ctr] != NULL)
@@ -343,8 +343,8 @@ HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
* @note We do *not* deallocate the previous storage here -- the caller is
* responsible for doing that!
*/
-template <class Key, class Val, class HashFunc, class EqualFunc>
-void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t& map) {
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t &map) {
_arrsize = map._arrsize;
_arr = new Node *[_arrsize];
assert(_arr != NULL);
@@ -364,7 +364,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t& map) {
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::clear(bool shrinkArray) {
for (uint ctr = 0; ctr < _arrsize; ++ctr) {
if (_arr[ctr] != NULL) {
@@ -385,7 +385,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::clear(bool shrinkArray) {
_nele = 0;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expand_array(uint newsize) {
assert(newsize > _arrsize);
uint ctr, dex;
@@ -428,7 +428,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::expand_array(uint newsize) {
return;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
int HashMap<Key, Val, HashFunc, EqualFunc>::lookup(const Key &key) const {
uint ctr = _hash(key) % _arrsize;
@@ -450,7 +450,7 @@ int HashMap<Key, Val, HashFunc, EqualFunc>::lookup(const Key &key) const {
return ctr;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
int HashMap<Key, Val, HashFunc, EqualFunc>::lookupAndCreateIfMissing(const Key &key) {
uint ctr = lookup(key);
@@ -469,30 +469,30 @@ int HashMap<Key, Val, HashFunc, EqualFunc>::lookupAndCreateIfMissing(const Key &
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
bool HashMap<Key, Val, HashFunc, EqualFunc>::contains(const Key &key) const {
uint ctr = lookup(key);
return (_arr[ctr] != NULL);
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
-Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator [](const Key &key) {
+template<class Key, class Val, class HashFunc, class EqualFunc>
+Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator[](const Key &key) {
return getVal(key);
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
-const Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator [](const Key &key) const {
+template<class Key, class Val, class HashFunc, class EqualFunc>
+const Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator[](const Key &key) const {
return getVal(key);
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key) {
uint ctr = lookupAndCreateIfMissing(key);
assert(_arr[ctr] != NULL);
return _arr[ctr]->_value;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
const Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key) const {
uint ctr = lookup(key);
if (_arr[ctr] != NULL)
@@ -501,14 +501,14 @@ const Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key) const
return _defaultVal;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::setVal(const Key &key, const Val &val) {
uint ctr = lookupAndCreateIfMissing(key);
assert(_arr[ctr] != NULL);
_arr[ctr]->_value = val;
}
-template <class Key, class Val, class HashFunc, class EqualFunc>
+template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::erase(const Key &key) {
// This is based on code in the Wikipedia article on Hash tables.
uint i = lookup(key);
diff --git a/common/list.h b/common/list.h
index 2fe07a5ccc..c4e7b47644 100644
--- a/common/list.h
+++ b/common/list.h
@@ -33,7 +33,7 @@ namespace Common {
* Simple double linked list, modeled after the list template of the standard
* C++ library.
*/
-template <class t_T>
+template<class t_T>
class List {
protected:
#if defined (_WIN32_WCE) || defined (_MSC_VER)
@@ -52,7 +52,7 @@ public:
Node(const t_T2 &x) : _data(x) {}
};
- template <class t_T2>
+ template<class t_T2>
class Iterator {
template<class T> friend class Iterator;
friend class List<t_T>;
@@ -70,7 +70,7 @@ public:
Iterator(const Iterator<T> &c) : _node(c._node) {}
template<class T>
- Iterator<t_T2> &operator =(const Iterator<T> &c) {
+ Iterator<t_T2> &operator=(const Iterator<T> &c) {
_node = c._node;
return *this;
}
@@ -104,7 +104,7 @@ public:
#if (__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)
return static_cast<List<t_T>::Node<t_T2> *>(_node)->_data;
#else
- return static_cast<Node<t_T2>*>(_node)->_data;
+ return static_cast<Node<t_T2> *>(_node)->_data;
#endif
}
t_T2 *operator->() const {
@@ -135,7 +135,7 @@ public:
_anchor._prev = &_anchor;
_anchor._next = &_anchor;
}
- List(const List<t_T>& list) {
+ List(const List<t_T> &list) {
_anchor._prev = &_anchor;
_anchor._next = &_anchor;
@@ -146,15 +146,15 @@ public:
clear();
}
- void push_front(const t_T& element) {
+ void push_front(const t_T &element) {
insert(begin(), element);
}
- void push_back(const t_T& element) {
+ void push_back(const t_T &element) {
insert(end(), element);
}
- void insert(iterator pos, const t_T& element) {
+ void insert(iterator pos, const t_T &element) {
NodeBase *newNode = new Node<t_T>(element);
newNode->_next = pos._node;
@@ -163,7 +163,7 @@ public:
newNode->_next->_prev = newNode;
}
- template <typename iterator2>
+ template<typename iterator2>
void insert(iterator pos, iterator2 first, iterator2 last) {
for (; first != last; ++first)
insert(pos, *first);
@@ -210,7 +210,7 @@ public:
}
- List<t_T>& operator =(const List<t_T>& list) {
+ List<t_T> &operator=(const List<t_T> &list) {
if (this != &list) {
iterator i;
const_iterator j;
diff --git a/common/noncopyable.h b/common/noncopyable.h
index e0af397546..f639d9abf7 100644
--- a/common/noncopyable.h
+++ b/common/noncopyable.h
@@ -38,7 +38,7 @@ public:
private:
// Prevent copying instances by accident
NonCopyable(const NonCopyable&);
- NonCopyable& operator= (const NonCopyable&);
+ NonCopyable& operator=(const NonCopyable&);
};
} // End of namespace Common
diff --git a/common/singleton.h b/common/singleton.h
index 849bf208bb..1a7b339bf6 100644
--- a/common/singleton.h
+++ b/common/singleton.h
@@ -33,13 +33,13 @@ namespace Common {
/**
* Generic template base class for implementing the singleton design pattern.
*/
-template <class T>
+template<class T>
class Singleton : NonCopyable {
private:
- Singleton<T>(const Singleton<T>&);
- Singleton<T>& operator= (const Singleton<T>&);
+ Singleton<T>(const Singleton<T> &);
+ Singleton<T> &operator=(const Singleton<T> &);
- static T* _singleton;
+ static T *_singleton;
/**
* The default object factory used by the template class Singleton.
@@ -53,10 +53,15 @@ private:
//FIXME evc4 and msvc7 doesn't like it as private member
public:
#endif
- static T* makeInstance() {
+ static T *makeInstance() {
return new T();
}
+ static void destroyInstance() {
+ delete _singleton;
+ _singleton = 0;
+ }
+
public:
static T& instance() {
@@ -71,9 +76,9 @@ public:
_singleton = T::makeInstance();
return *_singleton;
}
- virtual void destroy() {
- delete _singleton;
- _singleton = 0;
+
+ static void destroy() {
+ T::destroyInstance();
}
protected:
Singleton<T>() { }
@@ -86,7 +91,7 @@ protected:
typedef T SingletonBaseType;
};
-#define DECLARE_SINGLETON(T) template<> T* Common::Singleton<T>::_singleton=0
+#define DECLARE_SINGLETON(T) template<> T *Common::Singleton<T>::_singleton = 0
} // End of namespace Common
diff --git a/common/stack.h b/common/stack.h
index 1d38c7d2ac..876efacc3f 100644
--- a/common/stack.h
+++ b/common/stack.h
@@ -33,7 +33,7 @@ namespace Common {
/**
* Extremly simple fixed size stack class.
*/
-template <class T, int MAX_SIZE = 10>
+template<class T, int MAX_SIZE = 10>
class FixedStack {
protected:
T _stack[MAX_SIZE];
@@ -47,15 +47,15 @@ public:
void clear() {
_size = 0;
}
- void push(const T& x) {
+ void push(const T &x) {
assert(_size < MAX_SIZE);
_stack[_size++] = x;
}
- const T& top() const {
+ const T &top() const {
assert(_size > 0);
return _stack[_size - 1];
}
- T& top() {
+ T &top() {
assert(_size > 0);
return _stack[_size - 1];
}
@@ -67,11 +67,11 @@ public:
int size() const {
return _size;
}
- T& operator [](int i) {
+ T &operator[](int i) {
assert(0 <= i && i < MAX_SIZE);
return _stack[i];
}
- const T& operator [](int i) const {
+ const T &operator[](int i) const {
assert(0 <= i && i < MAX_SIZE);
return _stack[i];
}
@@ -81,7 +81,7 @@ public:
/**
* Variable size stack class, implemented using our Array class.
*/
-template <class T>
+template<class T>
class Stack {
protected:
Array<T> _stack;
@@ -95,7 +95,7 @@ public:
void clear() {
_stack.clear();
}
- void push(const T& x) {
+ void push(const T &x) {
_stack.push_back(x);
}
T top() const {
@@ -110,7 +110,7 @@ public:
int size() const {
return _stack.size();
}
- T operator [](int i) {
+ T operator[](int i) {
return _stack[i];
}
};
diff --git a/configure b/configure
index 8d9f54e1d9..d71501098a 100755
--- a/configure
+++ b/configure
@@ -87,7 +87,7 @@ add_engine agi "AGI" yes
add_engine agos "AGOS" yes
add_engine cine "Cinematique evo 1" yes
add_engine cruise "Cinematique evo 2" no
-add_engine drascula "Drascula: The Vampire Strikes Back" no
+add_engine drascula "Drascula: The Vampire Strikes Back" yes
add_engine gob "Gobli*ns" yes
add_engine igor "Igor: Objective Uikokahonia" no
add_engine kyra "Legend of Kyrandia" yes
@@ -105,7 +105,8 @@ add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
_endian=unknown
_need_memalign=no
_have_x86=no
-_build_plugins=no
+_dynamic_modules=no
+_plugins_default=static
_nasm=auto
# more defaults
@@ -363,21 +364,33 @@ get_engine_sub() {
# Enable the given engine
engine_enable() {
- engine=`echo $1 | sed 's/-/_/g'`
- if test "`get_engine_build ${engine}`" = "no" ; then
- eval _engine_${engine}_build=yes
+ # Get the parameter
+ if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
+ eng=`echo $1 | cut -d '=' -f 1`
+ opt=`echo $1 | cut -d '=' -f 2`
+ else
+ eng=$1
+ opt=yes
+ fi
+ engine=`echo $eng | sed 's/-/_/g'`
+ if test "$opt" = "static" -o "$opt" = "dynamic" -o "$opt" = "yes" ; then
+ if test "`get_engine_build ${engine}`" != "$opt" ; then
+ eval _engine_${engine}_build=$opt
+ else
+ option_error
+ fi
else
- option_error --enable-$1
+ option_error
fi
}
# Disable the given engine
engine_disable() {
engine=`echo $1 | sed 's/-/_/g'`
- if test "`get_engine_build $engine`" = "yes" ; then
+ if test "`get_engine_build $engine`" != "no" ; then
eval _engine_${engine}_build=no
else
- option_error --disable-$1
+ option_error
fi
}
@@ -420,27 +433,35 @@ show_subengine_help() {
# Prepare the strings about the engines to build
prepare_engine_build_strings() {
- string_yes=`get_engine_build_string $1 yes`
- if test -n "$string_yes" ; then
- _engines_built="${_engines_built}#$string_yes@"
+ string=`get_engine_build_string $1 static`
+ if test -n "$string" ; then
+ _engines_built_static="${_engines_built_static}#$string@"
fi
- string_no=`get_engine_build_string $1 no`
- if test -n "$string_no" ; then
- _engines_skipped="${_engines_skipped}#$string_no@"
+ string=`get_engine_build_string $1 dynamic`
+ if test -n "$string" ; then
+ _engines_built_dynamic="${_engines_built_dynamic}#$string@"
+ fi
+
+ string=`get_engine_build_string $1 no`
+ if test -n "$string" ; then
+ _engines_skipped="${_engines_skipped}#$string@"
fi
}
# Get the string about building an engine
get_engine_build_string() {
engine_string=""
- if test `get_engine_build $1` = no ; then
+ engine_build=`get_engine_build $1`
+ if test $engine_build = no ; then
+ # The engine is disabled
if test $2 = no ; then
engine_string=`get_engine_name $1`
else
engine_string=""
fi
else
+ # The engine is enabled, get the custom string
build_string_func=get_${1}_build_string
if ( type $build_string_func | grep function ) 2> /dev/null > /dev/null ; then
engine_string=`$build_string_func $1 $2`
@@ -448,12 +469,16 @@ get_engine_build_string() {
engine_string=`get_subengines_build_string $1 $2`
fi
- if test $2 = yes ; then
- engine_string="`get_engine_name $1` $engine_string"
- else
+ if test $2 = no ; then
if test -n "$engine_string" ; then
engine_string="`get_engine_name $1` $engine_string"
fi
+ else
+ if test $2 = $engine_build ; then
+ engine_string="`get_engine_name $1` $engine_string"
+ else
+ engine_string=""
+ fi
fi
fi
@@ -471,7 +496,7 @@ get_subengines_build_string() {
all=no
fi
done
- if test $2 = yes ; then
+ if test $2 != no ; then
if test -n "$subengine_string" ; then
if test $all = yes ; then
subengine_string="[all games]"
@@ -484,7 +509,7 @@ get_subengines_build_string() {
# Engine specific build strings
get_sword1_build_string() {
- if test $2 = yes ; then
+ if test $2 != no ; then
if test "$_mpeg2" = yes ; then
echo "(w/ mpeg2 cutscenes)"
else
@@ -498,7 +523,7 @@ get_sword2_build_string() {
}
get_scumm_build_string() {
- if test $2 = yes ; then
+ if test $2 != no ; then
base="[v0-v6 games]"
fi
get_subengines_build_string $1 $2 "$base"
@@ -539,8 +564,9 @@ Configuration:
Installation directories:
--prefix=DIR use this prefix for installing ScummVM [/usr/local]
--bindir=DIR directory to install the scummvm binary in [PREFIX/bin]
- --mandir=DIR directory to install the manpage in [PREFIX/man]
+ --mandir=DIR directory to install the manpage in [PREFIX/share/man]
--datadir=DIR directory to install the data files in [PREFIX/share]
+ --libdir=DIR directory to install the plugins in [PREFIX/lib]
Special configuration feature:
--host=HOST cross-compile to target HOST (arm-linux, ...)
@@ -550,8 +576,8 @@ Optional Features:
--disable-debug disable building with debugging symbols
--enable-Werror treat warnings as errors
$engines_help
- --enable-plugins build engines as loadable modules instead of
- static linking them
+ --enable-plugins enable the support for dynamic plugins
+ --default-dynamic make plugins dynamic by default
--disable-mt32emu don't enable the integrated MT-32 emulator
--disable-hq-scalers exclude HQ2x and HQ3x scalers
--disable-scalers exclude scalers
@@ -628,7 +654,8 @@ for ac_option in $@; do
--disable-nasm) _nasm=no ;;
--disable-mpeg2) _mpeg2=no ;;
--disable-fluidsynth) _fluidsynth=no ;;
- --enable-plugins) _build_plugins=yes ;;
+ --enable-plugins) _dynamic_modules=yes ;;
+ --default-dynamic) _plugins_default=dynamic ;;
--enable-mt32emu) _mt32emu=yes ;;
--disable-mt32emu) _mt32emu=no ;;
--with-fluidsynth-prefix=*)
@@ -714,6 +741,9 @@ for ac_option in $@; do
--datadir=*)
_datadir=`echo $ac_option | cut -d '=' -f 2`
;;
+ --libdir=*)
+ _libdir=`echo $ac_option | cut -d '=' -f 2`
+ ;;
--enable-*)
engine_enable `echo $ac_option | cut -d '-' -f 4-`
;;
@@ -721,7 +751,7 @@ for ac_option in $@; do
engine_disable `echo $ac_option | cut -d '-' -f 4-`
;;
*)
- option_error $ac_option
+ option_error
;;
esac;
done;
@@ -893,12 +923,6 @@ if test "$_cxx_major" -ge "3" ; then
add_line_to_config_mk 'HAVE_GCC3 = 1'
fi;
-#
-# Engine selection
-#
-for engine in $_engines; do
- add_to_config_mk_if_no `get_engine_build $engine` "DISABLE_`echo $engine | tr [a-z] [A-Z]` = 1"
-done
add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
@@ -1193,11 +1217,11 @@ add_to_config_h_if_yes $_need_memalign '#define SCUMM_NEED_ALIGNMENT'
# Check whether plugin support is requested and possible
#
echo_n "Checking whether building plugins was requested... "
-echo "$_build_plugins"
+echo "$_dynamic_modules"
_mak_plugins=
_def_plugin="/* -> plugins disabled */"
-if test "$_build_plugins" = yes ; then
+if test "$_dynamic_modules" = yes ; then
echo_n "Checking whether building plugins is supported... "
case $_host_os in
linux*)
@@ -1206,7 +1230,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".so"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX := lib
PLUGIN_SUFFIX := .so
PLUGIN_EXTRA_DEPS =
@@ -1224,7 +1248,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".so"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX := lib
PLUGIN_SUFFIX := .so
PLUGIN_EXTRA_DEPS =
@@ -1241,7 +1265,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".plugin"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .plugin
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
@@ -1258,7 +1282,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".dll"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .dll
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
@@ -1269,12 +1293,12 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im
'
;;
*)
- _build_plugins=no
+ _dynamic_modules=no
_mak_plugins=
_def_plugin=
;;
esac
- echo "$_build_plugins"
+ echo "$_dynamic_modules"
fi
@@ -1521,27 +1545,80 @@ add_to_config_mk_if_yes $_nasm 'HAVE_NASM = 1'
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_mandir" && _mandir="$_prefix/share/man"
test -z "$_datadir" && _datadir="$_prefix/share"
+test -z "$_libdir" && _libdir="$_prefix/lib"
DEFINES="$DEFINES -DDATA_PATH=\\\"$_datadir/scummvm\\\""
+DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$_libdir/scummvm\\\""
#
-# Show which engines ("frontends") are to be built
+# Engine selection
#
-
-_engines_built=""
+_engines_built_static=""
+_engines_built_dynamic=""
_engines_skipped=""
for engine in $_engines; do
if test "`get_engine_sub $engine`" = "no" ; then
+ # It's a main engine
+ if test `get_engine_build $engine` = no ; then
+ isbuilt=no
+ else
+ # If dynamic plugins aren't supported, mark
+ # all the engines as static
+ if test $_dynamic_modules = no ; then
+ eval _engine_${engine}_build=static
+ else
+ # If it wasn't explicitly marked as static or
+ # dynamic, use the configured default
+ if test `get_engine_build $engine` = yes ; then
+ eval _engine_${engine}_build=${_plugins_default}
+ fi
+ fi
+
+ # Prepare the defines
+ if test `get_engine_build $engine` = dynamic ; then
+ isbuilt=DYNAMIC_PLUGIN
+ else
+ eval _engine_${engine}_build=static
+ isbuilt=STATIC_PLUGIN
+ fi
+ fi
+
+ # Prepare the information to be shown
prepare_engine_build_strings $engine
+ else
+ # It's a subengine, just say yes or no
+ if test "`get_engine_build $engine`" = "no" ; then
+ isbuilt=no
+ else
+ isbuilt=1
+ fi
+ fi
+
+ # Save the settings
+ defname="ENABLE_`echo $engine | tr [a-z] [A-Z]`"
+ if test "$isbuilt" = "no" ; then
+ add_line_to_config_mk "# $defname"
+ else
+ add_line_to_config_mk "$defname = $isbuilt"
fi
done
+#
+# Show which engines ("frontends") are to be built
+#
echo
-if test -n "$_engines_built" ; then
- echo "Engines:"
- echo $_engines_built | sed 's/@/\
+if test -n "$_engines_built_static" ; then
+ echo "Engines (builtin):"
+ echo $_engines_built_static | sed 's/@/\
+/g
+s/#/ /g'
+fi
+
+if test -n "$_engines_built_dynamic" ; then
+ echo "Engines (plugins):"
+ echo $_engines_built_dynamic | sed 's/@/\
/g
s/#/ /g'
fi
@@ -1673,6 +1750,7 @@ PREFIX := $_prefix
BINDIR := $_bindir
MANDIR := $_mandir
DATADIR := $_datadir
+LIBDIR := $_libdir
$_config_mk_data
diff --git a/dists/msvc7/drascula.vcproj b/dists/msvc7/drascula.vcproj
index dce4edc34f..8a55a1856b 100644
--- a/dists/msvc7/drascula.vcproj
+++ b/dists/msvc7/drascula.vcproj
@@ -97,6 +97,9 @@
</Configurations>
<Files>
<File
+ RelativePath="..\..\engines\drascula\animation.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp">
</File>
<File
@@ -106,7 +109,13 @@
RelativePath="..\..\engines\drascula\drascula.h">
</File>
<File
- RelativePath="..\..\engines\drascula\texts.h">
+ RelativePath="..\..\engines\drascula\rooms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\texts.cpp">
</File>
</Files>
<Globals>
diff --git a/dists/msvc7/gob.vcproj b/dists/msvc7/gob.vcproj
index 8cb584d212..a8c856ce17 100644
--- a/dists/msvc7/gob.vcproj
+++ b/dists/msvc7/gob.vcproj
@@ -178,6 +178,9 @@
RelativePath="..\..\engines\gob\goblin_v3.cpp">
</File>
<File
+ RelativePath="..\..\engines\gob\goblin_v4.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\gob\init.cpp">
</File>
<File
diff --git a/dists/msvc7/kyra.vcproj b/dists/msvc7/kyra.vcproj
index bdec3e74e0..decc992b81 100644
--- a/dists/msvc7/kyra.vcproj
+++ b/dists/msvc7/kyra.vcproj
@@ -97,6 +97,12 @@
</Configurations>
<Files>
<File
+ RelativePath="..\..\engines\kyra\animator_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\animator_mr.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\animator_v1.cpp">
</File>
<File
@@ -106,9 +112,6 @@
RelativePath="..\..\engines\kyra\animator_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v3.cpp">
- </File>
- <File
RelativePath="..\..\engines\kyra\debugger.cpp">
</File>
<File
@@ -124,6 +127,18 @@
RelativePath="..\..\engines\kyra\gui.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\gui_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\gui_v1.cpp">
</File>
<File
@@ -136,16 +151,16 @@
RelativePath="..\..\engines\kyra\gui_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v3.cpp">
+ RelativePath="..\..\engines\kyra\items_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp">
+ RelativePath="..\..\engines\kyra\items_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v2.cpp">
+ RelativePath="..\..\engines\kyra\items_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v3.cpp">
+ RelativePath="..\..\engines\kyra\items_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\kyra.cpp">
@@ -154,6 +169,18 @@
RelativePath="..\..\engines\kyra\kyra.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\kyra_v1.cpp">
</File>
<File
@@ -166,37 +193,37 @@
RelativePath="..\..\engines\kyra\kyra_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.cpp">
+ RelativePath="..\..\engines\kyra\resource.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.h">
+ RelativePath="..\..\engines\kyra\resource.h">
</File>
<File
- RelativePath="..\..\engines\kyra\resource.cpp">
+ RelativePath="..\..\engines\kyra\saveload.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\resource.h">
+ RelativePath="..\..\engines\kyra\saveload_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload.cpp">
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\saveload_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v2.cpp">
+ RelativePath="..\..\engines\kyra\scene.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp">
+ RelativePath="..\..\engines\kyra\scene_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v1.cpp">
+ RelativePath="..\..\engines\kyra\scene_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v2.cpp">
+ RelativePath="..\..\engines\kyra\scene_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v3.cpp">
+ RelativePath="..\..\engines\kyra\scene_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\screen.cpp">
@@ -205,6 +232,18 @@
RelativePath="..\..\engines\kyra\screen.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\screen_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\screen_v1.cpp">
</File>
<File
@@ -217,16 +256,16 @@
RelativePath="..\..\engines\kyra\screen_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.cpp">
+ RelativePath="..\..\engines\kyra\script.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.h">
+ RelativePath="..\..\engines\kyra\script.h">
</File>
<File
- RelativePath="..\..\engines\kyra\script.cpp">
+ RelativePath="..\..\engines\kyra\script_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\script.h">
+ RelativePath="..\..\engines\kyra\script_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\script_tim.cpp">
@@ -241,22 +280,22 @@
RelativePath="..\..\engines\kyra\script_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\script_v3.cpp">
- </File>
- <File
RelativePath="..\..\engines\kyra\seqplayer.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\seqplayer.h">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ RelativePath="..\..\engines\kyra\sequences_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v2.cpp">
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v3.cpp">
+ RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\sequences_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sound.cpp">
@@ -292,19 +331,19 @@
RelativePath="..\..\engines\kyra\text.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp">
+ RelativePath="..\..\engines\kyra\text_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.cpp">
+ RelativePath="..\..\engines\kyra\text_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.h">
+ RelativePath="..\..\engines\kyra\text_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.cpp">
+ RelativePath="..\..\engines\kyra\text_mr.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.h">
+ RelativePath="..\..\engines\kyra\text_v1.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\timer.cpp">
@@ -313,13 +352,13 @@
RelativePath="..\..\engines\kyra\timer.h">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp">
+ RelativePath="..\..\engines\kyra\timer_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v2.cpp">
+ RelativePath="..\..\engines\kyra\timer_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v3.cpp">
+ RelativePath="..\..\engines\kyra\timer_v1.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\vqa.cpp">
diff --git a/dists/msvc7/made.vcproj b/dists/msvc7/made.vcproj
index f765eb8a94..6f4caa8154 100644
--- a/dists/msvc7/made.vcproj
+++ b/dists/msvc7/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
@@ -154,10 +154,16 @@
RelativePath="..\..\engines\made\script.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h">
+ RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp">
</File>
<File
RelativePath="..\..\engines\made\sound.cpp">
diff --git a/dists/msvc71/drascula.vcproj b/dists/msvc71/drascula.vcproj
index ab6fc2d147..0d27422515 100644
--- a/dists/msvc71/drascula.vcproj
+++ b/dists/msvc71/drascula.vcproj
@@ -111,6 +111,9 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\animation.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp">
</File>
<File
@@ -120,7 +123,13 @@
RelativePath="..\..\engines\drascula\drascula.h">
</File>
<File
- RelativePath="..\..\engines\drascula\texts.h">
+ RelativePath="..\..\engines\drascula\rooms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\texts.cpp">
</File>
</Files>
<Globals>
diff --git a/dists/msvc71/gob.vcproj b/dists/msvc71/gob.vcproj
index 4eb147fba9..ac8960b28c 100644
--- a/dists/msvc71/gob.vcproj
+++ b/dists/msvc71/gob.vcproj
@@ -192,6 +192,9 @@
RelativePath="..\..\engines\gob\goblin_v3.cpp">
</File>
<File
+ RelativePath="..\..\engines\gob\goblin_v4.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\gob\init.cpp">
</File>
<File
diff --git a/dists/msvc71/kyra.vcproj b/dists/msvc71/kyra.vcproj
index 837f167ade..3992223f50 100644
--- a/dists/msvc71/kyra.vcproj
+++ b/dists/msvc71/kyra.vcproj
@@ -111,6 +111,12 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\kyra\animator_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\animator_mr.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\animator_v1.cpp">
</File>
<File
@@ -120,9 +126,6 @@
RelativePath="..\..\engines\kyra\animator_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v3.cpp">
- </File>
- <File
RelativePath="..\..\engines\kyra\debugger.cpp">
</File>
<File
@@ -138,6 +141,18 @@
RelativePath="..\..\engines\kyra\gui.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\gui_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\gui_v1.cpp">
</File>
<File
@@ -150,16 +165,16 @@
RelativePath="..\..\engines\kyra\gui_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v3.cpp">
+ RelativePath="..\..\engines\kyra\items_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp">
+ RelativePath="..\..\engines\kyra\items_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v2.cpp">
+ RelativePath="..\..\engines\kyra\items_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v3.cpp">
+ RelativePath="..\..\engines\kyra\items_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\kyra.cpp">
@@ -168,6 +183,18 @@
RelativePath="..\..\engines\kyra\kyra.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\kyra_v1.cpp">
</File>
<File
@@ -180,37 +207,37 @@
RelativePath="..\..\engines\kyra\kyra_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.cpp">
+ RelativePath="..\..\engines\kyra\resource.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.h">
+ RelativePath="..\..\engines\kyra\resource.h">
</File>
<File
- RelativePath="..\..\engines\kyra\resource.cpp">
+ RelativePath="..\..\engines\kyra\saveload.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\resource.h">
+ RelativePath="..\..\engines\kyra\saveload_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload.cpp">
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\saveload_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v2.cpp">
+ RelativePath="..\..\engines\kyra\scene.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp">
+ RelativePath="..\..\engines\kyra\scene_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v1.cpp">
+ RelativePath="..\..\engines\kyra\scene_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v2.cpp">
+ RelativePath="..\..\engines\kyra\scene_v1.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v3.cpp">
+ RelativePath="..\..\engines\kyra\scene_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\screen.cpp">
@@ -219,6 +246,18 @@
RelativePath="..\..\engines\kyra\screen.h">
</File>
<File
+ RelativePath="..\..\engines\kyra\screen_hof.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_hof.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.h">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\screen_v1.cpp">
</File>
<File
@@ -231,16 +270,16 @@
RelativePath="..\..\engines\kyra\screen_v2.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.cpp">
+ RelativePath="..\..\engines\kyra\script.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.h">
+ RelativePath="..\..\engines\kyra\script.h">
</File>
<File
- RelativePath="..\..\engines\kyra\script.cpp">
+ RelativePath="..\..\engines\kyra\script_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\script.h">
+ RelativePath="..\..\engines\kyra\script_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\script_tim.cpp">
@@ -255,22 +294,22 @@
RelativePath="..\..\engines\kyra\script_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\script_v3.cpp">
- </File>
- <File
RelativePath="..\..\engines\kyra\seqplayer.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\seqplayer.h">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ RelativePath="..\..\engines\kyra\sequences_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v2.cpp">
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v3.cpp">
+ RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\sequences_v2.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sound.cpp">
@@ -306,19 +345,19 @@
RelativePath="..\..\engines\kyra\text.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp">
+ RelativePath="..\..\engines\kyra\text_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.cpp">
+ RelativePath="..\..\engines\kyra\text_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.h">
+ RelativePath="..\..\engines\kyra\text_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.cpp">
+ RelativePath="..\..\engines\kyra\text_mr.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.h">
+ RelativePath="..\..\engines\kyra\text_v1.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\timer.cpp">
@@ -327,13 +366,13 @@
RelativePath="..\..\engines\kyra\timer.h">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp">
+ RelativePath="..\..\engines\kyra\timer_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v2.cpp">
+ RelativePath="..\..\engines\kyra\timer_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v3.cpp">
+ RelativePath="..\..\engines\kyra\timer_v1.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\vqa.cpp">
diff --git a/dists/msvc71/made.vcproj b/dists/msvc71/made.vcproj
index 158fb5e277..1ddc1ce245 100644
--- a/dists/msvc71/made.vcproj
+++ b/dists/msvc71/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
@@ -168,10 +168,16 @@
RelativePath="..\..\engines\made\script.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h">
+ RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp">
</File>
<File
RelativePath="..\..\engines\made\sound.cpp">
diff --git a/dists/msvc8/drascula.vcproj b/dists/msvc8/drascula.vcproj
index d7a9f90d02..7cf6065a4f 100644
--- a/dists/msvc8/drascula.vcproj
+++ b/dists/msvc8/drascula.vcproj
@@ -161,6 +161,10 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\animation.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp"
>
</File>
@@ -173,7 +177,15 @@
>
</File>
<File
- RelativePath="..\..\engines\drascula\texts.h"
+ RelativePath="..\..\engines\drascula\rooms.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\texts.cpp"
>
</File>
</Files>
diff --git a/dists/msvc8/gob.vcproj b/dists/msvc8/gob.vcproj
index b122f3b3c0..04858f540e 100644
--- a/dists/msvc8/gob.vcproj
+++ b/dists/msvc8/gob.vcproj
@@ -269,6 +269,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\gob\goblin_v4.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\gob\init.cpp"
>
</File>
diff --git a/dists/msvc8/kyra.vcproj b/dists/msvc8/kyra.vcproj
index 94e2724827..d173914b59 100644
--- a/dists/msvc8/kyra.vcproj
+++ b/dists/msvc8/kyra.vcproj
@@ -161,19 +161,23 @@
</References>
<Files>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ RelativePath="..\..\engines\kyra\animator_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h"
+ RelativePath="..\..\engines\kyra\animator_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v2.cpp"
+ RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\animator_v1.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v3.cpp"
+ RelativePath="..\..\engines\kyra\animator_v2.cpp"
>
</File>
<File
@@ -197,6 +201,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\gui_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\gui_v1.cpp"
>
</File>
@@ -213,19 +233,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v3.cpp"
+ RelativePath="..\..\engines\kyra\items_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp"
+ RelativePath="..\..\engines\kyra\items_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v2.cpp"
+ RelativePath="..\..\engines\kyra\items_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v3.cpp"
+ RelativePath="..\..\engines\kyra\items_v2.cpp"
>
</File>
<File
@@ -237,6 +257,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\kyra_v1.cpp"
>
</File>
@@ -253,23 +289,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.cpp"
+ RelativePath="..\..\engines\kyra\resource.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.h"
+ RelativePath="..\..\engines\kyra\resource.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\resource.cpp"
+ RelativePath="..\..\engines\kyra\saveload.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\resource.h"
+ RelativePath="..\..\engines\kyra\saveload_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload.cpp"
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp"
>
</File>
<File
@@ -277,23 +313,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v2.cpp"
+ RelativePath="..\..\engines\kyra\scene.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp"
+ RelativePath="..\..\engines\kyra\scene_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v1.cpp"
+ RelativePath="..\..\engines\kyra\scene_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v2.cpp"
+ RelativePath="..\..\engines\kyra\scene_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v3.cpp"
+ RelativePath="..\..\engines\kyra\scene_v2.cpp"
>
</File>
<File
@@ -305,6 +341,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\screen_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\screen_v1.cpp"
>
</File>
@@ -321,19 +373,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.cpp"
+ RelativePath="..\..\engines\kyra\script.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.h"
+ RelativePath="..\..\engines\kyra\script.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\script.cpp"
+ RelativePath="..\..\engines\kyra\script_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\script.h"
+ RelativePath="..\..\engines\kyra\script_mr.cpp"
>
</File>
<File
@@ -353,27 +405,27 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\script_v3.cpp"
+ RelativePath="..\..\engines\kyra\seqplayer.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\seqplayer.cpp"
+ RelativePath="..\..\engines\kyra\seqplayer.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\seqplayer.h"
+ RelativePath="..\..\engines\kyra\sequences_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp"
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v2.cpp"
+ RelativePath="..\..\engines\kyra\sequences_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v3.cpp"
+ RelativePath="..\..\engines\kyra\sequences_v2.cpp"
>
</File>
<File
@@ -421,23 +473,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp"
+ RelativePath="..\..\engines\kyra\text_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.cpp"
+ RelativePath="..\..\engines\kyra\text_hof.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.h"
+ RelativePath="..\..\engines\kyra\text_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.cpp"
+ RelativePath="..\..\engines\kyra\text_mr.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.h"
+ RelativePath="..\..\engines\kyra\text_v1.cpp"
>
</File>
<File
@@ -449,15 +501,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp"
+ RelativePath="..\..\engines\kyra\timer_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v2.cpp"
+ RelativePath="..\..\engines\kyra\timer_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v3.cpp"
+ RelativePath="..\..\engines\kyra\timer_v1.cpp"
>
</File>
<File
diff --git a/dists/msvc8/made.vcproj b/dists/msvc8/made.vcproj
index c2c226ff75..7f7ec6e454 100644
--- a/dists/msvc8/made.vcproj
+++ b/dists/msvc8/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
@@ -237,11 +237,19 @@
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h"
+ RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp"
>
</File>
<File
diff --git a/dists/msvc9/drascula.vcproj b/dists/msvc9/drascula.vcproj
index f5d37792b5..9eb8d5af9a 100644
--- a/dists/msvc9/drascula.vcproj
+++ b/dists/msvc9/drascula.vcproj
@@ -162,6 +162,10 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\animation.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp"
>
</File>
@@ -174,7 +178,15 @@
>
</File>
<File
- RelativePath="..\..\engines\drascula\texts.h"
+ RelativePath="..\..\engines\drascula\rooms.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\texts.cpp"
>
</File>
</Files>
diff --git a/dists/msvc9/gob.vcproj b/dists/msvc9/gob.vcproj
index a8ab1969bc..a409f5dd82 100644
--- a/dists/msvc9/gob.vcproj
+++ b/dists/msvc9/gob.vcproj
@@ -270,6 +270,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\gob\goblin_v4.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\gob\init.cpp"
>
</File>
diff --git a/dists/msvc9/kyra.vcproj b/dists/msvc9/kyra.vcproj
index 833ee4cc13..b004e9463e 100644
--- a/dists/msvc9/kyra.vcproj
+++ b/dists/msvc9/kyra.vcproj
@@ -162,19 +162,23 @@
</References>
<Files>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ RelativePath="..\..\engines\kyra\animator_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h"
+ RelativePath="..\..\engines\kyra\animator_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v2.cpp"
+ RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\animator_v1.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v3.cpp"
+ RelativePath="..\..\engines\kyra\animator_v2.cpp"
>
</File>
<File
@@ -198,6 +202,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\gui_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\gui_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\gui_v1.cpp"
>
</File>
@@ -214,19 +234,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v3.cpp"
+ RelativePath="..\..\engines\kyra\items_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp"
+ RelativePath="..\..\engines\kyra\items_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v2.cpp"
+ RelativePath="..\..\engines\kyra\items_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v3.cpp"
+ RelativePath="..\..\engines\kyra\items_v2.cpp"
>
</File>
<File
@@ -238,6 +258,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\kyra_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\kyra_v1.cpp"
>
</File>
@@ -254,23 +290,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.cpp"
+ RelativePath="..\..\engines\kyra\resource.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_v3.h"
+ RelativePath="..\..\engines\kyra\resource.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\resource.cpp"
+ RelativePath="..\..\engines\kyra\saveload.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\resource.h"
+ RelativePath="..\..\engines\kyra\saveload_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload.cpp"
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp"
>
</File>
<File
@@ -278,23 +314,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v2.cpp"
+ RelativePath="..\..\engines\kyra\scene.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp"
+ RelativePath="..\..\engines\kyra\scene_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v1.cpp"
+ RelativePath="..\..\engines\kyra\scene_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v2.cpp"
+ RelativePath="..\..\engines\kyra\scene_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_v3.cpp"
+ RelativePath="..\..\engines\kyra\scene_v2.cpp"
>
</File>
<File
@@ -306,6 +342,22 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\screen_hof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_hof.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\kyra\screen_mr.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\screen_v1.cpp"
>
</File>
@@ -322,19 +374,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.cpp"
+ RelativePath="..\..\engines\kyra\script.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v3.h"
+ RelativePath="..\..\engines\kyra\script.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\script.cpp"
+ RelativePath="..\..\engines\kyra\script_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\script.h"
+ RelativePath="..\..\engines\kyra\script_mr.cpp"
>
</File>
<File
@@ -354,27 +406,27 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\script_v3.cpp"
+ RelativePath="..\..\engines\kyra\seqplayer.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\seqplayer.cpp"
+ RelativePath="..\..\engines\kyra\seqplayer.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\seqplayer.h"
+ RelativePath="..\..\engines\kyra\sequences_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp"
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v2.cpp"
+ RelativePath="..\..\engines\kyra\sequences_v1.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v3.cpp"
+ RelativePath="..\..\engines\kyra\sequences_v2.cpp"
>
</File>
<File
@@ -422,23 +474,23 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp"
+ RelativePath="..\..\engines\kyra\text_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.cpp"
+ RelativePath="..\..\engines\kyra\text_hof.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v2.h"
+ RelativePath="..\..\engines\kyra\text_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.cpp"
+ RelativePath="..\..\engines\kyra\text_mr.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v3.h"
+ RelativePath="..\..\engines\kyra\text_v1.cpp"
>
</File>
<File
@@ -450,15 +502,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp"
+ RelativePath="..\..\engines\kyra\timer_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v2.cpp"
+ RelativePath="..\..\engines\kyra\timer_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v3.cpp"
+ RelativePath="..\..\engines\kyra\timer_v1.cpp"
>
</File>
<File
diff --git a/dists/msvc9/made.vcproj b/dists/msvc9/made.vcproj
index ebb3323bc2..17b619911f 100644
--- a/dists/msvc9/made.vcproj
+++ b/dists/msvc9/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
@@ -238,11 +238,19 @@
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h"
+ RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp"
>
</File>
<File
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 938177ce13..9240d562af 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -105,6 +105,7 @@ enum AgiGameID {
GID_SQ2,
GID_XMASCARD,
GID_FANMADE,
+ GID_GETOUTTASQ,
GID_MICKEY, // PreAGI
GID_WINNIE, // PreAGI
GID_TROLL // PreAGI
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 1a396d84fc..f526c51a27 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -1891,7 +1891,6 @@ static const AGIGameDescription gameDescriptions[] = {
FANMADE("Fu$k Quest 2 - Romancing the Bone (Teaser)", "d288355d71d9bb1639260ccaa3b2fbfe"),
FANMADE("Fu$k Quest 2 - Romancing the Bone", "294beeb7765c7ea6b05ed7b9bf7bff4f"),
FANMADE("Gennadi Tahab Autot - Mission Pack 1 - Kuressaare", "bfa5fe71978e6ccf3d4eedd430124015"),
- FANMADE("Get Outta Space Quest", "aaea5b4a348acb669d13b0e6f22d4dc9"),
FANMADE("Go West, Young Hippie", "ff31484ea465441cb5f3a0f8e956b716"),
FANMADE("Good Man (demo v3.41)", "3facd8a8f856b7b6e0f6c3200274d88c"),
@@ -1911,6 +1910,22 @@ static const AGIGameDescription gameDescriptions[] = {
0x2440,
},
+ {
+ // Get Outta SQ
+ {
+ "agi-fanmade",
+ "Get Outta Space Quest",
+ AD_ENTRY1("logdir", "aaea5b4a348acb669d13b0e6f22d4dc9"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_GETOUTTASQ,
+ GType_V2,
+ 0,
+ 0x2440,
+ },
+
FANMADE_F("Half-Death - Terror At White-Mesa", "b62c05d0ace878261392073f57ae788c", GF_AGIMOUSE),
FANMADE("Hank's Quest (v1.0 English) - Victim of Society", "64c15b3d0483d17888129100dc5af213"),
FANMADE("Hank's Quest (v1.1 English) - Victim of Society", "86d1f1dd9b0c4858d096e2a60cca8a14"),
@@ -2309,4 +2324,8 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const FSList *fsl
return 0;
}
-REGISTER_PLUGIN(AGI, PLUGIN_TYPE_ENGINE, AgiMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(AGI)
+ REGISTER_PLUGIN_DYNAMIC(AGI, PLUGIN_TYPE_ENGINE, AgiMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(AGI, PLUGIN_TYPE_ENGINE, AgiMetaEngine);
+#endif
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 6df7dd83ba..b8cf14d0ec 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -378,6 +378,10 @@ int AgiEngine::waitKey() {
key = doPollKeyboard();
if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
break;
+
+ _gfx->pollTimer();
+ updateTimer();
+
_gfx->doUpdate();
}
return key;
diff --git a/engines/agi/module.mk b/engines/agi/module.mk
index e5e8555ba2..22592dd71f 100644
--- a/engines/agi/module.mk
+++ b/engines/agi/module.mk
@@ -38,7 +38,7 @@ MODULE_OBJS = \
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_AGI), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 7897b57c30..7ecedfbc8c 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -74,6 +74,16 @@ cmd(decrement) {
cmd(assignn) {
_v[p0] = p1;
+
+ // WORKAROUND for a bug in fan game "Get outta SQ"
+ // Total number of points is stored in variable 7, which
+ // is then incorrectly assigned to 0. Thus, when the game
+ // is restarted, "Points 0 of 0" is shown. We set the
+ // variable to the correct value here
+ // Fixes bug #1942476 - "AGI: Fan(Get Outta SQ) - Score
+ // is lost on restart"
+ if (g_agi->getGameID() == GID_GETOUTTASQ && p0 == 7)
+ _v[p0] = 8;
}
cmd(addn) {
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 90f593f7c9..26d8916ab7 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -149,7 +149,11 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return res;
}
-REGISTER_PLUGIN(AGOS, PLUGIN_TYPE_ENGINE, AgosMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(AGOS)
+ REGISTER_PLUGIN_DYNAMIC(AGOS, PLUGIN_TYPE_ENGINE, AgosMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(AGOS, PLUGIN_TYPE_ENGINE, AgosMetaEngine);
+#endif
namespace AGOS {
diff --git a/engines/agos/module.mk b/engines/agos/module.mk
index d217dd7cfb..fe2dcba2f1 100644
--- a/engines/agos/module.mk
+++ b/engines/agos/module.mk
@@ -47,7 +47,7 @@ MODULE_OBJS := \
zones.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_AGOS), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 2b8af918af..8c940bcfd4 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -509,4 +509,8 @@ bool CineMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return gd != 0;
}
-REGISTER_PLUGIN(CINE, PLUGIN_TYPE_ENGINE, CineMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(CINE)
+ REGISTER_PLUGIN_DYNAMIC(CINE, PLUGIN_TYPE_ENGINE, CineMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(CINE, PLUGIN_TYPE_ENGINE, CineMetaEngine);
+#endif
diff --git a/engines/cine/module.mk b/engines/cine/module.mk
index 347af2dae1..131709e2ab 100644
--- a/engines/cine/module.mk
+++ b/engines/cine/module.mk
@@ -22,7 +22,7 @@ MODULE_OBJS = \
various.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_CINE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index d6108ab909..7d948acb36 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -144,4 +144,8 @@ bool CruiseMetaEngine::createInstance(OSystem *syst, Engine **engine, const Comm
return gd != 0;
}
-REGISTER_PLUGIN(CRUISE, PLUGIN_TYPE_ENGINE, CruiseMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(CRUISE)
+ REGISTER_PLUGIN_DYNAMIC(CRUISE, PLUGIN_TYPE_ENGINE, CruiseMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(CRUISE, PLUGIN_TYPE_ENGINE, CruiseMetaEngine);
+#endif
diff --git a/engines/cruise/module.mk b/engines/cruise/module.mk
index 2d5062dc38..384d7a1ecb 100644
--- a/engines/cruise/module.mk
+++ b/engines/cruise/module.mk
@@ -33,7 +33,7 @@ MODULE_OBJS := \
volume.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_CRUISE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
new file mode 100644
index 0000000000..8ae6a18b3a
--- /dev/null
+++ b/engines/drascula/animation.cpp
@@ -0,0 +1,3422 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
+static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
+
+void DrasculaEngine::animation_1_1() {
+ int l, l2, p;
+ int pos_pixel[6];
+
+ while (term_int == 0) {
+ playmusic(29);
+ fliplay("logoddm.bin", 9);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ delay(600);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ delay(340);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ playmusic(26);
+ delay(500);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ fliplay("logoalc.bin", 8);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ loadPic("cielo.alg");
+ decompressPic(dir_zona_pantalla, 256);
+ Negro();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(2);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ delay(900);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ color_abc(ROJO);
+ centra_texto("Transilvanya, 1993 d.c.", 160, 100);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ delay(1000);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ delay(1200);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ fliplay("scrollb.bin", 9);
+
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ comienza_sound("s5.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("scr2.bin", 17);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ fin_sound_corte();
+ anima("scr3.bin", 17);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ loadPic("cielo2.alg");
+ decompressPic(dir_zona_pantalla, 256);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ FundeAlNegro(1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("103.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("104.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("aux104.alg");
+ decompressPic(dir_dibujo2, 1);
+
+ playmusic(4);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ delay(400);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ for (l2 = 0; l2 < 3; l2++)
+ for (l = 0; l < 7; l++) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(interf_x[l], interf_y[l], 156, 45, 63, 31, dir_dibujo2, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (getscan() == Common::KEYCODE_ESCAPE) {
+ term_int = 1;
+ break;
+ }
+ pause(3);
+ }
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ l2 = 0; p = 0;
+ pos_pixel[3] = 45;
+ pos_pixel[4] = 63;
+ pos_pixel[5] = 31;
+
+ for (l = 0; l < 180; l++) {
+ copyBackground(0, 0, 320 - l, 0, l, 200, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(l, 0, 0, 0, 320 - l, 200, dir_dibujo1, dir_zona_pantalla);
+
+ pos_pixel[0] = interf_x[l2];
+ pos_pixel[1] = interf_y[l2];
+ pos_pixel[2] = 156 - l;
+
+ copyRectClip(pos_pixel, dir_dibujo2, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ p++;
+ if (p == 6) {
+ p = 0;
+ l2++;
+ }
+ if (l2 == 7)
+ l2 = 0;
+ if (getscan() == Common::KEYCODE_ESCAPE) {
+ term_int = 1;
+ break;
+ }
+ }
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
+
+ talk_dr_grande(_textd[_lang][1], "D1.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ clearRoom();
+
+ loadPic("100.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("auxigor.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("auxdr.alg");
+ decompressPic(dir_hare_fondo, 1);
+ sentido_dr = 0;
+ x_dr = 129;
+ y_dr = 95;
+ sentido_igor = 1;
+ x_igor = 66;
+ y_igor = 97;
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_igor_dch(_texti[_lang][8], "I8.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_dr_izq(_textd[_lang][2], "d2.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_dr_izq(_textd[_lang][3], "d3.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("lib.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("lib2.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ color_solo = ROJO;
+ loadPic("plan1.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(10);
+ talk_solo(_textd[_lang][4],"d4.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ loadPic("plan1.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_solo(_textd[_lang][5], "d5.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("lib2.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ loadPic("plan2.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(20);
+ talk_solo(_textd[_lang][6], "d6.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("lib2.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ loadPic("plan3.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(20);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_solo(_textd[_lang][7], "d7.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ loadPic("plan3.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_solo(_textd[_lang][8], "d8.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ loadPic("100.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ MusicFadeout();
+ stopmusic();
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_dch(_texti[_lang][9], "I9.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_dr_izq(_textd[_lang][9], "d9.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_dch(_texti[_lang][10], "I10.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ playmusic(11);
+ talk_dr_izq(_textd[_lang][10], "d10.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("rayo1.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ comienza_sound("s5.als");
+ anima("rayo2.bin", 15);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("frel2.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("frel.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("frel.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ fin_sound_corte();
+ clearRoom();
+ Negro();
+ playmusic(23);
+ FundeDelNegro(0);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_dr = 1;
+ talk_igor_dch(_texti[_lang][1], "I1.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_dr_dch(_textd[_lang][11], "d11.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_dr = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(1);
+ sentido_dr = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_dr_izq(_textd[_lang][12], "d12.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_dr = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(1);
+ sentido_dr = 1;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_igor_dch(_texti[_lang][2], "I2.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ pause(13);
+ talk_dr_dch(_textd[_lang][13],"d13.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_dr = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(1);
+ sentido_dr = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_dr_izq(_textd[_lang][14], "d14.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_dch(_texti[_lang][3], "I3.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_dr_izq(_textd[_lang][15], "d15.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_dch(_texti[_lang][4], "I4.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_dr_izq(_textd[_lang][16], "d16.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_dch(_texti[_lang][5], "I5.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_igor = 3;
+ talk_dr_izq(_textd[_lang][17], "d17.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ pause(18);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_igor_frente(_texti[_lang][6], "I6.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ FundeAlNegro(0);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+
+ playmusic(2);
+ pause(5);
+ fliplay("intro.bin", 12);
+ term_int = 1;
+ }
+ clearRoom();
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+}
+
+void DrasculaEngine::talk_dr_grande(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+ int x_talk[4] = {47, 93, 139, 185};
+ int cara;
+ int l = 0;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(ROJO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(3);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, dir_dibujo2, dir_zona_pantalla);
+ copyBackground(x_talk[cara], 1, 171, 68, 45, 48, dir_dibujo2, dir_zona_pantalla);
+ l++;
+ if (l == 7)
+ l = 0;
+
+ if (con_voces == 0)
+ centra_texto(dicho, 191, 69);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+}
+
+void DrasculaEngine::animation_2_1() {
+ int l;
+
+ lleva_al_hare(231, 91);
+ hare_se_ve = 0;
+
+ term_int = 0;
+
+ for (;;) {
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ anima("ag.bin", 14);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_dch, 1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ talk_tabernero(_textt[_lang][22], "T22.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ pause(4);
+ comienza_sound("s1.als");
+ hipo(18);
+ fin_sound();
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ clearRoom();
+ stopmusic();
+ corta_musica = 1;
+ memset(dir_zona_pantalla, 0, 64000);
+ color_solo = BLANCO;
+ pause(80);
+
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_solo(_textbj[_lang][1], "BJ1.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+ loadPic("bj.alg");
+ decompressPic(dir_zona_pantalla, MEDIA);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ Negro();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ color_solo = AMARILLO;
+ talk_solo(_text[_lang][214], "214.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ clearRoom();
+
+ loadPic("16.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ loadPic("auxbj.alg");
+ decompressPic(dir_dibujo3, 1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ strcpy(num_room, "16.alg");
+
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ for (l = 0; l < 200; l++)
+ factor_red[l] = 99;
+ x_bj = 170;
+ y_bj = 90;
+ sentido_bj = 0;
+ hare_x = 91;
+ hare_y = 95;
+ sentido_hare = 1;
+ hare_se_ve = 1;
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ loadPic("97g.alg");
+ decompressPic(dir_hare_dch, 1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ anima("lev.bin", 15);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+
+ lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_hare = 1;
+ hare_x = 100;
+ hare_y = 95;
+
+ talk_bj(_textbj[_lang][2], "BJ2.als");
+ talk(_text[_lang][215], "215.als");
+ talk_bj(_textbj[_lang][3], "BJ3.als");
+ talk(_text[_lang][216], "216.als");
+ talk_bj(_textbj[_lang][4], "BJ4.als");
+ talk_bj(_textbj[_lang][5], "BJ5.als");
+ talk_bj(_textbj[_lang][6], "BJ6.als");
+ talk(_text[_lang][217], "217.als");
+ talk_bj(_textbj[_lang][7], "BJ7.als");
+ talk(_text[_lang][218], "218.als");
+ talk_bj(_textbj[_lang][8], "BJ8.als");
+ talk(_text[_lang][219], "219.als");
+ talk_bj(_textbj[_lang][9], "BJ9.als");
+ talk(_text[_lang][220], "220.als");
+ talk(_text[_lang][221], "221.als");
+ talk_bj(_textbj[_lang][10], "BJ10.als");
+ talk(_text[_lang][222], "222.als");
+ anima("gaf.bin", 15);
+ anima("bjb.bin", 14);
+ playmusic(9);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ loadPic("97.alg");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ decompressPic(dir_hare_dch, 1);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ pause(120);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_solo(_text[_lang][223], "223.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ color_solo = BLANCO;
+ updateRoom();
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(110);
+ talk_solo(_textbj[_lang][11], "BJ11.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ updateRoom();
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ pause(118);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ lleva_al_hare(132, 97 + alto_hare);
+ pause(60);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk(_text[_lang][224], "224.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_bj(_textbj[_lang][12], "BJ12.als");
+ lleva_al_hare(157, 98 + alto_hare);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ anima("bes.bin", 16);
+ playmusic(11);
+ anima("rap.bin", 16);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_hare = 3;
+ strcpy(num_room, "no_bj.alg");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ pause(8);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][225], "225.als");
+ pause(76);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ sentido_hare = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][226], "226.als");
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(30);
+ if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk(_text[_lang][227],"227.als");
+ FundeAlNegro(0);
+ break;
+ }
+}
+
+void DrasculaEngine::animation_3_1() {
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][192], "192.als");
+ talk_tabernero(_textt[_lang][1], "t1.als");
+ talk(_text[_lang][193], "193.als");
+ talk_tabernero(_textt[_lang][2], "t2.als");
+ talk(_text[_lang][194], "194.als");
+ talk_tabernero(_textt[_lang][3], "t3.als");
+ talk(_text[_lang][195], "195.als");
+ talk_tabernero(_textt[_lang][4], "t4.als");
+ talk(_text[_lang][196], "196.als");
+ talk_tabernero(_textt[_lang][5], "t5.als");
+ talk_tabernero(_textt[_lang][6], "t6.als");
+ talk(_text[_lang][197], "197.als");
+ talk_tabernero(_textt[_lang][7], "t7.als");
+ talk(_text[_lang][198], "198.als");
+ talk_tabernero(_textt[_lang][8], "t8.als");
+ talk(_text[_lang][199], "199.als");
+ talk_tabernero(_textt[_lang][9], "t9.als");
+ talk(_text[_lang][200], "200.als");
+ talk(_text[_lang][201], "201.als");
+ talk(_text[_lang][202], "202.als");
+
+ flags[0] = 1;
+
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_4_1() {
+ loadPic("an12.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][205],"205.als");
+
+ updateRefresh_pre();
+
+ copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(228,112, 228,112, 47,60, dir_zona_pantalla);
+
+ pause(3);
+
+ updateRefresh_pre();
+
+ copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ pon_hare();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+ stopmusic();
+ flags[11] = 1;
+
+ talk_pianista(_textp[_lang][1], "p1.als");
+ talk(_text[_lang][206], "206.als");
+ talk_pianista(_textp[_lang][2], "p2.als");
+ talk(_text[_lang][207], "207.als");
+ talk_pianista(_textp[_lang][3], "p3.als");
+ talk(_text[_lang][208], "208.als");
+ talk_pianista(_textp[_lang][4], "p4.als");
+ talk(_text[_lang][209], "209.als");
+
+ flags[11] = 0;
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_1_2() {
+ lleva_al_hare(178, 121);
+ lleva_al_hare(169, 135);
+}
+
+void DrasculaEngine::animation_2_2() {
+ int n, x=0;
+
+ sentido_hare = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("an2_1.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("an2_2.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(1, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(201,87, 201,87, 50,52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 55, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++){
+ x++;
+ copyBackground(x, 109, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ x = 0;
+ comienza_sound("s2.als");
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(201,87, 201,87, 50,52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 55, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+ x = 0;
+
+ for (n = 0; n < 2; n++) {
+ x++;
+ copyBackground(x, 109, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ fin_sound();
+
+ pause (4);
+
+ comienza_sound("s1.als");
+ hipo_sin_nadie(12);
+ fin_sound();
+}
+
+void DrasculaEngine::animation_3_2() {
+ lleva_al_hare(163, 106);
+ lleva_al_hare(287, 101);
+ sentido_hare = 0;
+}
+
+void DrasculaEngine::animation_4_2() {
+ stopmusic();
+ flags[9] = 1;
+
+ pause(12);
+ talk(_textd[_lang][56], "d56.als");
+ pause(8);
+
+ clearRoom();
+ loadPic("ciego1.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("ciego2.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("ciego3.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("ciego4.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("ciego5.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(10);
+
+ talk_ciego(_textd[_lang][68], "d68.als", "44472225500022227555544444664447222550002222755554444466");
+ pause(5);
+ talk_hacker(_textd[_lang][57], "d57.als");
+ pause(6);
+ talk_ciego(_textd[_lang][69],"d69.als","444722255000222275555444446655033336666664464402256555005504450005446");
+ pause(4);
+ talk_hacker(_textd[_lang][58],"d58.als");
+ talk_ciego(_textd[_lang][70],"d70.als", "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046");
+ delay(14);
+ talk_hacker(_textd[_lang][59],"d59.als");
+ talk_ciego(_textd[_lang][71],"d71.als", "550330227556444744446660004446655544444722255000222275555444446644444");
+ talk_hacker(_textd[_lang][60],"d60.als");
+ talk_ciego(_textd[_lang][72],"d72.als", "55033022755644455550444744400044504447222550002222755554444466000");
+ talk_hacker(_textd[_lang][61],"d61.als");
+ talk_ciego(_textd[_lang][73],"d73.als", "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446");
+ talk_hacker(_textd[_lang][62],"d62.als");
+ talk_ciego(_textd[_lang][74],"d74.als", "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666");
+ talk_hacker(_textd[_lang][63],"d63.als");
+ talk_ciego(_textd[_lang][75],"d75.als", "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555");
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ _system->delayMillis(1);
+ talk_hacker(_textd[_lang][64], "d64.als");
+ talk_ciego(_textd[_lang][76], "d76.als", "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444");
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(14);
+
+ clearRoom();
+
+ playmusic(musica_room);
+ loadPic("9.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("aux9.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ sin_verbo();
+
+ flags[9] = 0;
+ flags[4] = 1;
+}
+
+void DrasculaEngine::animation_8_2() {
+ talk_pianista(_textp[_lang][6], "P6.als");
+ talk(_text[_lang][358], "358.als");
+ talk_pianista(_textp[_lang][7], "P7.als");
+ talk_pianista(_textp[_lang][8], "P8.als");
+}
+
+void DrasculaEngine::animation_9_2() {
+ talk_pianista(_textp[_lang][9], "P9.als");
+ talk_pianista(_textp[_lang][10], "P10.als");
+ talk_pianista(_textp[_lang][11], "P11.als");
+}
+
+void DrasculaEngine::animation_10_2() {
+ talk_pianista(_textp[_lang][12], "P12.als");
+ talk(_text[_lang][361], "361.als");
+ pause(40);
+ talk_pianista(_textp[_lang][13], "P13.als");
+ talk(_text[_lang][362], "362.als");
+ talk_pianista(_textp[_lang][14], "P14.als");
+ talk(_text[_lang][363], "363.als");
+ talk_pianista(_textp[_lang][15], "P15.als");
+ talk(_text[_lang][364], "364.als");
+ talk_pianista(_textp[_lang][16], "P16.als");
+}
+
+void DrasculaEngine::animation_14_2() {
+ int n, pos_cabina[6];
+ int l = 0;
+
+ loadPic("an14_2.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an14_1.alg");
+
+ pos_cabina[0] = 150;
+ pos_cabina[1] = 6;
+ pos_cabina[2] = 69;
+ pos_cabina[3] = -160;
+ pos_cabina[4] = 158;
+ pos_cabina[5] = 161;
+
+ for (n = -160; n <= 0; n = n + 5 + l) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ pon_hare();
+ pon_vb();
+ pos_cabina[3] = n;
+ copyRectClip(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ l = l + 1;
+ }
+
+ flags[24] = 1;
+
+ decompressPic(dir_dibujo1, 1);
+
+ comienza_sound("s7.als");
+ hipo(15);
+
+ fin_sound();
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+}
+
+void DrasculaEngine::animation_15_2() {
+ talk_borracho(_textb[_lang][8], "B8.als");
+ pause(7);
+ talk_borracho(_textb[_lang][9], "B9.als");
+ talk_borracho(_textb[_lang][10], "B10.als");
+ talk_borracho(_textb[_lang][11], "B11.als");
+}
+
+void DrasculaEngine::animation_16_2() {
+ int l;
+
+ talk_borracho(_textb[_lang][12], "B12.als");
+ talk(_text[_lang][371], "371.als");
+
+ clearRoom();
+
+ playmusic(32);
+ int key = getscan();
+ if (key != 0)
+ goto asco;
+
+ color_abc(VERDE_OSCURO);
+
+ loadPic("his1.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ centra_texto(_texthis[_lang][1], 180, 180);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ _system->delayMillis(4);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ FundeAlNegro(1);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ clearRoom();
+ loadPic("his2.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ centra_texto(_texthis[_lang][2], 180, 180);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ _system->delayMillis(4);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ FundeAlNegro(1);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ clearRoom();
+ loadPic("his3.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ centra_texto(_texthis[_lang][3], 180, 180);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ _system->delayMillis(4);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ FundeAlNegro(1);
+
+ clearRoom();
+ loadPic("his4_1.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("his4_2.alg");
+ decompressPic(dir_dibujo3, 1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo3, dir_zona_pantalla);
+ centra_texto(_texthis[_lang][1], 180, 180);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ _system->delayMillis(4);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+
+ for (l = 1; l < 200; l++) {
+ copyBackground(0, 0, 0, l, 320, 200 - l, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(0, 200 - l, 0, 0, 320, l, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ key = getscan();
+ if (key != 0)
+ goto asco;
+ }
+
+ pause(5);
+ FundeAlNegro(2);
+ clearRoom();
+
+asco:
+ loadPic(roomDisk);
+ decompressPic(dir_dibujo3, 1);
+ loadPic(num_room);
+ decompressPic(dir_dibujo1, MEDIA);
+ Negro();
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(0);
+ if (musica_room != 0)
+ playmusic(musica_room);
+ else
+ stopmusic();
+}
+
+void DrasculaEngine::animation_17_2() {
+ talk_borracho(_textb[_lang][13], "B13.als");
+ talk_borracho(_textb[_lang][14], "B14.als");
+ flags[40] = 1;
+}
+
+void DrasculaEngine::animation_19_2() {
+ talk_vbpuerta(_textvb[_lang][5], "VB5.als");
+}
+
+void DrasculaEngine::animation_20_2() {
+ talk_vbpuerta(_textvb[_lang][7], "VB7.als");
+ talk_vbpuerta(_textvb[_lang][8], "VB8.als");
+ talk(_text[_lang][383], "383.als");
+ talk_vbpuerta(_textvb[_lang][9], "VB9.als");
+ talk(_text[_lang][384], "384.als");
+ talk_vbpuerta(_textvb[_lang][10], "VB10.als");
+ talk(_text[_lang][385], "385.als");
+ talk_vbpuerta(_textvb[_lang][11], "VB11.als");
+ if (flags[23] == 0) {
+ talk(_text[_lang][350], "350.als");
+ talk_vbpuerta(_textvb[_lang][57], "VB57.als");
+ } else {
+ talk(_text[_lang][386], "386.als");
+ talk_vbpuerta(_textvb[_lang][12], "VB12.als");
+ flags[18] = 0;
+ flags[14] = 1;
+ abre_puerta(15, 1);
+ sal_de_la_habitacion(1);
+ animation_23_2();
+ sal_de_la_habitacion(0);
+ flags[21] = 0;
+ flags[24] = 0;
+ sentido_vb = 1;
+ vb_x = 120;
+
+ rompo_y_salgo = 1;
+ }
+}
+
+void DrasculaEngine::animation_21_2() {
+ talk_vbpuerta(_textvb[_lang][6], "VB6.als");
+}
+
+void DrasculaEngine::animation_23_2() {
+ loadPic("an24.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ flags[21] = 1;
+
+ if (flags[25] == 0) {
+ talk_vb(_textvb[_lang][13], "VB13.als");
+ talk_vb(_textvb[_lang][14], "VB14.als");
+ pause(10);
+ talk(_text[_lang][387], "387.als");
+ }
+
+ talk_vb(_textvb[_lang][15], "VB15.als");
+ lleva_vb(42);
+ sentido_vb = 1;
+ talk_vb(_textvb[_lang][16], "VB16.als");
+ sentido_vb = 2;
+ lleva_al_hare(157, 147);
+ lleva_al_hare(131, 149);
+ sentido_hare = 0;
+ animation_14_2();
+ if (flags[25] == 0)
+ talk_vb(_textvb[_lang][17], "VB17.als");
+ pause(8);
+ sentido_vb = 1;
+ talk_vb(_textvb[_lang][18], "VB18.als");
+
+ if (flags[29] == 0)
+ animation_23_anexo();
+ else
+ animation_23_anexo2();
+
+ sentido_vb = 2;
+ animation_25_2();
+ lleva_vb(99);
+
+ if (flags[29] == 0) {
+ talk_vb(_textvb[_lang][19], "VB19.als");
+ if (flags[25] == 0) {
+ talk_vb(_textvb[_lang][20],"VB20.als");
+ if (resta_objeto(7) == 0)
+ flags[30] = 1;
+ if (resta_objeto(18) == 0)
+ flags[31] = 1;
+ if (resta_objeto(19) == 0)
+ flags[32] = 1;
+ }
+ talk_vb(_textvb[_lang][21], "VB21.als");
+ } else
+ animation_27_2();
+
+ flags[25] = 1;
+ rompo_y_salgo = 1;
+}
+
+void DrasculaEngine::animation_23_anexo() {
+ int n, p_x = hare_x + 2, p_y = hare_y - 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");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 34; n++) {
+ copyRect(p_x, p_y, p_x, p_y, 36, 74, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x[n], y[n], p_x, p_y, 36, 74, dir_hare_fondo, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(p_x, p_y, p_x, p_y, 36, 74, dir_zona_pantalla);
+ pause(5);
+ }
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+}
+
+void DrasculaEngine::animation_23_anexo2() {
+ int n, p_x = hare_x + 4, p_y = hare_y;
+ 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");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 14; n++) {
+ copyRect(p_x, p_y, p_x, p_y, 33, 71, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x[n], y[n], p_x, p_y, 33, 71, dir_hare_fondo, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(p_x,p_y, p_x,p_y, 33,71, dir_zona_pantalla);
+ pause(5);
+ }
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo,1);
+}
+
+void DrasculaEngine::animation_25_2() {
+ int n, pos_cabina[6];
+
+ loadPic("an14_2.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("18.alg");
+ decompressPic(dir_dibujo1, 1);
+
+ pos_cabina[0] = 150;
+ pos_cabina[1] = 6;
+ pos_cabina[2] = 69;
+ pos_cabina[3] = 0;
+ pos_cabina[4] = 158;
+ pos_cabina[5] = 161;
+
+ flags[24] = 0;
+
+ comienza_sound("s6.als");
+
+ for (n = 0; n >= -160; n = n - 8) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+ pon_hare();
+ pon_vb();
+
+ pos_cabina[3] = n;
+
+ copyRectClip(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
+
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+
+ fin_sound();
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+}
+
+void DrasculaEngine::animation_27_2() {
+ flags[22] = 1;
+
+ sin_verbo();
+ resta_objeto(23);
+ suma_objeto(11);
+
+ talk_vb(_textvb[_lang][23], "VB23.als");
+ talk_vb(_textvb[_lang][24], "VB24.als");
+ if (flags[30] == 1)
+ suma_objeto(7);
+ if (flags[31] == 1)
+ suma_objeto(18);
+ if (flags[32] == 1)
+ suma_objeto(19);
+ talk_vb(_textvb[_lang][25],"VB25.als");
+ talk_vb(_textvb[_lang][26],"VB26.als");
+}
+
+void DrasculaEngine::animation_28_2() {
+ talk_vb(_textvb[_lang][27], "VB27.als");
+ talk_vb(_textvb[_lang][28], "VB28.als");
+ talk_vb(_textvb[_lang][29], "VB29.als");
+ talk_vb(_textvb[_lang][30], "VB30.als");
+}
+
+void DrasculaEngine::animation_29_2() {
+ if (flags[33] == 0) {
+ talk_vb(_textvb[_lang][32], "VB32.als");
+ talk(_text[_lang][398], "398.als");
+ talk_vb(_textvb[_lang][33], "VB33.als");
+ talk(_text[_lang][399], "399.als");
+ talk_vb(_textvb[_lang][34], "VB34.als");
+ talk_vb(_textvb[_lang][35], "VB35.als");
+ talk(_text[_lang][400], "400.als");
+ talk_vb(_textvb[_lang][36], "VB36.als");
+ talk_vb(_textvb[_lang][37], "VB37.als");
+ talk(_text[_lang][386], "386.als");
+ talk_vb(_textvb[_lang][38], "VB38.als");
+ talk_vb(_textvb[_lang][39], "VB39.als");
+ talk(_text[_lang][401], "401.als");
+ talk_vb(_textvb[_lang][40], "VB40.als");
+ talk_vb(_textvb[_lang][41], "VB41.als");
+ flags[33] = 1;
+ } else
+ talk_vb(_textvb[_lang][43], "VB43.als");
+
+ talk(_text[_lang][402], "402.als");
+ talk_vb(_textvb[_lang][42], "VB42.als");
+
+ if (flags[38] == 0) {
+ talk(_text[_lang][403], "403.als");
+ rompo_y_salgo = 1;
+ } else
+ talk(_text[_lang][386], "386.als");
+}
+
+void DrasculaEngine::animation_30_2() {
+ talk_vb(_textvb[_lang][31], "VB31.als");
+ talk(_text[_lang][396], "396.als");
+}
+
+void DrasculaEngine::animation_31_2() {
+ talk_vb(_textvb[_lang][44], "VB44.als");
+ lleva_vb(-50);
+ pause(15);
+ lleva_al_hare(159, 140);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ sentido_hare = 2;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(78);
+ sentido_hare = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(22);
+ talk(_text[_lang][406], "406.als");
+ lleva_vb(98);
+ talk_vb(_textvb[_lang][45], "VB45.als");
+ talk_vb(_textvb[_lang][46], "VB46.als");
+ talk_vb(_textvb[_lang][47], "VB47.als");
+ talk(_text[_lang][407], "407.als");
+ talk_vb(_textvb[_lang][48], "VB48.als");
+ talk_vb(_textvb[_lang][49], "VB49.als");
+ talk(_text[_lang][408], "408.als");
+ talk_vb(_textvb[_lang][50], "VB50.als");
+ talk_vb(_textvb[_lang][51], "VB51.als");
+ talk(_text[_lang][409], "409.als");
+ talk_vb(_textvb[_lang][52], "VB52.als");
+ talk_vb(_textvb[_lang][53], "VB53.als");
+ pause(12);
+ talk_vb(_textvb[_lang][54], "VB54.als");
+ talk_vb(_textvb[_lang][55], "VB55.als");
+ talk(_text[_lang][410], "410.als");
+ talk_vb(_textvb[_lang][56], "VB56.als");
+
+ rompo_y_salgo = 1;
+
+ flags[38] = 0;
+ flags[36] = 1;
+ sin_verbo();
+ resta_objeto(8);
+ resta_objeto(13);
+ resta_objeto(15);
+ resta_objeto(16);
+ resta_objeto(17);
+ suma_objeto(20);
+}
+
+void DrasculaEngine::animation_35_2() {
+ int n, x = 0;
+
+ lleva_al_hare(96, 165);
+ lleva_al_hare(79, 165);
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ loadPic("an35_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an35_2.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(70,90, 70,90, 46,80,dir_zona_pantalla);
+ x = x + 46;
+ pause(3);
+ }
+
+ x = 0;
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 82, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
+ x = x + 46;
+ pause(3);
+ }
+
+ x = 0;
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
+
+ x = x + 46;
+
+ pause(3);
+ }
+
+ x = 0;
+ for (n = 0; n < 2; n++) {
+ x++;
+ copyBackground(x, 82, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(70, 90, 70,90, 46, 80,dir_zona_pantalla);
+ x = x + 46;
+ pause(3);
+ }
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(19);
+
+ comienza_sound("s1.als");
+ hipo_sin_nadie(18);
+ fin_sound();
+
+ pause(10);
+
+ FundeAlNegro(2);
+}
+
+void DrasculaEngine::animation_1_3() {
+ talk(_text[_lang][413], "413.als");
+ grr();
+ pause(50);
+ talk(_text[_lang][414], "414.als");
+}
+
+void DrasculaEngine::animation_2_3() {
+ flags[0] = 1;
+ playmusic(13);
+ animation_3_3();
+ playmusic(13);
+ animation_4_3();
+ flags[1] = 1;
+ updateRoom();
+ updateScreen(120, 0, 120, 0, 200, 200, dir_zona_pantalla);
+ animation_5_3();
+ flags[0] = 0;
+ flags[1] = 1;
+
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ lleva_al_hare(332, 127);
+}
+
+void DrasculaEngine::animation_3_3() {
+ int n, x = 0;
+ int px = hare_x - 20, py = hare_y - 1;
+
+ loadPic("an2y_1.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("an2y_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an2y_3.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+}
+
+void DrasculaEngine::animation_4_3() {
+ int n, x = 0;
+ int px = 120, py = 63;
+
+ loadPic("any_1.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("any_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("any_3.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 4; n++){
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 91, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 91, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 91, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
+ x = x + 77;
+ pause(3);
+ }
+}
+
+void DrasculaEngine::animation_5_3() {
+ int n, x = 0;
+ int px = hare_x - 20, py = hare_y - 1;
+
+ loadPic("an3y_1.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("an3y_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an3y_3.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(px,py, px,py, 71,72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
+ x = x + 71;
+ pause(3);
+ }
+}
+
+void DrasculaEngine::animation_6_3() {
+ int frame = 0, px = 112, py = 62;
+ int yoda_x[] = { 3 ,82, 161, 240, 3, 82 };
+ int yoda_y[] = { 3, 3, 3, 3, 94, 94 };
+
+ hare_se_mueve = 0;
+ flags[3] = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ flags[1] = 0;
+
+ loadPic("an4y.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ for (frame = 0; frame < 6; frame++) {
+ pause(3);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyRect(yoda_x[frame], yoda_y[frame], px, py, 78, 90, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(px, py, px, py, 78, 90, dir_zona_pantalla);
+ }
+
+ flags[2] = 1;
+
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::animation_rayo() {
+ loadPic("anr_1.alg");
+ decompressPic(dir_hare_frente, MEDIA);
+ loadPic("anr_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("anr_3.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("anr_4.alg");
+ decompressPic(dir_dibujo1, 1);
+ loadPic("anr_5.alg");
+ decompressPic(dir_dibujo3, 1);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_hare_frente);
+
+ pause(50);
+
+ comienza_sound("s5.als");
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_hare_dch);
+ pause(3);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_hare_fondo);
+ pause(3);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+ pause(3);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_hare_fondo);
+ pause(3);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo3);
+ pause(3);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_hare_frente);
+ fin_sound();
+}
+
+void DrasculaEngine::animation_2_4() {
+ talk_igor_sentado(_texti[_lang][16], "I16.als");
+ talk(_text[_lang][278], "278.als");
+ talk_igor_sentado(_texti[_lang][17], "I17.als");
+ talk(_text[_lang][279], "279.als");
+ talk_igor_sentado(_texti[_lang][18], "I18.als");
+}
+
+void DrasculaEngine::animation_3_4() {
+ talk_igor_sentado(_texti[_lang][19], "I19.als");
+ talk_igor_sentado(_texti[_lang][20], "I20.als");
+ talk(_text[_lang][281], "281.als");
+}
+
+void DrasculaEngine::animation_4_4() {
+ talk(_text[_lang][287], "287.als");
+ talk_igor_sentado(_texti[_lang][21], "I21.als");
+ talk(_text[_lang][284], "284.als");
+ talk_igor_sentado(_texti[_lang][22], "I22.als");
+ talk(_text[_lang][285], "285.als");
+ talk_igor_sentado(_texti[_lang][23], "I23.als");
+}
+
+void DrasculaEngine::animation_7_4() {
+ Negro();
+ talk(_text[_lang][427], "427.als");
+ FundeDelNegro(1);
+ resta_objeto(8);
+ resta_objeto(10);
+ resta_objeto(12);
+ resta_objeto(16);
+ suma_objeto(17);
+ flags[30] = 0;
+ flags[29] = 0;
+}
+
+void DrasculaEngine::animation_1_5() {
+ if (flags[0] == 0) {
+ talk(_text[_lang][430], "430.als");
+ talk_bj(_textbj[_lang][16], "BJ16.als");
+ talk_bj(_textbj[_lang][17], "BJ17.als");
+ talk_bj(_textbj[_lang][18], "BJ18.als");
+ talk(_text[_lang][217], "217.als");
+ talk_bj(_textbj[_lang][19], "BJ19.als");
+ talk(_text[_lang][229], "229.als");
+ pause(5);
+ lleva_al_hare(114, 170);
+ sentido_hare = 3;
+ talk(_text[_lang][431], "431.als");
+ talk_bj(_textbj[_lang][20], "BJ20.als");
+ sentido_hare = 2;
+ pause(4);
+ talk(_text[_lang][438], "438.als");
+ sitio_x = 120;
+ sitio_y = 157;
+ anda_a_objeto = 1;
+ sentido_final = 1;
+ empieza_andar();
+ talk_bj(_textbj[_lang][21], "BJ21.als");
+
+ for (;;) {
+ if (hare_se_mueve == 0)
+ break;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+
+ sentido_hare = 1;
+ talk(_text[_lang][229], "229.als");
+ flags[0] = 1;
+ }
+
+ sentido_hare = 1;
+ conversa("op_8.cal");
+}
+
+void DrasculaEngine::animation_2_5() {
+ talk_bj(_textbj[_lang][22], "BJ22.als");
+}
+
+void DrasculaEngine::animation_3_5() {
+ talk_bj(_textbj[_lang][23], "BJ23.als");
+ agarra_objeto(10);
+ rompo_y_salgo = 1;
+}
+
+void DrasculaEngine::animation_4_5() {
+ flags[7] = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][228], "228.als");
+ talk_lobo(_textl[_lang][1], "L1.als");
+ talk_lobo(_textl[_lang][2], "L2.als");
+ pause(23);
+ talk(_text[_lang][229], "229.als");
+ talk_lobo(_textl[_lang][3], "L3.als");
+ talk_lobo(_textl[_lang][4], "L4.als");
+ talk(_text[_lang][230], "230.als");
+ talk_lobo(_textl[_lang][5], "L5.als");
+ talk(_text[_lang][231], "231.als");
+ talk_lobo(_textl[_lang][6], "L6.als");
+ talk_lobo(_textl[_lang][7], "L7.als");
+ pause(33);
+ talk(_text[_lang][232], "232.als");
+ talk_lobo(_textl[_lang][8], "L8.als");
+}
+
+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 pixel_x = hare_x - 53, pixel_y = hare_y - 9;
+
+ sin_verbo();
+ resta_objeto(8);
+
+ lleva_al_hare(hare_x - 19, hare_y + alto_hare);
+ sentido_hare = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ loadPic("3an5_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("3an5_2.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ for (frame = 0; frame < 9; frame++) {
+ pause(3);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyRect(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(pixel_x, pixel_y, pixel_x,pixel_y, 97,64, dir_zona_pantalla);
+ }
+
+ copyBackground(52, 161, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(198, 81, 198, 81, 26, 24, dir_zona_pantalla);
+
+ for (frame = 0; frame < 9; frame++) {
+ pause(3);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyRect(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(pixel_x, pixel_y, pixel_x,pixel_y, 97, 64, dir_zona_pantalla);
+ }
+
+ flags[6] = 1;
+ actualiza_datos();
+ pause(12);
+
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ for (h = 0; h < (200 - 18); h++)
+ copyBackground(0, 53, 0, h, 320, 19, dir_hare_frente, dir_zona_pantalla);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ loadPic("101.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("3an5_3.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("3an5_4.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+ pause(9);
+ for (frame = 0; frame < 5; frame++) {
+ pause(3);
+ copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
+ }
+ for (frame = 0; frame < 5; frame++) {
+ pause(3);
+ copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
+ }
+ updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+
+ comienza_sound("s1.als");
+ fin_sound();
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ clearRoom();
+
+ loadPic("49.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+}
+
+void DrasculaEngine::animation_6_5() {
+ talk_lobo(_textl[_lang][9], "L9.als");
+ talk(_text[_lang][234], "234.als");
+}
+
+void DrasculaEngine::animation_7_5() {
+ talk_lobo(_textl[_lang][10], "L10.als");
+ talk(_text[_lang][236], "236.als");
+ talk_lobo(_textl[_lang][11], "L11.als");
+ talk_lobo(_textl[_lang][12], "L12.als");
+ talk_lobo(_textl[_lang][13], "L13.als");
+ pause(34);
+ talk_lobo(_textl[_lang][14], "L14.als");
+}
+
+void DrasculaEngine::animation_8_5() {
+ talk_lobo(_textl[_lang][15], "L15.als");
+ talk(_text[_lang][238], "238.als");
+ talk_lobo(_textl[_lang][16], "L16.als");
+}
+
+void DrasculaEngine::animation_9_5() {
+ flags[4] = 1;
+ talk(_text[_lang][401], "401.als");
+ sin_verbo();
+ resta_objeto(15);
+}
+
+void DrasculaEngine::animation_10_5() {
+ flags[3] = 1;
+ talk(_text[_lang][401], "401.als");
+ sin_verbo();
+ resta_objeto(12);
+}
+
+void DrasculaEngine::animation_11_5() {
+ flags[9] = 1;
+ if (flags[2] == 1 && flags[3] == 1 && flags[4] == 1)
+ animation_12_5();
+ else {
+ flags[9] = 0;
+ talk(_text[_lang][33], "33.als");
+ }
+}
+
+void DrasculaEngine::animation_12_5() {
+ DacPalette256 palFondo1;
+ DacPalette256 palFondo2;
+ DacPalette256 palFondo3;
+
+ int frame;
+ const int rayo_x[] = {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, componente;
+ char fundido;
+
+ playmusic(26);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(27);
+ anima("rayo1.bin", 23);
+ comienza_sound("s5.als");
+ anima("rayo2.bin", 17);
+ sentido_hare = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ hare_oscuro();
+
+ for (color = 0; color < 255; color++)
+ for (componente = 0; componente < 3; componente++) {
+ palFondo1[color][componente] = palJuego[color][componente];
+ palFondo2[color][componente] = palJuego[color][componente];
+ palFondo3[color][componente] = palJuego[color][componente];
+ }
+
+ for (fundido = 1; fundido >= 0; fundido--) {
+ for (color = 0; color < 128; color++)
+ for (componente = 0; componente < 3; componente++)
+ palFondo1[color][componente] = LimitaVGA(palFondo1[color][componente] - 8 + fundido);
+ }
+
+ for (fundido = 2; fundido >= 0; fundido--) {
+ for (color = 0; color < 128; color++)
+ for (componente = 0; componente < 3; componente++)
+ palFondo2[color][componente] = LimitaVGA(palFondo2[color][componente] - 8 + fundido);
+ }
+
+ for (fundido = 3; fundido >= 0; fundido--) {
+ for (color = 0; color < 128; color++)
+ for (componente = 0; componente < 3; componente++)
+ palFondo3[color][componente] = LimitaVGA(palFondo3[color][componente] - 8 + fundido);
+ }
+
+ loadPic("3an11_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (frame = 0; frame < 8; frame++) {
+ if (frame == 2 || frame == 4 || frame == 8 || frame==10)
+ setvgapalette256((byte *)&palFondo1);
+ else if (frame == 1 || frame == 5 || frame == 7 || frame == 9)
+ setvgapalette256((byte *)&palFondo2);
+ else
+ setvgapalette256((byte *)&palFondo3);
+
+ pause(4);
+ updateRoom();
+ copyRect(rayo_x[frame], 1, 41, 0, 44, 44, dir_hare_fondo, dir_zona_pantalla);
+ copyRect(frusky_x[frame], 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+
+ fin_sound_corte();
+
+ for (frame = 0; frame < 15; frame++) {
+ if (frame == 2 || frame == 4 || frame == 7 || frame == 9)
+ setvgapalette256((byte *)&palFondo1);
+ else if (frame == 1 || frame == 5)
+ setvgapalette256((byte *)&palJuego);
+ else
+ setvgapalette256((byte *)&palFondo2);
+
+ pause(4);
+ updateRoom();
+ copyRect(elfrusky_x[frame], 47, 192, 39, 66, 106, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+
+ anima("frel.bin", 16);
+ clearRoom();
+ hare_claro();
+ ActualizaPaleta();
+
+ flags[1] = 1;
+
+ animation_13_5();
+ comienza_sound("s1.als");
+ hipo(12);
+ fin_sound();
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ lleva_al_hare(40, 169);
+ lleva_al_hare(-14, 175);
+
+ rompo = 1;
+ musica_antes = musica_room;
+ hare_se_ve = 1;
+ clearRoom();
+ sentido_hare = 1;
+ hare_se_mueve = 0;
+ hare_x = -1;
+ obj_saliendo = 104;
+ sin_verbo();
+ carga_escoba("57.ald");
+}
+
+void DrasculaEngine::animation_13_5() {
+ int frank_x = 199;
+ int frame = 0;
+ int frus_x[] = {1, 46, 91, 136, 181, 226, 271};
+ int frus_y[] = {1, 1, 1, 1, 1, 1, 1, 89};
+ int pos_frusky[6];
+
+ loadPic("auxfr.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ pos_frusky[3] = 81;
+ pos_frusky[4] = 44;
+ pos_frusky[5] = 87;
+ pos_frusky[0] = 1;
+ pos_frusky[1] = 1;
+ pos_frusky[2] = frank_x;
+ updateRoom();
+ copyRectClip(pos_frusky, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(15);
+
+ playmusic(18);
+
+ for (;;) {
+ updateRoom();
+ pos_frusky[0] = frus_x[frame];
+ pos_frusky[1] = frus_y[frame];
+ pos_frusky[2] = frank_x;
+ copyRectClip( pos_frusky, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ frank_x = frank_x - 5;
+ frame++;
+ if (frank_x <= -45)
+ break;
+ if (frame == 7) {
+ frame = 0;
+ sentido_hare = 3;
+ }
+ pause(6);
+ }
+}
+
+void DrasculaEngine::animation_14_5() {
+ flags[11] = 1;
+ comienza_sound("s3.als");
+ updateRoom();
+ updateScreen(0, 0, 0,0 , 320, 200, dir_zona_pantalla);
+ fin_sound();
+ pause(17);
+ sentido_hare = 3;
+ talk(_text[_lang][246],"246.als");
+ lleva_al_hare(89, 160);
+ flags[10] = 1;
+ comienza_sound("s7.als");
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ fin_sound();
+ pause(14);
+ sentido_hare = 3;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_solo(_textd[_lang][18], "d18.als");
+ FundeAlNegro(1);
+}
+
+void DrasculaEngine::animation_15_5() {
+ talk_mus(_texte[_lang][4], "E4.als");
+ talk_mus(_texte[_lang][5], "E5.als");
+ talk_mus(_texte[_lang][6], "E6.als");
+ talk(_text[_lang][291], "291.als");
+ talk_mus(_texte[_lang][7], "E7.als");
+}
+
+void DrasculaEngine::animation_16_5() {
+ talk_mus(_texte[_lang][8], "E8.als");
+}
+
+void DrasculaEngine::animation_17_5() {
+ talk_mus(_texte[_lang][9], "E9.als");
+}
+
+void DrasculaEngine::animation_1_6() {
+ int l;
+
+ sentido_hare = 0;
+ hare_x = 103;
+ hare_y = 108;
+ flags[0] = 1;
+ for (l = 0; l < 200; l++)
+ factor_red[l] = 98;
+
+ loadPic("auxig2.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("auxdr.alg");
+ decompressPic(dir_dibujo2, 1);
+ loadPic("car.alg");
+ decompressPic(dir_hare_fondo, 1);
+ talk_dr_dch(_textd[_lang][19], "D19.als");
+ talk(_text[_lang][247], "247.als");
+ talk_dr_dch(_textd[_lang][20], "d20.als");
+ talk_dr_dch(_textd[_lang][21], "d21.als");
+ talk(_text[_lang][248], "248.als");
+ talk_dr_dch(_textd[_lang][22], "d22.als");
+ talk(_text[_lang][249], "249.als");
+ talk_dr_dch(_textd[_lang][23], "d23.als");
+ conversa("op_11.cal");
+ talk_dr_dch(_textd[_lang][26], "d26.als");
+
+ anima("fum.bin", 15);
+
+ talk_dr_dch(_textd[_lang][27], "d27.als");
+ talk(_text[_lang][254], "254.als");
+ talk_dr_dch(_textd[_lang][28], "d28.als");
+ talk(_text[_lang][255], "255.als");
+ talk_dr_dch(_textd[_lang][29], "d29.als");
+ FundeAlNegro(1);
+ clearRoom();
+ loadPic("time1.alg");
+ decompressPic(dir_zona_pantalla, 1);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ delay(930);
+ clearRoom();
+ Negro();
+ hare_se_ve = 0;
+ flags[0] = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(1);
+ talk(_text[_lang][256], "256.als");
+ talk_dr_dch(_textd[_lang][30], "d30.als");
+ talk(_text[_lang][257], "257.als");
+ FundeAlNegro(0);
+ clearRoom();
+ loadPic("time1.alg");
+ decompressPic(dir_zona_pantalla,1);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ delay(900);
+ clearRoom();
+ Negro();
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(1);
+ talk(_text[_lang][258], "258.als");
+ talk_dr_dch(_textd[_lang][31], "d31.als");
+ animation_5_6();
+ talk_dr_dch(_textd[_lang][32], "d32.als");
+ talk_igor_dch(_texti[_lang][11], "I11.als");
+ sentido_igor = 3;
+ talk_dr_dch(_textd[_lang][33], "d33.als");
+ talk_igor_frente(_texti[_lang][12], "I12.als");
+ talk_dr_dch(_textd[_lang][34], "d34.als");
+ sentido_dr = 0;
+ talk_dr_izq(_textd[_lang][35], "d35.als");
+ clearRoom();
+ carga_escoba("102.ald");
+ activa_pendulo();
+}
+
+void DrasculaEngine::animation_2_6() {
+ talk_dr_dch(_textd[_lang][24], "d24.als");
+}
+
+void DrasculaEngine::animation_3_6() {
+ talk_dr_dch(_textd[_lang][24], "d24.als");
+}
+
+void DrasculaEngine::animation_4_6() {
+ talk_dr_dch(_textd[_lang][25], "d25.als");
+}
+
+void DrasculaEngine::animation_5_6() {
+ int n, pos_pen[6];
+
+ pos_pen[0] = 1;
+ pos_pen[1] = 29;
+ pos_pen[2] = 204;
+ pos_pen[3] = -125;
+ pos_pen[4] = 18;
+ pos_pen[5] = 125;
+
+ anima("man.bin", 14);
+
+ for (n = -125; n <= 0; n = n + 2) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ pos_pen[3] = n;
+ copyRectClip(pos_pen, dir_dibujo3, dir_zona_pantalla);
+
+ updateRefresh();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(2);
+ }
+
+ flags[3] = 1;
+}
+
+void DrasculaEngine::animation_6_6() {
+ anima("rct.bin", 11);
+ clearRoom();
+ sin_verbo();
+ resta_objeto(20);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ rompo = 1;
+ obj_saliendo = 104;
+ hare_x = -1;
+ sin_verbo();
+ carga_escoba("58.ald");
+ hare_se_ve = 1;
+ sentido_hare = 1;
+ anima("hbp.bin", 14);
+
+ sentido_hare = 3;
+ flags[0] = 1;
+ flags[1] = 0;
+ flags[2] = 1;
+}
+
+void DrasculaEngine::animation_7_6() {
+ flags[8] = 1;
+ actualiza_datos();
+}
+
+void DrasculaEngine::animation_9_6() {
+ int v_cd;
+
+ anima("fin.bin", 14);
+ playmusic(13);
+ flags[5] = 1;
+ anima("drf.bin", 16);
+ FundeAlNegro(0);
+ clearRoom();
+ hare_x = -1;
+ obj_saliendo = 108;
+ carga_escoba("59.ald");
+ strcpy(num_room, "nada.alg");
+ loadPic("nota2.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ Negro();
+ sentido_hare = 1;
+ hare_x -= 21;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ FundeDelNegro(0);
+ pause(96);
+ lleva_al_hare(116, 178);
+ sentido_hare = 2;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ playmusic(9);
+ clearRoom();
+ loadPic("nota.alg");
+ decompressPic(dir_dibujo1, COMPLETA);
+ color_abc(BLANCO);
+ talk_solo(_textbj[_lang][24], "bj24.als");
+ talk_solo(_textbj[_lang][25], "bj25.als");
+ talk_solo(_textbj[_lang][26], "bj26.als");
+ talk_solo(_textbj[_lang][27], "bj27.als");
+ talk_solo(_textbj[_lang][28], "bj28.als");
+ sentido_hare = 3;
+ clearRoom();
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("nota2.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ talk(_text[_lang][296], "296.als");
+ talk(_text[_lang][297], "297.als");
+ talk(_text[_lang][298], "298.als");
+ sentido_hare = 1;
+ talk(_text[_lang][299], "299.als");
+ talk(_text[_lang][300], "300.als");
+ updateRoom();
+ copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(VERDE_CLARO);
+ talk_solo("GOOOOOOOOOOOOOOOL", "s15.als");
+ loadPic("nota2.alg");
+ decompressPic(dir_dibujo1, 1);
+ sentido_hare = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][301], "301.als");
+ v_cd = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
+ v_cd = v_cd + 4;
+ playmusic(17);
+ FundeAlNegro(1);
+ clearRoom();
+ fliplay("qpc.bin", 1);
+ MusicFadeout();
+ stopmusic();
+ clearRoom();
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
+ playmusic(3);
+ fliplay("crd.bin", 1);
+ stopmusic();
+}
+
+void DrasculaEngine::animation_10_6() {
+ comienza_sound ("s14.als");
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyBackground(164, 85, 155, 48, 113, 114, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ fin_sound();
+ talk_taber2(_textt[_lang][23], "t23.als");
+ flags[7] = 1;
+}
+
+void DrasculaEngine::animation_11_6() {
+ talk_taber2(_textt[_lang][10], "t10.als");
+ talk(_text[_lang][268], "268.als");
+ talk_taber2(_textt[_lang][11], "t11.als");
+}
+
+void DrasculaEngine::animation_12_6() {
+ talk_taber2(_textt[_lang][12], "t12.als");
+ talk(_text[_lang][270], "270.als");
+ talk_taber2(_textt[_lang][13], "t13.als");
+ talk_taber2(_textt[_lang][14], "t14.als");
+}
+
+void DrasculaEngine::animation_13_6() {
+ talk_taber2(_textt[_lang][15], "t15.als");
+}
+
+void DrasculaEngine::animation_14_6() {
+ talk_taber2(_textt[_lang][24], "t24.als");
+ suma_objeto(21);
+ flags[10] = 1;
+ rompo_y_salgo = 1;
+}
+
+void DrasculaEngine::animation_15_6() {
+ talk_taber2(_textt[_lang][16], "t16.als");
+}
+
+void DrasculaEngine::animation_18_6() {
+ flags[6] = 1;
+ sin_verbo();
+ resta_objeto(21);
+ anima("beb.bin", 10);
+}
+
+void DrasculaEngine::animation_19_6() {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(140, 23, 161, 69, 35, 80, dir_dibujo3, dir_zona_pantalla);
+
+ updateRefresh_pre();
+ pon_hare();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(6);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ comienza_sound("s4.als");
+ pause(6);
+ fin_sound();
+}
+
+void DrasculaEngine::animation_12_2() {
+ loadPic("an12.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][356], "356.als");
+
+ updateRefresh_pre();
+
+ copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
+
+ pause(3);
+
+ updateRefresh_pre();
+
+ copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ pon_hare();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+ stopmusic();
+ flags[11] = 1;
+
+ talk_pianista(_textp[_lang][5], "P5.als");
+ conversa("op_1.cal");
+
+ flags[11] = 0;
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_26_2() {
+ int n, x = 0;
+
+ loadPic("an12.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][392], "392.als");
+
+ updateRefresh_pre();
+
+ copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
+
+ pause(3);
+
+ updateRefresh_pre();
+
+ copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ pon_hare();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+ stopmusic();
+ flags[11] = 1;
+
+ talk_pianista(_textp[_lang][5], "P5.als");
+ talk(_text[_lang][393], "393.als");
+ talk_pianista(_textp[_lang][17], "P17.als");
+ talk_pianista(_textp[_lang][18], "P18.als");
+ talk_pianista(_textp[_lang][19], "P19.als");
+
+ loadPic("an26.alg");
+ decompressPic(dir_hare_dch, 1);
+ for (n = 0; n < 6; n++){
+ x++;
+ copyBackground(x, 1, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(225,113, 225,113, 50,59, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ x = 0;
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 61, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
+ x = x + 50;
+ if (n == 2)
+ comienza_sound("s9.als");
+ pause(3);
+ }
+
+ fin_sound_corte();
+ x = 0;
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 121, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
+ x = x + 50;
+ pause(3);
+ }
+
+ agarra_objeto(11);
+ resta_objeto(12);
+
+ flags[11] = 0;
+ flags[39] = 1;
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+ musica_room = 16;
+}
+
+void DrasculaEngine::animation_11_2() {
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][352], "352.als");
+ talk_tabernero(_textt[_lang][1], "T1.als");
+ talk(_text[_lang][353], "353.als");
+ talk_tabernero(_textt[_lang][17], "T17.als");
+ talk(_text[_lang][354], "354.als");
+ talk_tabernero(_textt[_lang][18], "T18.als");
+ talk(_text[_lang][355], "355.als");
+ pause(40);
+ talk_tabernero("No, nada", "d82.als");
+
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_13_2() {
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ if (flags[41] == 0) {
+ talk(_text[_lang][103], "103.als");
+ talk_borracho(_textb[_lang][4], "B4.als");
+ flags[12] = 1;
+ talk(_text[_lang][367], "367.als");
+ talk_borracho(_textb[_lang][5], "B5.als");
+ flags[12] = 1;
+ talk(_text[_lang][368], "368.als");
+ talk_borracho(_textb[_lang][6], "B6.als");
+ talk_borracho(_textb[_lang][7], "B7.als");
+ flags[41] = 1;
+ }
+ conversa("op_2.cal");
+
+ loadPic("964.alg");
+ decompressPic(dir_hare_frente, 1);
+}
+
+void DrasculaEngine::animation_18_2() {
+ talk(_text[_lang][378], "378.als");
+ talk_vbpuerta(_textvb[_lang][4], "VB4.als");
+ conversa("op_3.cal");
+}
+
+void DrasculaEngine::animation_22_2() {
+ talk(_text[_lang][374],"374.als");
+
+ sentido_hare=2;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ comienza_sound("s13.als");
+ fin_sound();
+ sentido_hare = 1;
+
+ talk_vbpuerta(_textvb[_lang][1], "VB1.als");
+ talk(_text[_lang][375], "375.als");
+ talk_vbpuerta(_textvb[_lang][2], "VB2.als");
+ talk(_text[_lang][376], "376.als");
+ talk_vbpuerta(_textvb[_lang][3], "VB3.als");
+
+ flags[18] = 1;
+}
+
+void DrasculaEngine::animation_24_2() {
+ if (hare_x < 178)
+ lleva_al_hare(208, 136);
+ sentido_hare = 3;
+ updateRoom();
+ pause(3);
+ sentido_hare = 0;
+
+ talk(_text[_lang][356], "356.als");
+
+ loadPic("an24.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ animation_32_2();
+
+ flags[21] = 1;
+
+ talk_vb(_textvb[_lang][22], "VB22.als");
+
+ if (flags[22] == 0)
+ conversa("op_4.cal");
+ else
+ conversa("op_5.cal");
+
+ sal_de_la_habitacion(0);
+ flags[21] = 0;
+ flags[24] = 0;
+ sentido_vb = 1;
+ vb_x = 120;
+}
+
+void DrasculaEngine::animation_32_2() {
+ int n, x = 0;
+
+ loadPic("an32_1.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("an32_2.alg");
+ decompressPic(dir_hare_fondo, 1);
+
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(x, 1, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
+ x = x + 65;
+ pause(4);
+ }
+
+ x = 0;
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(x, 83, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
+ x = x + 65;
+ pause(4);
+ }
+
+ x = 0;
+ for (n = 0; n < 4; n++) {
+ x++;
+ copyBackground(x, 1, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
+ x = x + 65;
+ pause(4);
+ }
+
+ x = 0;
+ for (n = 0; n < 3; n++) {
+ x++;
+ copyBackground(x, 83, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
+ x = x + 65;
+ if (n < 2)
+ pause(4);
+ }
+
+ loadPic("aux18.alg");
+ decompressPic(dir_dibujo3, 1);
+}
+
+void DrasculaEngine::animation_34_2() {
+ int n, x = 0;
+
+ sentido_hare = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ loadPic("an34_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an34_2.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ for (n = 0; n < 3; n++) {
+ x++;
+ copyBackground(x, 1, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
+ x = x + 83;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 3; n++) {
+ x++;
+ copyBackground(x, 77, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
+ x = x + 83;
+ pause(3);
+ }
+
+ x = 0;
+ comienza_sound("s8.als");
+
+ for (n = 0; n < 3; n++) {
+ x++;
+ copyBackground(x, 1, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(218, 79, 218, 79, 83,75, dir_zona_pantalla);
+ x = x + 83;
+ pause(3);
+ }
+ fin_sound();
+
+ pause(30);
+
+ copyBackground(1, 77, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
+ pause(3);
+
+ loadPic("994.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_36_2() {
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ talk(_text[_lang][404], "404.als");
+ talk_tabernero(_textt[_lang][19], "T19.als");
+ talk_tabernero(_textt[_lang][20], "T20.als");
+ talk_tabernero(_textt[_lang][21], "T21.als");
+ talk(_text[_lang][355], "355.als");
+ pause(40);
+ talk_tabernero("No, nada", "d82.als");
+
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+}
+
+void DrasculaEngine::animation_7_2() {
+ int n, x = 0;
+
+ loadPic("an7_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an7_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an7_3.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ if (flags[3] == 1)
+ copyBackground(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_dibujo1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+ loadPic("an7_4.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an7_5.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an7_6.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("an7_7.alg");
+ decompressPic(dir_dibujo3, 1);
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51,73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 2; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+ loadPic("an7_8.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an7_9.alg");
+ decompressPic(dir_hare_dch, 1);
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ x = x + 51;
+ pause(3);
+ }
+
+
+ copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
+ copyRect(1, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+
+ flags[37] = 1;
+
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("aux3.alg");
+ decompressPic(dir_dibujo3, 1);
+}
+
+void DrasculaEngine::animation_5_2() {
+ int n, x = 0;
+
+ sentido_hare = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ loadPic("an5_1.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("an5_2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an5_3.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("an5_4.alg");
+ decompressPic(dir_dibujo3, 1);
+
+ copyBackground(1, 1, 213, 66, 53,84, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84,dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 86, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 86, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ comienza_sound("s1.als");
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 86, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+ fin_sound_corte();
+
+ x = 0;
+
+ for (n = 0; n < 6; n++) {
+ x++;
+ copyBackground(x, 1, 213, 66, 53, 84, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
+ x = x + 52;
+ pause(3);
+ }
+
+ loadPic("994.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("974.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("964.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("aux5.alg");
+ decompressPic(dir_dibujo3, 1);
+ flags[8] = 1;
+ hare_x = hare_x - 4;
+ talk_sinc(_text[_lang][46], "46.als", "4442444244244");
+ sin_verbo();
+}
+
+void DrasculaEngine::animation_6_2() {
+ stopmusic();
+ flags[9] = 1;
+
+ clearRoom();
+ loadPic("ciego1.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("ciego2.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("ciego3.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("ciego4.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("ciego5.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(1);
+
+ if (flags[4] == 1)
+ talk_hacker(_textd[_lang][66], "d66.als");
+ pause(6);
+ talk_ciego(_textd[_lang][78], "d78.als",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777");
+ pause(4);
+ talk_hacker(_textd[_lang][67], "d67.als");
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(10);
+
+ clearRoom();
+
+ playmusic(musica_room);
+ loadPic("9.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("aux9.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ sin_verbo();
+
+ flags[9] = 0;
+}
+
+void DrasculaEngine::animation_33_2() {
+ stopmusic();
+ flags[9] = 1;
+
+ pause(12);
+ talk(_textd[_lang][56], "d56.als" );
+ pause(8);
+
+ clearRoom();
+ loadPic("ciego1.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("ciego2.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("ciego3.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("ciego4.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("ciego5.alg");
+ decompressPic(dir_hare_frente, 1);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(10);
+
+ talk_ciego(_textd[_lang][68], "d68.als", "44472225500022227555544444472225500022227555544444664466");
+ pause(5);
+ talk_hacker(_textd[_lang][57], "d57.als");
+ pause(6);
+ _system->delayMillis(1000);
+ talk_ciego(_textd[_lang][77], "d77.als", "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444");
+ talk_hacker(_textd[_lang][65], "d65.als");
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(14);
+
+ clearRoom();
+
+ playmusic(musica_room);
+ loadPic("9.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("aux9.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ sin_verbo();
+
+ flags[33] = 1;
+ flags[9] = 0;
+}
+
+void DrasculaEngine::animation_1_4() {
+ if (flags[21] == 0) {
+ strcpy(nombre_obj[2], "igor");
+ talk(_text[_lang][275], "275.als");
+
+ updateRefresh_pre();
+
+ copyBackground(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
+
+ pause(3);
+
+ updateRefresh_pre();
+
+ copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+ flags[18] = 1;
+ flags[20] = 1;
+
+ talk_igor_sentado(_texti[_lang][13], "I13.als");
+ talk_igor_sentado(_texti[_lang][14], "I14.als");
+ talk_igor_sentado(_texti[_lang][15], "I15.als");
+ flags[21] = 1;
+ } else {
+ talk(_text[_lang][356], "356.als");
+
+ updateRefresh_pre();
+
+ copyBackground(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
+ pause(2);
+
+ updateRefresh_pre();
+
+ copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ flags[18] = 1;
+ flags[20] = 1;
+
+ talk(_text[_lang][276], "276.als");
+ pause(14);
+ talk_igor_sentado(_texti[_lang][6], "I6.als");
+ }
+
+ conversa("op_6.cal");
+ flags[20] = 0;
+ flags[18] = 0;
+}
+
+void DrasculaEngine::animation_5_4(){
+ sentido_hare = 3;
+ loadPic("anh_dr.alg");
+ decompressPic(dir_hare_fondo, 1);
+ lleva_al_hare(99, 160);
+ lleva_al_hare(38, 177);
+ hare_se_ve = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ delay(800);
+ anima("bio.bin", 14);
+ flags[29] = 1;
+ hare_x = 95;
+ hare_y = 82;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ abre_puerta(2, 0);
+ loadPic("auxigor.alg");
+ decompressPic(dir_hare_frente, 1);
+ x_igor = 100;
+ y_igor = 65;
+ talk_igor_frente(_texti[_lang][29], "I29.ALS");
+ talk_igor_frente(_texti[_lang][30], "I30.als");
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ hare_se_ve = 1;
+ FundeAlNegro(0);
+ sal_de_la_habitacion(0);
+}
+
+void DrasculaEngine::animation_6_4() {
+ char room[13];
+
+ strcpy(room, num_room);
+ strcpy(num_room, "26.alg");
+ clearRoom();
+ loadPic("26.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("aux26.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("auxigor.alg");
+ decompressPic(dir_hare_frente, 1);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ update_26_pre();
+ x_igor = 104;
+ y_igor = 71;
+ pon_igor();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(40);
+ talk_igor_frente(_texti[_lang][26], "I26.als");
+ strcpy(num_room, room);
+ clearRoom();
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic(roomDisk);
+ decompressPic(dir_dibujo3, 1);
+ loadPic(num_room);
+ decompressPic(dir_dibujo1, MEDIA);
+ sin_verbo();
+ updateRoom();
+}
+
+void DrasculaEngine::animation_8_4() {
+ int frame;
+ 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");
+ decompressPic(dir_hare_frente, 1);
+
+ for (frame = 0; frame < 14; frame++) {
+ pause(2);
+ copyBackground(estanteria_x[frame], estanteria_y[frame], 77, 45, 73, 72, dir_hare_frente, dir_zona_pantalla);
+ updateScreen(77, 45, 77, 45, 73, 72, dir_zona_pantalla);
+ }
+
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ abre_puerta(7, 2);
+}
+
+void DrasculaEngine::animation_9_4() {
+ anima("st.bin", 14);
+ FundeAlNegro(1);
+}
+
+
+} // End of namespace Drascula
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 2c057ad03a..80ea4f0eab 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -185,4 +185,8 @@ const Common::ADGameDescription *DrasculaMetaEngine::fallbackDetect(const FSList
return (const Common::ADGameDescription *)&Drascula::g_fallbackDesc;
}
-REGISTER_PLUGIN(DRASCULA, PLUGIN_TYPE_ENGINE, DrasculaMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(DRASCULA)
+ REGISTER_PLUGIN_DYNAMIC(DRASCULA, PLUGIN_TYPE_ENGINE, DrasculaMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(DRASCULA, PLUGIN_TYPE_ENGINE, DrasculaMetaEngine);
+#endif
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 4be084d557..89bb6e530d 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -35,7 +35,6 @@
#include "sound/mixer.h"
#include "drascula/drascula.h"
-#include "drascula/texts.h"
namespace Drascula {
@@ -72,6 +71,8 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
_system->openCD(cd_num);
+
+ _lang = 0;
}
DrasculaEngine::~DrasculaEngine() {
@@ -105,12 +106,6 @@ static const int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120,
static const int y1d_menu[] = {0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25,
50, 50, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 100};
static int frame_x[20] = {43, 87, 130, 173, 216, 259};
-static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
-static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
-static const char mirar_t[3][88] = {TEXT100, TEXT101, TEXT54};
-static const char mirar_v[3][14] = {"100.als", "101.als", "54.als"};
-static const char poder_t[6][88] = {TEXT11, TEXT109, TEXT111, TEXT110, TEXT115, TEXT116};
-static const char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"};
int DrasculaEngine::init() {
// Initialize backend
@@ -139,7 +134,7 @@ int DrasculaEngine::go() {
anda_a_objeto = 0;
paso_x = PASO_HARE_X; paso_y = PASO_HARE_Y;
alto_hare = ALTO_PERSONAJE; ancho_hare = ANCHO_PERSONAJE; alto_pies = PIES_HARE;
- alto_habla = ALTO_HABLA_HARE; ancho_habla = ANCHO_HABLA_HARE;
+ alto_talk = ALTO_TALK_HARE; ancho_talk = ANCHO_TALK_HARE;
hay_respuesta = 0;
conta_ciego_vez = 0;
cambio_de_color = 0;
@@ -170,50 +165,50 @@ int DrasculaEngine::go() {
hay_seleccion = 0;
if (num_ejec != 6) {
- lee_dibujos("95.alg");
- descomprime_dibujo(dir_mesa, 1);
+ loadPic("95.alg");
+ decompressPic(dir_mesa, 1);
}
if (num_ejec == 1) {
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
} else if (num_ejec == 2) {
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("pts.alg");
- descomprime_dibujo(dir_dibujo2, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("pts.alg");
+ decompressPic(dir_dibujo2, 1);
} else if (num_ejec == 3) {
- lee_dibujos("aux13.alg");
- descomprime_dibujo(dir_dibujo1, COMPLETA);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("aux13.alg");
+ decompressPic(dir_dibujo1, COMPLETA);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
} else if (num_ejec == 4) {
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
if (hay_que_load == 0)
- animacion_rayo();
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- borra_pantalla();
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
+ animation_rayo();
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ clearRoom();
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
} else if (num_ejec == 5) {
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
} else if (num_ejec == 6) {
x_igor = 105, y_igor = 85, sentido_igor = 1;
x_dr = 62, y_dr = 99, sentido_dr = 1;
@@ -222,15 +217,15 @@ int DrasculaEngine::go() {
dir_pendulo = dir_dibujo3;
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
- lee_dibujos("95.alg");
- descomprime_dibujo(dir_mesa, 1);
+ loadPic("95.alg");
+ decompressPic(dir_mesa, 1);
}
memset(nombre_icono, 0, sizeof(nombre_icono));
strcpy(nombre_icono[1], "look");
@@ -258,7 +253,7 @@ int DrasculaEngine::go() {
void DrasculaEngine::salir_al_dos(int r) {
if (hay_sb == 1)
ctvd_end();
- borra_pantalla();
+ clearRoom();
Negro();
MusicFadeout();
stopmusic();
@@ -296,7 +291,7 @@ void DrasculaEngine::libera_memoria() {
free(dir_hare_frente);
}
-void DrasculaEngine::lee_dibujos(const char *NamePcc) {
+void DrasculaEngine::loadPic(const char *NamePcc) {
unsigned int con, x = 0;
unsigned int fExit = 0;
byte ch, rep;
@@ -329,7 +324,7 @@ void DrasculaEngine::lee_dibujos(const char *NamePcc) {
file.close();
}
-void DrasculaEngine::descomprime_dibujo(byte *dir_escritura, int plt) {
+void DrasculaEngine::decompressPic(byte *dir_escritura, int plt) {
memcpy(dir_escritura, Buffer_pcx, 64000);
free(Buffer_pcx);
asigna_rgb((byte *)cPal, plt);
@@ -402,7 +397,7 @@ void DrasculaEngine::setvgapalette256(byte *PalBuf) {
_system->updateScreen();
}
-void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho,
+void DrasculaEngine::copyBackground(int xorg, int yorg, int xdes, int ydes, int Ancho,
int Alto, byte *Origen, byte *Destino) {
int x;
Destino += xdes + ydes * 320;
@@ -414,7 +409,7 @@ void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int An
}
}
-void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho,
+void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int Ancho,
int Alto, byte *Origen, byte *Destino) {
int y, x;
@@ -427,7 +422,7 @@ void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int A
Destino[x + y * 320] = Origen[x + y * 320];
}
-void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino) {
+void DrasculaEngine::copyRectClip(int *Array, byte *Origen, byte *Destino) {
int y, x;
int xorg = Array[0];
int yorg = Array[1];
@@ -460,7 +455,7 @@ void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino)
Destino[x + y * 320] = Origen[x + y * 320];
}
-void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) {
+void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) {
int x;
byte *ptr = VGA;
@@ -511,11 +506,11 @@ bool DrasculaEngine::escoba() {
buffer_teclado();
if (hay_que_load == 0)
- animacion_1_1();
+ animation_1_1();
sin_verbo();
- lee_dibujos("2aux62.alg");
- descomprime_dibujo(dir_dibujo2, 1);
+ loadPic("2aux62.alg");
+ decompressPic(dir_dibujo2, 1);
sentido_hare = 1;
obj_saliendo = 104;
if (hay_que_load != 0) {
@@ -605,13 +600,13 @@ bool DrasculaEngine::escoba() {
obj_saliendo = 104;
if (hay_que_load == 0) {
carga_escoba("58.ald");
- animacion_1_6();
+ animation_1_6();
} else {
if (!para_cargar(nom_partida)) {
return true;
}
- lee_dibujos("auxdr.alg");
- descomprime_dibujo(dir_dibujo2, 1);
+ loadPic("auxdr.alg");
+ decompressPic(dir_dibujo2, 1);
}
}
@@ -627,7 +622,7 @@ bucles:
if (num_ejec == 2) {
if ((!strcmp(num_room, "3.alg")) && (hare_x == 279) && (hare_y + alto_hare == 101))
- animacion_1_2();
+ animation_1_2();
else if ((!strcmp(num_room, "14.alg")) && (hare_x == 214) && (hare_y + alto_hare == 121))
lleva_al_hare(190, 130);
else if ((!strcmp(num_room, "14.alg")) && (hare_x == 246) && (hare_y + alto_hare == 112))
@@ -635,7 +630,7 @@ bucles:
}
mueve_cursor();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
if (num_ejec == 2) {
if (music_status() == 0 && musica_room != 0)
@@ -653,10 +648,10 @@ bucles:
if (boton_dch == 1 && menu_scr == 1) {
delay(100);
if (num_ejec == 2)
- lee_dibujos(fondo_y_menu);
+ loadPic(fondo_y_menu);
else
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
setvgapalette256((byte *)&palJuego);
menu_scr = 0;
espera_soltar();
@@ -669,14 +664,14 @@ bucles:
if (sentido_hare == 2)
sentido_hare = 1;
if (num_ejec == 4)
- lee_dibujos("icons2.alg");
+ loadPic("icons2.alg");
else if (num_ejec == 5)
- lee_dibujos("icons3.alg");
+ loadPic("icons3.alg");
else if (num_ejec == 6)
- lee_dibujos("iconsp.alg");
+ loadPic("iconsp.alg");
else
- lee_dibujos("icons.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("icons.alg");
+ decompressPic(dir_hare_fondo, 1);
menu_scr = 1;
espera_soltar();
sin_verbo();
@@ -746,15 +741,15 @@ bucles:
cont_sv = 0;
} else if (key == Common::KEYCODE_v) {
con_voces = 1;
- print_abc(SYS2, 96, 86);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ print_abc(_textsys[_lang][2], 96, 86);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
delay(1410);
if (num_ejec != 3)
cont_sv = 0;
} else if (key == Common::KEYCODE_t) {
con_voces = 0;
- print_abc(SYS3, 94, 86);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ print_abc(_textsys[_lang][3], 94, 86);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
delay(1460);
if (num_ejec != 3)
cont_sv = 0;
@@ -764,8 +759,8 @@ bucles:
if (num_ejec != 3)
cont_sv = 0;
} else if (num_ejec == 6 && key == Common::KEYCODE_0 && !strcmp(num_room, "61.alg")) {
- lee_dibujos("alcbar.alg");
- descomprime_dibujo(dir_dibujo1, 255);
+ loadPic("alcbar.alg");
+ decompressPic(dir_dibujo1, 255);
} else if (cont_sv == 1500) {
salva_pantallas();
if (num_ejec != 3)
@@ -779,20 +774,20 @@ bucles:
void DrasculaEngine::agarra_objeto(int objeto) {
if (num_ejec == 6)
- lee_dibujos("iconsp.alg");
+ loadPic("iconsp.alg");
else if (num_ejec == 4)
- lee_dibujos("icons2.alg");
+ loadPic("icons2.alg");
else if (num_ejec == 5)
- lee_dibujos("icons3.alg");
+ loadPic("icons3.alg");
else
- lee_dibujos("icons.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("icons.alg");
+ decompressPic(dir_hare_fondo, 1);
elige_objeto(objeto);
if (num_ejec == 2)
- lee_dibujos(fondo_y_menu);
+ loadPic(fondo_y_menu);
else
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
}
void DrasculaEngine::elige_objeto(int objeto) {
@@ -803,7 +798,7 @@ void DrasculaEngine::elige_objeto(int objeto) {
if (lleva_objeto == 1 && menu_scr == 0)
suma_objeto(objeto_que_lleva);
}
- DIBUJA_FONDO(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ copyBackground(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
lleva_objeto = 1;
objeto_que_lleva = objeto;
}
@@ -825,569 +820,6 @@ int DrasculaEngine::resta_objeto(int osj) {
return 1;
}
-void DrasculaEngine::animacion_1_1() {
- int l, l2, p;
- int pos_pixel[6];
-
- while (term_int == 0) {
- playmusic(29);
- fliplay("logoddm.bin", 9);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- delay(600);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- delay(340);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- playmusic(26);
- delay(500);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- fliplay("logoalc.bin", 8);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- lee_dibujos("cielo.alg");
- descomprime_dibujo(dir_zona_pantalla, 256);
- Negro();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(2);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- delay(900);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- color_abc(ROJO);
- centra_texto("Transilvanya, 1993 d.c.", 160, 100);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- delay(1000);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- delay(1200);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- fliplay("scrollb.bin", 9);
-
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- comienza_sound("s5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("scr2.bin", 17);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- fin_sound_corte();
- anima("scr3.bin", 17);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lee_dibujos("cielo2.alg");
- descomprime_dibujo(dir_zona_pantalla, 256);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- FundeAlNegro(1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
-
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("103.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("104.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("aux104.alg");
- descomprime_dibujo(dir_dibujo2, 1);
-
- playmusic(4);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- delay(400);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- for (l2 = 0; l2 < 3; l2++)
- for (l = 0; l < 7; l++) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_FONDO(interf_x[l], interf_y[l], 156, 45, 63, 31, dir_dibujo2, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (getscan() == Common::KEYCODE_ESCAPE) {
- term_int = 1;
- break;
- }
- pausa(3);
- }
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- l2 = 0; p = 0;
- pos_pixel[3] = 45;
- pos_pixel[4] = 63;
- pos_pixel[5] = 31;
-
- for (l = 0; l < 180; l++) {
- DIBUJA_FONDO(0, 0, 320 - l, 0, l, 200, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(l, 0, 0, 0, 320 - l, 200, dir_dibujo1, dir_zona_pantalla);
-
- pos_pixel[0] = interf_x[l2];
- pos_pixel[1] = interf_y[l2];
- pos_pixel[2] = 156 - l;
-
- DIBUJA_BLOQUE_CUT(pos_pixel, dir_dibujo2, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- p++;
- if (p == 6) {
- p = 0;
- l2++;
- }
- if (l2 == 7)
- l2 = 0;
- if (getscan() == Common::KEYCODE_ESCAPE) {
- term_int = 1;
- break;
- }
- }
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
-
- habla_dr_grande(TEXTD1, "D1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- borra_pantalla();
-
- lee_dibujos("100.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("auxigor.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("auxdr.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- sentido_dr = 0;
- x_dr = 129;
- y_dr = 95;
- sentido_igor = 1;
- x_igor = 66;
- y_igor = 97;
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_igor_dch(TEXTI8, "I8.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_dr_izq(TEXTD2, "d2.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_dr_izq(TEXTD3, "d3.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- color_solo = ROJO;
- lee_dibujos("plan1.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(10);
- habla_solo(TEXTD4,"d4.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lee_dibujos("plan1.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_solo(TEXTD5, "d5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- lee_dibujos("plan2.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(20);
- habla_solo(TEXTD6, "d6.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- lee_dibujos("plan3.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(20);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_solo(TEXTD7, "d7.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lee_dibujos("plan3.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_solo(TEXTD8, "d8.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- lee_dibujos("100.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- MusicFadeout();
- stopmusic();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_dch(TEXTI9, "I9.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_dr_izq(TEXTD9, "d9.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_dch(TEXTI10, "I10.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- playmusic(11);
- habla_dr_izq(TEXTD10, "d10.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("rayo1.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- comienza_sound("s5.als");
- anima("rayo2.bin", 15);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("frel2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("frel.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("frel.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- fin_sound_corte();
- borra_pantalla();
- Negro();
- playmusic(23);
- FundeDelNegro(0);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 1;
- habla_igor_dch(TEXTI1, "I1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_dr_dch(TEXTD11, "d11.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(1);
- sentido_dr = 0;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_dr_izq(TEXTD12, "d12.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(1);
- sentido_dr = 1;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_igor_dch(TEXTI2, "I2.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- pausa(13);
- habla_dr_dch(TEXTD13,"d13.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(1);
- sentido_dr = 0;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_dr_izq(TEXTD14, "d14.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_dch(TEXTI3, "I3.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_dr_izq(TEXTD15, "d15.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_dch(TEXTI4, "I4.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_dr_izq(TEXTD16, "d16.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_dch(TEXTI5, "I5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_igor = 3;
- habla_dr_izq(TEXTD17, "d17.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- pausa(18);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_igor_frente(TEXTI6, "I6.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- FundeAlNegro(0);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
-
- playmusic(2);
- pausa(5);
- fliplay("intro.bin", 12);
- term_int = 1;
- }
- borra_pantalla();
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::animacion_2_1() {
- int l;
-
- lleva_al_hare(231, 91);
- hare_se_ve = 0;
-
- term_int = 0;
-
- for (;;) {
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- anima("ag.bin", 14);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- habla_tabernero(TEXTT22, "T22.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- pausa(4);
- comienza_sound("s1.als");
- hipo(18);
- fin_sound();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- borra_pantalla();
- stopmusic();
- corta_musica = 1;
- memset(dir_zona_pantalla, 0, 64000);
- color_solo = BLANCO;
- pausa(80);
-
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_solo(TEXTBJ1, "BJ1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
- lee_dibujos("bj.alg");
- descomprime_dibujo(dir_zona_pantalla, MEDIA);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- Negro();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- color_solo = AMARILLO;
- habla_solo(TEXT214, "214.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- borra_pantalla();
-
- lee_dibujos("16.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lee_dibujos("auxbj.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- strcpy(num_room, "16.alg");
-
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- for (l = 0; l < 200; l++)
- factor_red[l] = 99;
- x_bj = 170;
- y_bj = 90;
- sentido_bj = 0;
- hare_x = 91;
- hare_y = 95;
- sentido_hare = 1;
- hare_se_ve = 1;
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- lee_dibujos("97g.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- anima("lev.bin", 15);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
-
- lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_hare = 1;
- hare_x = 100;
- hare_y = 95;
-
- habla_bj(TEXTBJ2, "BJ2.als");
- hablar(TEXT215, "215.als");
- habla_bj(TEXTBJ3, "BJ3.als");
- hablar(TEXT216, "216.als");
- habla_bj(TEXTBJ4, "BJ4.als");
- habla_bj(TEXTBJ5, "BJ5.als");
- habla_bj(TEXTBJ6, "BJ6.als");
- hablar(TEXT217, "217.als");
- habla_bj(TEXTBJ7, "BJ7.als");
- hablar(TEXT218, "218.als");
- habla_bj(TEXTBJ8, "BJ8.als");
- hablar(TEXT219, "219.als");
- habla_bj(TEXTBJ9, "BJ9.als");
- hablar(TEXT220, "220.als");
- hablar(TEXT221, "221.als");
- habla_bj(TEXTBJ10, "BJ10.als");
- hablar(TEXT222, "222.als");
- anima("gaf.bin", 15);
- anima("bjb.bin", 14);
- playmusic(9);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lee_dibujos("97.alg");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- descomprime_dibujo(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- pausa(120);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_solo(TEXT223, "223.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- color_solo = BLANCO;
- refresca_pantalla();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(110);
- habla_solo(TEXTBJ11, "BJ11.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- refresca_pantalla();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- pausa(118);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- lleva_al_hare(132, 97 + alto_hare);
- pausa(60);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- hablar(TEXT224, "224.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- habla_bj(TEXTBJ12, "BJ12.als");
- lleva_al_hare(157, 98 + alto_hare);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("bes.bin", 16);
- playmusic(11);
- anima("rap.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_hare = 3;
- strcpy(num_room, "no_bj.alg");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- pausa(8);
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT225, "225.als");
- pausa(76);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_hare = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT226, "226.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(30);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- hablar(TEXT227,"227.als");
- FundeAlNegro(0);
- break;
- }
-}
-
void DrasculaEngine::sin_verbo() {
int c = 171;
if (menu_scr == 1)
@@ -1399,7 +831,7 @@ void DrasculaEngine::sin_verbo() {
if (lleva_objeto == 1)
suma_objeto(objeto_que_lleva);
}
- DIBUJA_FONDO(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ copyBackground(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
lleva_objeto = 0;
hay_nombre = 0;
@@ -1409,7 +841,7 @@ bool DrasculaEngine::para_cargar(char nom_game[]) {
musica_antes = musica_room;
menu_scr = 0;
if (num_ejec != 1)
- borra_pantalla();
+ clearRoom();
if (!carga_partida(nom_game))
return false;
if (num_ejec == 2 || num_ejec == 3 || num_ejec == 5) {
@@ -1474,7 +906,7 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
getLine(ald, buffer, size);
sscanf(buffer, "%d", &musica_room);
getLine(ald, buffer, size);
- sscanf(buffer, "%s", pantalla_disco);
+ sscanf(buffer, "%s", roomDisk);
getLine(ald, buffer, size);
sscanf(buffer, "%d", &nivel_osc);
@@ -1502,12 +934,12 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
getLine(ald, buffer, size);
sscanf(buffer, "%s",pant4);
- lee_dibujos(pant2);
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos(pant1);
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos(pant4);
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic(pant2);
+ decompressPic(dir_hare_dch, 1);
+ loadPic(pant1);
+ decompressPic(dir_hare_frente, 1);
+ loadPic(pant4);
+ decompressPic(dir_hare_fondo, 1);
strcpy(fondo_y_menu, pant4);
}
@@ -1580,12 +1012,12 @@ martini:
alto_hare = ALTO_PERSONAJE;
ancho_hare = ANCHO_PERSONAJE;
alto_pies = PIES_HARE;
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("97.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
strcpy(fondo_y_menu, "99.alg");
}
@@ -1603,13 +1035,13 @@ martini:
}
hare_se_mueve = 0;
}
- lee_dibujos(pantalla_disco);
- descomprime_dibujo(dir_dibujo3, 1);
+ loadPic(roomDisk);
+ decompressPic(dir_dibujo3, 1);
- lee_dibujos(num_room);
- descomprime_dibujo(dir_dibujo1, MEDIA);
+ loadPic(num_room);
+ decompressPic(dir_dibujo1, MEDIA);
- DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ copyBackground(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
color_hare();
if (nivel_osc != 0)
@@ -1711,19 +1143,19 @@ martini:
}
if (num_ejec == 4 && !strcmp(num_room, "24.alg") && flags[29] == 1)
- animacion_7_4();
+ animation_7_4();
if (num_ejec == 5) {
if (!strcmp(num_room, "45.alg"))
hare_se_ve = 0;
if (!strcmp(num_room, "49.alg") && flags[7] == 0)
- animacion_4_5();
+ animation_4_5();
}
- refresca_pantalla();
+ updateRoom();
}
-void DrasculaEngine::borra_pantalla() {
+void DrasculaEngine::clearRoom() {
memset(VGA, 0, 64000);
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
_system->updateScreen();
@@ -1742,8 +1174,8 @@ void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) {
empieza_andar();
for (;;) {
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
if (hare_se_mueve == 0)
break;
}
@@ -1753,18 +1185,18 @@ void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) {
sentido_hare = sentido_final;
}
fin:
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
}
void DrasculaEngine::mueve_cursor() {
int pos_cursor[8];
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
+ updateRefresh_pre();
pon_hare();
- actualiza_refresco();
+ updateRefresh();
if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) {
if (_color != ROJO && menu_scr == 0)
@@ -1784,7 +1216,7 @@ void DrasculaEngine::mueve_cursor() {
pos_cursor[3] = y_raton - 17;
pos_cursor[4] = ANCHOBJ;
pos_cursor[5] = ALTOBJ;
- DIBUJA_BLOQUE_CUT(pos_cursor, dir_dibujo3, dir_zona_pantalla);
+ copyRectClip(pos_cursor, dir_dibujo3, dir_zona_pantalla);
}
void DrasculaEngine::comprueba_objetos() {
@@ -1983,7 +1415,7 @@ void DrasculaEngine::elige_verbo(int verbo) {
suma_objeto(objeto_que_lleva);
}
- DIBUJA_FONDO(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ copyBackground(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
lleva_objeto = 1;
objeto_que_lleva = verbo;
@@ -1992,25 +1424,25 @@ void DrasculaEngine::elige_verbo(int verbo) {
void DrasculaEngine::mesa() {
int nivel_master, nivel_voc, nivel_cd;
- DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
- VUELCA_PANTALLA(73, 63, 73, 63, 177, 97, dir_zona_pantalla);
+ copyRect(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
+ updateScreen(73, 63, 73, 63, 177, 97, dir_zona_pantalla);
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);
- refresca_pantalla();
+ updateRoom();
- DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
+ copyRect(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
- DIBUJA_FONDO(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
- DIBUJA_FONDO(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
- DIBUJA_FONDO(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
+ copyBackground(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
+ copyBackground(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
+ copyBackground(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
cursor_mesa();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
MirarRaton();
@@ -2059,7 +1491,7 @@ bool DrasculaEngine::saves() {
int n, n2, num_sav = 0, y = 27;
Common::InSaveFile *sav;
- borra_pantalla();
+ clearRoom();
if (!(sav = _saveFileMan->openForLoading("saves.epa"))) {
Common::OutSaveFile *epa;
@@ -2077,21 +1509,21 @@ bool DrasculaEngine::saves() {
sav->readLine(nombres[n], 23);
delete sav;
- lee_dibujos("savescr.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
+ loadPic("savescr.alg");
+ decompressPic(dir_dibujo1, MEDIA);
color_abc(VERDE_CLARO);
for (;;) {
y = 27;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
for (n = 0; n < NUM_SAVES; n++) {
print_abc(nombres[n], 116, y);
y = y + 9;
}
print_abc(select, 117, 15);
cursor_mesa();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
y = 27;
MirarRaton();
@@ -2168,15 +1600,15 @@ bool DrasculaEngine::saves() {
else if (hay_seleccion == 0) {
print_abc("elige una partida", 117, 15);
}
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
delay(400);
}
y = 26;
}
- borra_pantalla();
- lee_dibujos(num_room);
- descomprime_dibujo(dir_dibujo1, MEDIA);
+ clearRoom();
+ loadPic(num_room);
+ decompressPic(dir_dibujo1, MEDIA);
buffer_teclado();
hay_seleccion = 0;
@@ -2318,7 +1750,7 @@ void DrasculaEngine::print_abc(const char *dicho, int x_pantalla, int y_pantalla
pos_texto[4] = ANCHO_LETRAS;
pos_texto[5] = ALTO_LETRAS;
- DIBUJA_BLOQUE_CUT(pos_texto, dir_texto, dir_zona_pantalla);
+ copyRectClip(pos_texto, dir_texto, dir_zona_pantalla);
x_pantalla = x_pantalla + ANCHO_LETRAS;
if (x_pantalla > 317) {
@@ -2336,9 +1768,9 @@ bool DrasculaEngine::confirma_salir() {
byte key;
color_abc(ROJO);
- refresca_pantalla();
- centra_texto(SYS1, 160, 87);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ centra_texto(_textsys[_lang][1], 160, 87);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
delay(100);
for (;;) {
@@ -2362,10 +1794,10 @@ void DrasculaEngine::salva_pantallas() {
// for now ignore
return;
- borra_pantalla();
+ clearRoom();
- lee_dibujos("sv.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
+ loadPic("sv.alg");
+ decompressPic(dir_dibujo1, MEDIA);
//TODO inicio_ghost();
//TODO carga_ghost();
@@ -2384,8 +1816,8 @@ void DrasculaEngine::salva_pantallas() {
break;
}
//TODO fin_ghost();
- lee_dibujos(num_room);
- descomprime_dibujo(dir_dibujo1, MEDIA);
+ loadPic(num_room);
+ decompressPic(dir_dibujo1, MEDIA);
}
void DrasculaEngine::fliplay(const char *filefli, int vel) {
@@ -2409,7 +1841,7 @@ void DrasculaEngine::FundeDelNegro(int VelocidadDeFundido) {
palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
}
}
- pausa(VelocidadDeFundido);
+ pause(VelocidadDeFundido);
setvgapalette256((byte *)&palFundido);
}
@@ -2549,7 +1981,7 @@ void DrasculaEngine::comienza_sound(const char *fichero) {
ctvd_output(sku);
}
-void DrasculaEngine::anima(const char *animacion, int FPS) {
+void DrasculaEngine::anima(const char *animation, int FPS) {
Common::File FileIn;
unsigned j;
int NFrames = 1;
@@ -2558,10 +1990,10 @@ void DrasculaEngine::anima(const char *animacion, int FPS) {
AuxBuffLast = (byte *)malloc(65000);
AuxBuffDes = (byte *)malloc(65000);
- FileIn.open(animacion);
+ FileIn.open(animation);
if (!FileIn.isOpen()) {
- error("No encuentro un fichero de animacion.");
+ error("No encuentro un fichero de animation.");
}
FileIn.read(&NFrames, sizeof(NFrames));
@@ -2623,82 +2055,16 @@ void DrasculaEngine::FundeAlNegro(int VelocidadDeFundido) {
palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
}
}
- pausa(VelocidadDeFundido);
+ pause(VelocidadDeFundido);
setvgapalette256((byte *)&palFundido);
}
}
-void DrasculaEngine::pausa(int cuanto) {
+void DrasculaEngine::pause(int cuanto) {
_system->delayMillis(cuanto * 30); // was originaly 2
}
-void DrasculaEngine::habla_dr_grande(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- int x_habla[4] = {47, 93, 139, 185};
- int cara;
- int l = 0;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(3);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_FONDO(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, dir_dibujo2, dir_zona_pantalla);
- DIBUJA_FONDO(x_habla[cara], 1, 171, 68, 45, 48, dir_dibujo2, dir_zona_pantalla);
- l++;
- if (l == 7)
- l = 0;
-
- if (con_voces == 0)
- centra_texto(dicho, 191, 69);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (key == Common::KEYCODE_ESCAPE)
- term_int = 1;
-
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-}
-
void DrasculaEngine::pon_igor() {
int pos_igor[6];
@@ -2716,7 +2082,7 @@ void DrasculaEngine::pon_igor() {
pos_igor[4] = 54;
pos_igor[5] = 61;
- DIBUJA_BLOQUE_CUT(pos_igor, dir_hare_frente, dir_zona_pantalla);
+ copyRectClip(pos_igor, dir_hare_frente, dir_zona_pantalla);
}
void DrasculaEngine::pon_dr() {
@@ -2735,9 +2101,9 @@ void DrasculaEngine::pon_dr() {
pos_dr[5] = 77;
if (num_ejec == 6)
- DIBUJA_BLOQUE_CUT(pos_dr, dir_dibujo2, dir_zona_pantalla);
+ copyRectClip(pos_dr, dir_dibujo2, dir_zona_pantalla);
else
- DIBUJA_BLOQUE_CUT(pos_dr, dir_hare_fondo, dir_zona_pantalla);
+ copyRectClip(pos_dr, dir_hare_fondo, dir_zona_pantalla);
}
void DrasculaEngine::pon_bj() {
@@ -2753,471 +2119,7 @@ void DrasculaEngine::pon_bj() {
pos_bj[4] = 26;
pos_bj[5] = 76;
- DIBUJA_BLOQUE_CUT(pos_bj, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_igor_dch(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 56, 82, 108, 134, 160, 186, 212, 238 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- pon_igor();
- pon_dr();
- DIBUJA_FONDO(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, dir_dibujo1, dir_zona_pantalla);
-
- DIBUJA_BLOQUE(x_habla[cara], 148, x_igor + 17, y_igor, 25, 24, dir_hare_frente, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, x_igor + 26, y_igor);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_dr_izq(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
-
- DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla);
- if (num_ejec == 6)
- DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
- else
- DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, x_dr + 19, y_dr);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_dr_dch(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
-
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
-
- DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla);
- if (num_ejec != 6)
- DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
- else
- DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, x_dr + 19, y_dr);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- if (num_ejec == 6)
- refresca_pantalla();
-
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_solo(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec == 1)
- color_abc(color_solo);
- else if (num_ejec == 4)
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- if (num_ejec == 6)
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
-bucless:
-
- if (con_voces == 0) {
- if (num_ejec == 1)
- centra_texto(dicho, 156, 90);
- else if (num_ejec == 6)
- centra_texto(dicho, 213, 72);
- else if (num_ejec == 5)
- centra_texto(dicho, 173, 92);
- }
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
- if (num_ejec == 6) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-}
-
-void DrasculaEngine::habla_igor_frente(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 56, 86, 116, 146, 176, 206, 236, 266 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- if (num_ejec == 1 || num_ejec == 4)
- pon_igor();
- if (num_ejec == 1)
- pon_dr();
- if (num_ejec == 1 || num_ejec == 6)
- DIBUJA_FONDO(x_igor, y_igor, x_igor, y_igor, 29, 25, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x_habla[cara], 173, x_igor, y_igor, 29, 25, dir_hare_frente, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, x_igor + 26, y_igor);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- if (num_ejec == 6) {
- refresca_pantalla();
- }
-
- if (num_ejec == 1) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- }
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_tabernero(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- if (num_ejec == 1) {
- if (music_status() == 0)
- playmusic(musica_room);
- } else if (num_ejec == 2) {
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
- }
-
- cara = _rnd->getRandomNumber(8);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 132, 45);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete(sku);
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRectClip(pos_bj, dir_dibujo3, dir_zona_pantalla);
}
void DrasculaEngine::hipo(int contador) {
@@ -3228,11 +2130,11 @@ void DrasculaEngine::hipo(int contador) {
comienza:
contador--;
- refresca_pantalla();
+ updateRoom();
if (num_ejec == 3)
- VUELCA_PANTALLA(0, 0, 0, y, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, y, 320, 200, dir_zona_pantalla);
else
- VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla);
+ updateScreen(0, 1, 0, y, 320, 198, dir_zona_pantalla);
if (sentido == 0)
y++;
@@ -3253,8 +2155,8 @@ comienza:
if (contador > 0)
goto comienza;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
}
void DrasculaEngine::fin_sound() {
@@ -3267,244 +2169,6 @@ void DrasculaEngine::fin_sound() {
}
}
-void DrasculaEngine::habla_bj(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[5] = { 64, 92, 120, 148, 176 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
- if (num_ejec != 5) {
- cara = _rnd->getRandomNumber(4);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40,
- dir_dibujo1, dir_zona_pantalla);
-
- DIBUJA_BLOQUE(x_habla[cara], 99, x_bj + 2, y_bj - 1, 27, 40,
- dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, x_bj + 7, y_bj);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
- } else {
- refresca_pantalla();
-
- if (con_voces == 0)
- centra_texto(dicho, 93, 80);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::hablar(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int suma_1_pixel = 0;
- if (num_ejec != 2)
- suma_1_pixel = 1;
-
- int y_mask_habla = 170;
- int x_habla_dch[6] = { 1, 25, 49, 73, 97, 121 };
- int x_habla_izq[6] = { 145, 169, 193, 217, 241, 265 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- if (num_ejec == 6) {
- if (flags[0] == 0 && (!strcmp(num_room, "102.alg"))) {
- habla_pen(dicho, filename);
- return;
- }
- if (flags[0] == 0 && (!strcmp(num_room, "58.alg"))) {
- habla_pen2(dicho, filename);
- return;
- }
- }
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec != 2) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
- }
-
- if (num_ejec == 2)
- buffer_teclado();
-
- if (num_ejec == 4) {
- if (strcmp(num_room, "24.alg") || flags[29] == 0) {
- color_abc(AMARILLO);
- }
- } else {
- color_abc(AMARILLO);
- }
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(5);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
- if (num_ejec == 2)
- DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_habla - 1, dir_zona_pantalla, dir_dibujo3);
- else
- DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_habla - 1) / 100) * factor_red[hare_y + alto_hare]),
- dir_zona_pantalla, dir_dibujo3);
-
- pon_hare();
-
- if (num_ejec == 2) {
- if (!strcmp(fondo_y_menu, "99.alg") || !strcmp(fondo_y_menu, "994.alg"))
- DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_habla - 1, dir_dibujo3, dir_zona_pantalla);
- } else {
- DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_habla - 1) / 100) * factor_red[hare_y + alto_hare]),
- dir_dibujo3, dir_zona_pantalla);
- }
-
- if (sentido_hare == 0) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_izq[cara], y_mask_habla, hare_x + 8, hare_y - 1, ancho_habla, alto_habla,
- dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_izq[cara], y_mask_habla, hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare],
- dir_hare_dch, dir_zona_pantalla);
-
- actualiza_refresco();
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 12, hare_y, ancho_habla, alto_habla,
- dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_dch[cara], y_mask_habla, hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- actualiza_refresco();
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_izq[cara], y_mask_habla, hare_x + 12, hare_y, ancho_habla, alto_habla,
- dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_izq[cara], y_mask_habla,
- suma_1_pixel + hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare],
- dir_hare_frente, dir_zona_pantalla);
- actualiza_refresco();
- } else if (sentido_hare == 3) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 8, hare_y, ancho_habla, alto_habla,
- dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_dch[cara], y_mask_habla,
- suma_1_pixel + hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare],
- dir_hare_frente, dir_zona_pantalla);
- actualiza_refresco();
- }
-
- if (con_voces == 0)
- centra_texto(dicho, hare_x, hare_y);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- if (num_ejec == 1) {
- if (music_status() == 0 && flags[11] == 0 && corta_musica == 0)
- playmusic(musica_room);
- }
-}
-
void DrasculaEngine::playmusic(int p) {
AudioCD.stop();
AudioCD.play(p - 1, 1, 0, 0);
@@ -3518,18 +2182,18 @@ int DrasculaEngine::music_status() {
return AudioCD.isPlaying();
}
-void DrasculaEngine::refresca_pantalla() {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
+void DrasculaEngine::updateRoom() {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
if (num_ejec == 3) {
if (flags[0] == 0)
pon_hare();
else
- DIBUJA_BLOQUE(113, 54, hare_x - 20, hare_y - 1, 77, 89, dir_dibujo3, dir_zona_pantalla);
+ copyRect(113, 54, hare_x - 20, hare_y - 1, 77, 89, dir_dibujo3, dir_zona_pantalla);
} else {
pon_hare();
}
- actualiza_refresco();
+ updateRefresh();
}
bool DrasculaEngine::carga_partida(const char *nom_game) {
@@ -3743,139 +2407,6 @@ void DrasculaEngine::empieza_andar() {
conta_vez = vez();
}
-void DrasculaEngine::actualiza_refresco() {
- if (num_ejec == 1) {
- if (!strcmp(num_room, "63.alg"))
- refresca_63();
- else if (!strcmp(num_room, "62.alg"))
- refresca_62();
- } else if (num_ejec == 2) {
- if (!strcmp(num_room, "3.alg"))
- refresca_3();
- else if (!strcmp(num_room, "2.alg"))
- refresca_2();
- else if (!strcmp(num_room, "4.alg"))
- refresca_4();
- else if (!strcmp(num_room, "5.alg"))
- refresca_5();
- else if (!strcmp(num_room, "15.alg"))
- refresca_15();
- else if (!strcmp(num_room, "17.alg"))
- refresca_17();
- else if (!strcmp(num_room, "18.alg"))
- refresca_18();
- else if (!strcmp(num_room, "10.alg"))
- mapa();
- } else if (num_ejec == 3) {
- if (!strcmp(num_room, "20.alg"))
- refresca_20();
- else if (!strcmp(num_room, "13.alg"))
- refresca_13();
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "29.alg"))
- refresca_29();
- else if (!strcmp(num_room, "26.alg"))
- refresca_26();
- else if (!strcmp(num_room, "27.alg"))
- refresca_27();
- else if (!strcmp(num_room, "31.alg"))
- refresca_31();
- else if (!strcmp(num_room, "34.alg"))
- refresca_34();
- else if (!strcmp(num_room, "35.alg"))
- refresca_35();
- } else if (num_ejec == 5) {
- if (!strcmp(num_room, "45.alg"))
- mapa();
- else if (!strcmp(num_room, "50.alg"))
- refresca_50();
- else if (!strcmp(num_room, "57.alg"))
- refresca_57();
- } else if (num_ejec == 6) {
- if (!strcmp(num_room, "60.alg"))
- refresca_60();
- else if (!strcmp(num_room, "61.alg"))
- refresca_61();
- else if (!strcmp(num_room, "58.alg"))
- refresca_58();
- }
-}
-
-void DrasculaEngine::actualiza_refresco_antes() {
- if (num_ejec == 1) {
- if (!strcmp(num_room, "62.alg"))
- refresca_62_antes();
- else if (!strcmp(num_room, "16.alg"))
- pon_bj();
- } else if (num_ejec == 2) {
- if (!strcmp(num_room, "1.alg"))
- refresca_1_antes();
- else if (!strcmp(num_room, "3.alg"))
- refresca_3_antes();
- else if (!strcmp(num_room, "5.alg"))
- refresca_5_antes();
- else if (!strcmp(num_room, "6.alg"))
- refresca_6_antes();
- else if (!strcmp(num_room, "7.alg"))
- refresca_7_antes();
- else if (!strcmp(num_room, "9.alg"))
- refresca_9_antes();
- else if (!strcmp(num_room, "12.alg"))
- refresca_12_antes();
- else if (!strcmp(num_room, "14.alg"))
- refresca_14_antes();
- else if (!strcmp(num_room, "16.alg"))
- refresca_16_antes();
- else if (!strcmp(num_room, "17.alg"))
- refresca_17_antes();
- else if (!strcmp(num_room, "18.alg"))
- refresca_18_antes();
- } else if (num_ejec == 3) {
- // nothing
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "21.alg"))
- refresca_21_antes();
- else if (!strcmp(num_room, "22.alg"))
- refresca_22_antes();
- else if (!strcmp(num_room, "23.alg"))
- refresca_23_antes();
- else if (!strcmp(num_room, "24.alg"))
- refresca_24_antes();
- else if (!strcmp(num_room, "26.alg"))
- refresca_26_antes();
- else if (!strcmp(num_room, "27.alg"))
- refresca_27_antes();
- else if (!strcmp(num_room, "29.alg"))
- refresca_29_antes();
- else if (!strcmp(num_room, "30.alg"))
- refresca_30_antes();
- else if (!strcmp(num_room, "31.alg"))
- refresca_31_antes();
- else if (!strcmp(num_room, "34.alg"))
- refresca_34_antes();
- else if (!strcmp(num_room, "35.alg"))
- refresca_35_antes();
- } else if (num_ejec == 5) {
- if (!strcmp(num_room,"49.alg"))
- refresca_49_antes();
- else if (!strcmp(num_room,"53.alg"))
- refresca_53_antes();
- else if (!strcmp(num_room,"54.alg"))
- refresca_54_antes();
- else if (!strcmp(num_room,"56.alg"))
- refresca_56_antes();
- } else if (num_ejec == 6) {
- if (!strcmp(num_room, "102.alg"))
- refresca_pendulo();
- else if (!strcmp(num_room, "58.alg"))
- refresca_58_antes();
- else if (!strcmp(num_room, "59.alg"))
- refresca_59_antes();
- else if (!strcmp(num_room, "60.alg"))
- refresca_60_antes();
- }
-}
-
void DrasculaEngine::pon_hare() {
int pos_hare[6];
int r;
@@ -3947,25 +2478,25 @@ void DrasculaEngine::pon_hare() {
if (sentido_hare == 0) {
pos_hare[1] = 0;
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
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], dir_hare_dch, dir_zona_pantalla);
} else if (sentido_hare == 1) {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
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], dir_hare_dch, dir_zona_pantalla);
} else if (sentido_hare == 2) {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_fondo, dir_zona_pantalla);
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], dir_hare_fondo, dir_zona_pantalla);
} else {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_frente, dir_zona_pantalla);
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], dir_hare_frente, dir_zona_pantalla);
@@ -3985,25 +2516,25 @@ void DrasculaEngine::pon_hare() {
if (sentido_hare == 0) {
pos_hare[1] = 0;
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
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], dir_hare_dch, dir_zona_pantalla);
} else if (sentido_hare == 1) {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
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], dir_hare_dch, dir_zona_pantalla);
} else if (sentido_hare == 2) {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_fondo, dir_zona_pantalla);
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], dir_hare_fondo, dir_zona_pantalla);
} else {
if (num_ejec == 2)
- DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla);
+ copyRectClip(pos_hare, dir_hare_frente, dir_zona_pantalla);
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], dir_hare_frente, dir_zona_pantalla);
@@ -4026,13 +2557,13 @@ void DrasculaEngine::menu_sin_volcar() {
if (h != 0) {
if (num_ejec == 6)
- DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
+ copyBackground(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
ANCHOBJ, ALTOBJ, dir_mesa, dir_zona_pantalla);
else
- DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
+ copyBackground(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla);
}
- DIBUJA_BLOQUE(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n],
+ copyRect(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n],
ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla);
}
@@ -4046,7 +2577,7 @@ void DrasculaEngine::barra_menu() {
for (n = 0; n < 7; n++) {
if (x_raton > x_barra[n] && x_raton < x_barra[n + 1])
sobre_verbo = 0;
- DIBUJA_BLOQUE(ANCHOBJ * n, ALTOBJ * sobre_verbo, x_barra[n], 2,
+ copyRect(ANCHOBJ * n, ALTOBJ * sobre_verbo, x_barra[n], 2,
ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla);
sobre_verbo = 1;
}
@@ -4055,7 +2586,7 @@ void DrasculaEngine::barra_menu() {
void DrasculaEngine::saca_objeto() {
int h = 0, n;
- refresca_pantalla();
+ updateRoom();
for (n = 1; n < 43; n++){
if (sobre_que_objeto() == n) {
@@ -4077,14 +2608,14 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (num_ejec == 1) {
if (num_obj[l] == 105 && flags[0] == 0)
- hablar(TEXT442, "442.als");
+ talk(_text[_lang][442], "442.als");
else {
puertas_cerradas(l);
if (espuerta[l] != 0) {
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
sentido_hare = sentidobj[l];
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hare_se_mueve = 0;
sentido_hare = sentido_alkeva[l];
obj_saliendo = alapuertakeva[l];
@@ -4092,10 +2623,10 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
musica_antes = musica_room;
if (num_obj[l] == 105) {
- animacion_2_1();
+ animation_2_1();
return true;
}
- borra_pantalla();
+ clearRoom();
strcpy(salgo, alapantallakeva[l]);
strcat(salgo, ".ald");
hare_x = -1;
@@ -4112,11 +2643,11 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
rompo = 1;
musica_antes = musica_room;
if (num_obj[l] == 136)
- animacion_2_2();
+ animation_2_2();
if (num_obj[l] == 124)
- animacion_3_2();
+ animation_3_2();
if (num_obj[l] == 173) {
- animacion_35_2();
+ animation_35_2();
return true;
} if (num_obj[l] == 146 && flags[39] == 1) {
flags[5] = 1;
@@ -4127,7 +2658,7 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
resta_objeto(23);
suma_objeto(11);
}
- borra_pantalla();
+ clearRoom();
delete ald;
ald = NULL;
strcpy(salgo, alapantallakeva[l]);
@@ -4140,14 +2671,14 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (espuerta[l] != 0 && visible[l] == 1) {
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
sentido_hare = sentidobj[l];
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hare_se_mueve = 0;
sentido_hare = sentido_alkeva[l];
obj_saliendo = alapuertakeva[l];
rompo = 1;
musica_antes = musica_room;
- borra_pantalla();
+ clearRoom();
strcpy(salgo, alapantallakeva[l]);
strcat(salgo, ".ald");
hare_x =- 1;
@@ -4158,8 +2689,8 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (espuerta[l] != 0) {
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
sentido_hare = sentidobj[l];
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hare_se_mueve = 0;
sentido_hare = sentido_alkeva[l];
obj_saliendo = alapuertakeva[l];
@@ -4168,7 +2699,7 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (num_obj[l] == 108)
lleva_al_hare(171, 78);
- borra_pantalla();
+ clearRoom();
strcpy(salgo, alapantallakeva[l]);
strcat(salgo, ".ald");
hare_x = -1;
@@ -4179,15 +2710,15 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (espuerta[l] != 0 && visible[l] == 1) {
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
sentido_hare = sentidobj[l];
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hare_se_mueve = 0;
sentido_hare = sentido_alkeva[l];
obj_saliendo = alapuertakeva[l];
rompo = 1;
musica_antes = musica_room;
hare_se_ve = 1;
- borra_pantalla();
+ clearRoom();
strcpy(salgo, alapantallakeva[l]);
strcat(salgo, ".ald");
hare_x = -1;
@@ -4198,21 +2729,21 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) {
if (espuerta[l] != 0) {
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
sentido_hare = sentidobj[l];
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hare_se_mueve = 0;
sentido_hare = sentido_alkeva[l];
obj_saliendo = alapuertakeva[l];
rompo = 1;
musica_antes = musica_room;
- borra_pantalla();
+ clearRoom();
strcpy(salgo, alapantallakeva[l]);
strcat(salgo, ".ald");
hare_x = -1;
carga_escoba(salgo);
if (obj_saliendo == 105)
- animacion_19_6();
+ animation_19_6();
}
}
@@ -4224,9 +2755,9 @@ bool DrasculaEngine::coge_objeto() {
h = objeto_que_lleva;
comprueba_flags = 1;
- refresca_pantalla();
+ updateRoom();
menu_sin_volcar();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
if (objeto_que_lleva < 7)
goto usando_verbos;
@@ -4254,110 +2785,110 @@ usando_verbos:
bool DrasculaEngine::banderas(int fl) {
hare_se_mueve = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
hay_respuesta = 1;
if (menu_scr == 1) {
if (num_ejec == 1) {
- if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
+ if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
} else if (num_ejec == 2) {
- if ((objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 0)
- || (objeto_que_lleva == ABRIR && fl == 22 && flags[23] == 0)) {
- hablar(TEXT164, "164.als");
+ if ((objeto_que_lleva == LOOK && fl == 22 && flags[23] == 0)
+ || (objeto_que_lleva == OPEN && fl == 22 && flags[23] == 0)) {
+ talk(_text[_lang][164], "164.als");
flags[23] = 1;
sin_verbo();
suma_objeto(7);
suma_objeto(18);
- } else if (objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 1)
- hablar(TEXT307, "307.als");
- else if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
- else if (objeto_que_lleva == MIRAR && fl == 7)
- hablar(TEXT143, "143.als");
- else if (objeto_que_lleva == HABLAR && fl == 7)
- hablar(TEXT144, "144.als");
- else if (objeto_que_lleva == MIRAR && fl == 8)
- hablar(TEXT145, "145.als");
- else if (objeto_que_lleva == HABLAR && fl == 8)
- hablar(TEXT146, "146.als");
- else if (objeto_que_lleva == MIRAR && fl == 9)
- hablar(TEXT147, "147.als");
- else if (objeto_que_lleva == HABLAR && fl == 9)
- hablar(TEXT148, "148.als");
- else if (objeto_que_lleva == MIRAR && fl == 10)
- hablar(TEXT151, "151.als");
- else if (objeto_que_lleva == MIRAR && fl == 11)
- hablar(TEXT152, "152.als");
- else if (objeto_que_lleva == HABLAR && fl == 11)
- hablar(TEXT153, "153.als");
- else if (objeto_que_lleva == MIRAR && fl == 12)
- hablar(TEXT154, "154.als");
- else if (objeto_que_lleva == MIRAR && fl == 13)
- hablar(TEXT155, "155.als");
- else if (objeto_que_lleva == MIRAR && fl == 14)
- hablar(TEXT157, "157.als");
- else if (objeto_que_lleva == MIRAR && fl == 15)
- hablar(TEXT58, "58.als");
- else if (objeto_que_lleva == MIRAR && fl == 16)
- hablar(TEXT158, "158.als");
- else if (objeto_que_lleva == MIRAR && fl == 17)
- hablar(TEXT159, "159.als");
- else if (objeto_que_lleva == MIRAR && fl == 18)
- hablar(TEXT160, "160.als");
- else if (objeto_que_lleva == MIRAR && fl == 19)
- hablar(TEXT161, "161.als");
- else if (objeto_que_lleva == MIRAR && fl == 20)
- hablar(TEXT162, "162.als");
- else if (objeto_que_lleva == MIRAR && fl == 23)
- hablar(TEXT152, "152.als");
+ } else if (objeto_que_lleva == LOOK && fl == 22 && flags[23] == 1)
+ talk(_text[_lang][307], "307.als");
+ else if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
+ else if (objeto_que_lleva == LOOK && fl == 7)
+ talk(_text[_lang][143], "143.als");
+ else if (objeto_que_lleva == TALK && fl == 7)
+ talk(_text[_lang][144], "144.als");
+ else if (objeto_que_lleva == LOOK && fl == 8)
+ talk(_text[_lang][145], "145.als");
+ else if (objeto_que_lleva == TALK && fl == 8)
+ talk(_text[_lang][146], "146.als");
+ else if (objeto_que_lleva == LOOK && fl == 9)
+ talk(_text[_lang][147], "147.als");
+ else if (objeto_que_lleva == TALK && fl == 9)
+ talk(_text[_lang][148], "148.als");
+ else if (objeto_que_lleva == LOOK && fl == 10)
+ talk(_text[_lang][151], "151.als");
+ else if (objeto_que_lleva == LOOK && fl == 11)
+ talk(_text[_lang][152], "152.als");
+ else if (objeto_que_lleva == TALK && fl == 11)
+ talk(_text[_lang][153], "153.als");
+ else if (objeto_que_lleva == LOOK && fl == 12)
+ talk(_text[_lang][154], "154.als");
+ else if (objeto_que_lleva == LOOK && fl == 13)
+ talk(_text[_lang][155], "155.als");
+ else if (objeto_que_lleva == LOOK && fl == 14)
+ talk(_text[_lang][157], "157.als");
+ else if (objeto_que_lleva == LOOK && fl == 15)
+ talk(_text[_lang][58], "58.als");
+ else if (objeto_que_lleva == LOOK && fl == 16)
+ talk(_text[_lang][158], "158.als");
+ else if (objeto_que_lleva == LOOK && fl == 17)
+ talk(_text[_lang][159], "159.als");
+ else if (objeto_que_lleva == LOOK && fl == 18)
+ talk(_text[_lang][160], "160.als");
+ else if (objeto_que_lleva == LOOK && fl == 19)
+ talk(_text[_lang][161], "161.als");
+ else if (objeto_que_lleva == LOOK && fl == 20)
+ talk(_text[_lang][162], "162.als");
+ else if (objeto_que_lleva == LOOK && fl == 23)
+ talk(_text[_lang][152], "152.als");
else
hay_respuesta = 0;
} else if (num_ejec == 3) {
- if (objeto_que_lleva == MIRAR && fl == 22)
- hablar(TEXT307, "307.als");
- else if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
- else if (objeto_que_lleva == MIRAR && fl == 7)
- hablar(TEXT143, "143.als");
- else if (objeto_que_lleva == HABLAR && fl == 7)
- hablar(TEXT144, "144.als");
- else if (objeto_que_lleva == MIRAR && fl == 8)
- hablar(TEXT145, "145.als");
- else if (objeto_que_lleva == HABLAR && fl == 8)
- hablar(TEXT146, "146.als");
- else if (objeto_que_lleva == MIRAR && fl == 9)
- hablar(TEXT147, "147.als");
- else if (objeto_que_lleva == HABLAR && fl == 9)
- hablar(TEXT148, "148.als");
- else if (objeto_que_lleva == MIRAR && fl == 10)
- hablar(TEXT151, "151.als");
- else if (objeto_que_lleva == MIRAR && fl == 11)
- hablar(TEXT152, "152.als");
- else if (objeto_que_lleva == HABLAR && fl == 11)
- hablar(TEXT153, "153.als");
- else if (objeto_que_lleva == MIRAR && fl == 12)
- hablar(TEXT154, "154.als");
- else if (objeto_que_lleva == MIRAR && fl == 13)
- hablar(TEXT155, "155.als");
- else if (objeto_que_lleva == MIRAR && fl == 14)
- hablar(TEXT157, "157.als");
- else if (objeto_que_lleva == MIRAR && fl == 15)
- hablar(TEXT58, "58.als");
- else if (objeto_que_lleva == MIRAR && fl == 16)
- hablar(TEXT158, "158.als");
- else if (objeto_que_lleva == MIRAR && fl == 17)
- hablar(TEXT159, "159.als");
- else if (objeto_que_lleva == MIRAR && fl == 18)
- hablar(TEXT160, "160.als");
- else if (objeto_que_lleva == MIRAR && fl == 19)
- hablar(TEXT161, "161.als");
- else if (objeto_que_lleva == MIRAR && fl == 20)
- hablar(TEXT162, "162.als");
- else if (objeto_que_lleva == MIRAR && fl == 23)
- hablar(TEXT152, "152.als");
+ if (objeto_que_lleva == LOOK && fl == 22)
+ talk(_text[_lang][307], "307.als");
+ else if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
+ else if (objeto_que_lleva == LOOK && fl == 7)
+ talk(_text[_lang][143], "143.als");
+ else if (objeto_que_lleva == TALK && fl == 7)
+ talk(_text[_lang][144], "144.als");
+ else if (objeto_que_lleva == LOOK && fl == 8)
+ talk(_text[_lang][145], "145.als");
+ else if (objeto_que_lleva == TALK && fl == 8)
+ talk(_text[_lang][146], "146.als");
+ else if (objeto_que_lleva == LOOK && fl == 9)
+ talk(_text[_lang][147], "147.als");
+ else if (objeto_que_lleva == TALK && fl == 9)
+ talk(_text[_lang][148], "148.als");
+ else if (objeto_que_lleva == LOOK && fl == 10)
+ talk(_text[_lang][151], "151.als");
+ else if (objeto_que_lleva == LOOK && fl == 11)
+ talk(_text[_lang][152], "152.als");
+ else if (objeto_que_lleva == TALK && fl == 11)
+ talk(_text[_lang][153], "153.als");
+ else if (objeto_que_lleva == LOOK && fl == 12)
+ talk(_text[_lang][154], "154.als");
+ else if (objeto_que_lleva == LOOK && fl == 13)
+ talk(_text[_lang][155], "155.als");
+ else if (objeto_que_lleva == LOOK && fl == 14)
+ talk(_text[_lang][157], "157.als");
+ else if (objeto_que_lleva == LOOK && fl == 15)
+ talk(_text[_lang][58], "58.als");
+ else if (objeto_que_lleva == LOOK && fl == 16)
+ talk(_text[_lang][158], "158.als");
+ else if (objeto_que_lleva == LOOK && fl == 17)
+ talk(_text[_lang][159], "159.als");
+ else if (objeto_que_lleva == LOOK && fl == 18)
+ talk(_text[_lang][160], "160.als");
+ else if (objeto_que_lleva == LOOK && fl == 19)
+ talk(_text[_lang][161], "161.als");
+ else if (objeto_que_lleva == LOOK && fl == 20)
+ talk(_text[_lang][162], "162.als");
+ else if (objeto_que_lleva == LOOK && fl == 23)
+ talk(_text[_lang][152], "152.als");
else
hay_respuesta = 0;
} else if (num_ejec == 4) {
@@ -4367,291 +2898,291 @@ bool DrasculaEngine::banderas(int fl) {
resta_objeto(18);
resta_objeto(19);
} else if ((objeto_que_lleva == 14 && fl == 19) || (objeto_que_lleva == 19 && fl == 14))
- hablar(TEXT484, "484.als");
- else if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
- else if (objeto_que_lleva == MIRAR && fl == 7)
- hablar(TEXT478, "478.als");
- else if (objeto_que_lleva == MIRAR && fl == 8)
- hablar(TEXT480, "480.als");
- else if (objeto_que_lleva == MIRAR && fl == 9) {
- hablar(TEXT482, "482.als");
- hablar(TEXT483, "483.als");
- } else if (objeto_que_lleva == MIRAR && fl == 10)
- hablar(TEXT485, "485.als");
- else if (objeto_que_lleva == MIRAR && fl == 11)
- hablar(TEXT488, "488.als");
- else if (objeto_que_lleva == MIRAR && fl == 12)
- hablar(TEXT486, "486.als");
- else if (objeto_que_lleva == MIRAR && fl == 13)
- hablar(TEXT490, "490.als");
- else if (objeto_que_lleva == MIRAR && fl == 14)
- hablar(TEXT122, "122.als");
- else if (objeto_que_lleva == MIRAR && fl == 15)
- hablar(TEXT117, "117.als");
- else if (objeto_que_lleva == HABLAR && fl == 15)
- hablar(TEXT118, "118.als");
- else if (objeto_que_lleva == ABRIR && fl == 15)
- hablar(TEXT119, "119.als");
- else if (objeto_que_lleva == MIRAR && fl == 16)
- hablar(TEXT491, "491.als");
- else if (objeto_que_lleva == MIRAR && fl == 17)
- hablar(TEXT478, "478.als");
- else if (objeto_que_lleva == MIRAR && fl == 18)
- hablar(TEXT493, "493.als");
- else if (objeto_que_lleva == MIRAR && fl == 19) {
- hablar(TEXT494, "494.als");
- hablar(TEXT495, "495.als");
- } else if (objeto_que_lleva == MIRAR && fl == 20)
- hablar(TEXT162, "162.als");
- else if (objeto_que_lleva == MIRAR && fl == 21)
- hablar(TEXT496, "496.als");
- else if (objeto_que_lleva == MIRAR && fl == 22)
- hablar(TEXT161, "161.als");
+ talk(_text[_lang][484], "484.als");
+ else if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
+ else if (objeto_que_lleva == LOOK && fl == 7)
+ talk(_text[_lang][478], "478.als");
+ else if (objeto_que_lleva == LOOK && fl == 8)
+ talk(_text[_lang][480], "480.als");
+ else if (objeto_que_lleva == LOOK && fl == 9) {
+ talk(_text[_lang][482], "482.als");
+ talk(_text[_lang][483], "483.als");
+ } else if (objeto_que_lleva == LOOK && fl == 10)
+ talk(_text[_lang][485], "485.als");
+ else if (objeto_que_lleva == LOOK && fl == 11)
+ talk(_text[_lang][488], "488.als");
+ else if (objeto_que_lleva == LOOK && fl == 12)
+ talk(_text[_lang][486], "486.als");
+ else if (objeto_que_lleva == LOOK && fl == 13)
+ talk(_text[_lang][490], "490.als");
+ else if (objeto_que_lleva == LOOK && fl == 14)
+ talk(_text[_lang][122], "122.als");
+ else if (objeto_que_lleva == LOOK && fl == 15)
+ talk(_text[_lang][117], "117.als");
+ else if (objeto_que_lleva == TALK && fl == 15)
+ talk(_text[_lang][118], "118.als");
+ else if (objeto_que_lleva == OPEN && fl == 15)
+ talk(_text[_lang][119], "119.als");
+ else if (objeto_que_lleva == LOOK && fl == 16)
+ talk(_text[_lang][491], "491.als");
+ else if (objeto_que_lleva == LOOK && fl == 17)
+ talk(_text[_lang][478], "478.als");
+ else if (objeto_que_lleva == LOOK && fl == 18)
+ talk(_text[_lang][493], "493.als");
+ else if (objeto_que_lleva == LOOK && fl == 19) {
+ talk(_text[_lang][494], "494.als");
+ talk(_text[_lang][495], "495.als");
+ } else if (objeto_que_lleva == LOOK && fl == 20)
+ talk(_text[_lang][162], "162.als");
+ else if (objeto_que_lleva == LOOK && fl == 21)
+ talk(_text[_lang][496], "496.als");
+ else if (objeto_que_lleva == LOOK && fl == 22)
+ talk(_text[_lang][161], "161.als");
else
hay_respuesta = 0;
} else if (num_ejec == 5) {
- if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
- else if (objeto_que_lleva == MIRAR && fl == 7)
- hablar(TEXT478,"478.als");
- else if (objeto_que_lleva == MIRAR && fl == 8)
- hablar(TEXT120, "120.als");
- else if (objeto_que_lleva == MIRAR && fl == 9) {
- hablar(TEXT482, "482.als");
- hablar(TEXT483, "483.als");
- } else if (objeto_que_lleva == MIRAR && fl == 11)
- hablar(TEXT488, "488.als");
- else if (objeto_que_lleva == MIRAR && fl == 13)
- hablar(TEXT490, "490.als");
- else if (objeto_que_lleva == MIRAR && fl == 14)
- hablar(TEXT121, "121.als");
- else if (objeto_que_lleva == MIRAR && fl == 15)
- hablar(TEXT117, "117.als");
- else if (objeto_que_lleva == HABLAR && fl == 15)
- hablar(TEXT118, "118.als");
- else if (objeto_que_lleva == ABRIR && fl == 15)
- hablar(TEXT119, "119.als");
- else if (objeto_que_lleva == MIRAR && fl == 17)
- hablar(TEXT478, "478.als");
- else if (objeto_que_lleva == MIRAR && fl == 20)
- hablar(TEXT162, "162.als");
+ if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
+ else if (objeto_que_lleva == LOOK && fl == 7)
+ talk(_text[_lang][478],"478.als");
+ else if (objeto_que_lleva == LOOK && fl == 8)
+ talk(_text[_lang][120], "120.als");
+ else if (objeto_que_lleva == LOOK && fl == 9) {
+ talk(_text[_lang][482], "482.als");
+ talk(_text[_lang][483], "483.als");
+ } else if (objeto_que_lleva == LOOK && fl == 11)
+ talk(_text[_lang][488], "488.als");
+ else if (objeto_que_lleva == LOOK && fl == 13)
+ talk(_text[_lang][490], "490.als");
+ else if (objeto_que_lleva == LOOK && fl == 14)
+ talk(_text[_lang][121], "121.als");
+ else if (objeto_que_lleva == LOOK && fl == 15)
+ talk(_text[_lang][117], "117.als");
+ else if (objeto_que_lleva == TALK && fl == 15)
+ talk(_text[_lang][118], "118.als");
+ else if (objeto_que_lleva == OPEN && fl == 15)
+ talk(_text[_lang][119], "119.als");
+ else if (objeto_que_lleva == LOOK && fl == 17)
+ talk(_text[_lang][478], "478.als");
+ else if (objeto_que_lleva == LOOK && fl == 20)
+ talk(_text[_lang][162], "162.als");
else
hay_respuesta = 0;
} else if (num_ejec == 6) {
- if (objeto_que_lleva == MIRAR && fl == 28)
- hablar(TEXT328, "328.als");
- else if (objeto_que_lleva == MIRAR && fl == 9) {
- hablar(TEXT482, "482.als");
- hablar(TEXT483, "483.als");
- } else if (objeto_que_lleva == MIRAR && fl == 20)
- hablar(TEXT123, "123.als");
- else if (objeto_que_lleva == MIRAR && fl == 21)
- hablar(TEXT441, "441.als");
+ if (objeto_que_lleva == LOOK && fl == 28)
+ talk(_text[_lang][328], "328.als");
+ else if (objeto_que_lleva == LOOK && fl == 9) {
+ talk(_text[_lang][482], "482.als");
+ talk(_text[_lang][483], "483.als");
+ } else if (objeto_que_lleva == LOOK && fl == 20)
+ talk(_text[_lang][123], "123.als");
+ else if (objeto_que_lleva == LOOK && fl == 21)
+ talk(_text[_lang][441], "441.als");
else
hay_respuesta = 0;
}
} else {
if (num_ejec == 1) {
- if (objeto_que_lleva == MIRAR && fl == 50)
- hablar(TEXT308, "308.als");
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar(TEXT310, "310.als");
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar(TEXT311, "311.als");
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar(TEXT312, "312.als");
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar(TEXT313, "313.als");
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar(TEXT314, "314.als");
+ if (objeto_que_lleva == LOOK && fl == 50)
+ talk(_text[_lang][308], "308.als");
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk(_text[_lang][310], "310.als");
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk(_text[_lang][311], "311.als");
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk(_text[_lang][312], "312.als");
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk(_text[_lang][313], "313.als");
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk(_text[_lang][314], "314.als");
else if (!strcmp(num_room, "62.alg"))
- pantalla_62(fl);
+ room_62(fl);
else if (!strcmp(num_room, "63.alg"))
- pantalla_63(fl);
+ room_63(fl);
else
hay_respuesta = 0;
} else if (num_ejec == 2) {
- if (objeto_que_lleva == MIRAR && fl == 50)
- hablar(TEXT308, "308.als");
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar(TEXT310, "310.als");
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar(TEXT311, "311.als");
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar(TEXT312, "312.als");
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar(TEXT313, "313.als");
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar(TEXT314, "314.als");
+ if (objeto_que_lleva == LOOK && fl == 50)
+ talk(_text[_lang][308], "308.als");
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk(_text[_lang][310], "310.als");
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk(_text[_lang][311], "311.als");
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk(_text[_lang][312], "312.als");
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk(_text[_lang][313], "313.als");
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk(_text[_lang][314], "314.als");
else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0 && strcmp(num_room, "18.alg"))
- hablar(TEXT315, "315.als");
+ talk(_text[_lang][315], "315.als");
else if (objeto_que_lleva == 13 && fl == 50)
- hablar(TEXT156, "156.als");
+ talk(_text[_lang][156], "156.als");
else if (objeto_que_lleva == 20 && fl == 50)
- hablar(TEXT163, "163.als");
+ talk(_text[_lang][163], "163.als");
else if (!strcmp(num_room, "1.alg"))
- pantalla_1(fl);
+ room_1(fl);
else if (!strcmp(num_room, "3.alg"))
- pantalla_3(fl);
+ room_3(fl);
else if (!strcmp(num_room, "4.alg"))
- pantalla_4(fl);
+ room_4(fl);
else if (!strcmp(num_room, "5.alg"))
- pantalla_5(fl);
+ room_5(fl);
else if (!strcmp(num_room, "6.alg"))
- pantalla_6(fl);
+ room_6(fl);
else if (!strcmp(num_room, "7.alg"))
- pantalla_7(fl);
+ room_7(fl);
else if (!strcmp(num_room, "8.alg"))
- pantalla_8(fl);
+ room_8(fl);
else if (!strcmp(num_room, "9.alg"))
- pantalla_9(fl);
+ room_9(fl);
else if (!strcmp(num_room, "12.alg"))
- pantalla_12(fl);
+ room_12(fl);
else if (!strcmp(num_room, "14.alg"))
- pantalla_14(fl);
+ room_14(fl);
else if (!strcmp(num_room, "15.alg"))
- pantalla_15(fl);
+ room_15(fl);
else if (!strcmp(num_room, "16.alg"))
- pantalla_16(fl);
+ room_16(fl);
else if (!strcmp(num_room, "17.alg"))
- pantalla_17(fl);
+ room_17(fl);
else if (!strcmp(num_room, "18.alg"))
- pantalla_18(fl);
+ room_18(fl);
else if (!strcmp(num_room, "19.alg"))
- pantalla_19(fl);
+ room_19(fl);
else
hay_respuesta = 0;
} else if (num_ejec == 3) {
- if (objeto_que_lleva == MIRAR && fl == 50)
- hablar(TEXT309, "309.als");
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar(TEXT310, "310.als");
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar(TEXT311, "311.als");
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar(TEXT312, "312.als");
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar(TEXT313, "313.als");
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar(TEXT314, "314.als");
+ if (objeto_que_lleva == LOOK && fl == 50)
+ talk(_text[_lang][309], "309.als");
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk(_text[_lang][310], "310.als");
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk(_text[_lang][311], "311.als");
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk(_text[_lang][312], "312.als");
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk(_text[_lang][313], "313.als");
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk(_text[_lang][314], "314.als");
else if (!strcmp(num_room, "13.alg")) {
- if (pantalla_13(fl))
+ if (room_13(fl))
return true;
} else
hay_respuesta = 0;
} else if (num_ejec == 4) {
if (!strcmp(num_room, "28.alg"))
- hablar(TEXT178, "178.als");
- else if (objeto_que_lleva == MIRAR && fl == 50)
- hablar(TEXT309, "309.als");
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar(TEXT310, "310.als");
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar(TEXT311, "311.als");
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar(TEXT312, "312.als");
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar(TEXT313, "313.als");
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar(TEXT314, "314.als");
+ talk(_text[_lang][178], "178.als");
+ else if (objeto_que_lleva == LOOK && fl == 50)
+ talk(_text[_lang][309], "309.als");
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk(_text[_lang][310], "310.als");
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk(_text[_lang][311], "311.als");
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk(_text[_lang][312], "312.als");
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk(_text[_lang][313], "313.als");
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk(_text[_lang][314], "314.als");
else if (objeto_que_lleva == 8 && fl == 50 && flags[18] == 0)
- hablar(TEXT481, "481.als");
+ talk(_text[_lang][481], "481.als");
else if (objeto_que_lleva == 9 && fl == 50)
- hablar(TEXT484, "484.als");
+ talk(_text[_lang][484], "484.als");
else if (objeto_que_lleva == 12 && fl == 50 && flags[18] == 0)
- hablar(TEXT487, "487.als");
+ talk(_text[_lang][487], "487.als");
else if (objeto_que_lleva == 20 && fl == 50)
- hablar(TEXT487, "487.als");
+ talk(_text[_lang][487], "487.als");
else if (!strcmp(num_room, "21.alg")) {
- if (pantalla_21(fl))
+ if (room_21(fl))
return true;
} else if (!strcmp(num_room, "22.alg"))
- pantalla_22(fl);
+ room_22(fl);
else if (!strcmp(num_room, "23.alg"))
- pantalla_23(fl);
+ room_23(fl);
else if (!strcmp(num_room, "24.alg"))
- pantalla_24(fl);
+ room_24(fl);
else if (!strcmp(num_room, "26.alg"))
- pantalla_26(fl);
+ room_26(fl);
else if (!strcmp(num_room, "27.alg"))
- pantalla_27(fl);
+ room_27(fl);
else if (!strcmp(num_room, "29.alg"))
- pantalla_29(fl);
+ room_29(fl);
else if (!strcmp(num_room, "30.alg"))
- pantalla_30(fl);
+ room_30(fl);
else if (!strcmp(num_room, "31.alg"))
- pantalla_31(fl);
+ room_31(fl);
else if (!strcmp(num_room, "34.alg"))
- pantalla_34(fl);
+ room_34(fl);
else if (!strcmp(num_room, "35.alg"))
- pantalla_35(fl);
+ room_35(fl);
else if (!strcmp(num_room, "44.alg"))
- pantalla_44(fl);
+ room_44(fl);
else
hay_respuesta = 0;
} else if (num_ejec == 5) {
- if (objeto_que_lleva == MIRAR && fl == 50)
- hablar("Cuanto mas me miro, mas me gusto", "54.als");
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar("y luego como me cierro", "19.als");
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar("Tendre que abrirme primero no", "19.als");
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar("Estoy bien donde estoy", "19.als");
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar("Ya me tengo", "11.als");
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar("hola yo", "16.als");
+ if (objeto_que_lleva == LOOK && fl == 50)
+ talk("Cuanto mas me miro, mas me gusto", "54.als");
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk("y luego como me cierro", "19.als");
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk("Tendre que abrirme primero no", "19.als");
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk("Estoy bien donde estoy", "19.als");
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk("Ya me tengo", "11.als");
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk("hola yo", "16.als");
else if (objeto_que_lleva == 20 && fl == 50)
- hablar(TEXT487, "487.als");
+ talk(_text[_lang][487], "487.als");
else if (!strcmp(num_room, "49.alg"))
- pantalla_49(fl);
+ room_49(fl);
else if (!strcmp(num_room, "53.alg"))
- pantalla_53(fl);
+ room_53(fl);
else if (!strcmp(num_room, "54.alg"))
- pantalla_54(fl);
+ room_54(fl);
else if (!strcmp(num_room, "55.alg"))
- pantalla_55(fl);
+ room_55(fl);
else if (!strcmp(num_room, "56.alg")) {
- if (pantalla_56(fl))
+ if (room_56(fl))
return true;
} else
hay_respuesta = 0;
} else if (num_ejec == 6) {
- if (objeto_que_lleva == MIRAR && fl == 50 && flags[0] == 1)
- hablar(TEXT308, "308.als");
- else if (objeto_que_lleva == MIRAR && fl == 50 && flags[0] == 0)
- hablar(TEXT310, "250.als" );
- else if (objeto_que_lleva == ABRIR && fl == 50)
- hablar(TEXT310, "310.als" );
- else if (objeto_que_lleva == CERRAR && fl == 50)
- hablar(TEXT311, "311.als" );
- else if (objeto_que_lleva == MOVER && fl == 50)
- hablar(TEXT312, "312.als" );
- else if (objeto_que_lleva == COGER && fl == 50)
- hablar(TEXT313, "313.als" );
- else if (objeto_que_lleva == HABLAR && fl == 50)
- hablar(TEXT314, "314.als" );
+ if (objeto_que_lleva == LOOK && fl == 50 && flags[0] == 1)
+ talk(_text[_lang][308], "308.als");
+ else if (objeto_que_lleva == LOOK && fl == 50 && flags[0] == 0)
+ talk(_text[_lang][310], "250.als" );
+ else if (objeto_que_lleva == OPEN && fl == 50)
+ talk(_text[_lang][310], "310.als" );
+ else if (objeto_que_lleva == CLOSE && fl == 50)
+ talk(_text[_lang][311], "311.als" );
+ else if (objeto_que_lleva == MOVE && fl == 50)
+ talk(_text[_lang][312], "312.als" );
+ else if (objeto_que_lleva == PICK && fl == 50)
+ talk(_text[_lang][313], "313.als" );
+ else if (objeto_que_lleva == TALK && fl == 50)
+ talk(_text[_lang][314], "314.als" );
else if (!strcmp(num_room, "102.alg"))
- pantalla_pendulo(fl);
+ room_pendulo(fl);
else if (!strcmp(num_room, "58.alg"))
- pantalla_58(fl);
+ room_58(fl);
else if (!strcmp(num_room, "59.alg"))
- pantalla_59(fl);
+ room_59(fl);
else if (!strcmp(num_room, "60.alg")) {
- if (pantalla_60(fl))
+ if (room_60(fl))
return true;
} else if (!strcmp(num_room, "61.alg"))
- pantalla_61(fl);
+ room_61(fl);
else
hay_respuesta = 0;
}
}
if (hay_respuesta == 0 && hay_nombre == 1)
- pantalla_0();
+ room_0();
else if (hay_respuesta == 0 && menu_scr == 1)
- pantalla_0();
+ room_0();
return false;
}
@@ -4666,7 +3197,7 @@ void DrasculaEngine::cursor_mesa() {
pos_cursor[4] = 40;
pos_cursor[5] = 25;
- DIBUJA_BLOQUE_CUT(pos_cursor, dir_mesa, dir_zona_pantalla);
+ copyRectClip(pos_cursor, dir_mesa, dir_zona_pantalla);
}
void DrasculaEngine::introduce_nombre() {
@@ -4677,9 +3208,9 @@ void DrasculaEngine::introduce_nombre() {
for (;;) {
buffer_teclado();
select2[v] = '-';
- DIBUJA_FONDO(115, 14, 115, 14, 176, 9, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(115, 14, 115, 14, 176, 9, dir_dibujo1, dir_zona_pantalla);
print_abc(select2, 117, 15);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
key = getscan();
delay(70);
if (key != 0) {
@@ -5038,7 +3569,7 @@ void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int a
pos_pixel[4] = 1;
pos_pixel[5] = 1;
- DIBUJA_BLOQUE_CUT(pos_pixel, dir_inicio, dir_fin);
+ copyRectClip(pos_pixel, dir_inicio, dir_fin);
pixel_x = pixel_x + suma_x;
}
@@ -5135,69 +3666,6 @@ void DrasculaEngine::cuadrante_4() {
}
}
-void DrasculaEngine::refresca_62() {
- int borracho_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
-
- DIBUJA_BLOQUE(1, 1, 0, 0, 62, 142, dir_dibujo2, dir_zona_pantalla);
-
- if (hare_y + alto_hare < 89) {
- DIBUJA_BLOQUE(205, 1, 180, 9, 82, 80, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
- }
-}
-
-void DrasculaEngine::refresca_63() {
- DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_62_antes() {
- int velas_y[] = { 158, 172, 186 };
- int cirio_x[] = { 14, 19, 24 };
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
- int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 };
- int diferencia;
-
- DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
-
- if (parpadeo == 5)
- DIBUJA_FONDO(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
-
- if (hare_x > 101 && hare_x < 155)
- DIBUJA_FONDO(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[11] == 0)
- DIBUJA_FONDO(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
- else if (flags[5] == 0)
- DIBUJA_FONDO(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- else
- DIBUJA_FONDO(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[12] == 1)
- DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 6) {
- if (flags[12] == 1) {
- frame_borracho++;
- if (frame_borracho == 8) {
- frame_borracho = 0;
- flags[12] = 0;
- }
- } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
- flags[12] = 1;
-
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- frame_piano++;
- if (frame_piano == 9)
- frame_piano = 0;
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
- }
-}
-
void DrasculaEngine::graba_partida(char nom_game[]) {
Common::OutSaveFile *out;
int l;
@@ -5302,179 +3770,6 @@ bool DrasculaEngine::comprueba_banderas_menu() {
return false;
}
-void DrasculaEngine::pantalla_0() {
- if (num_ejec == 1) {
- if (objeto_que_lleva == MIRAR)
- hablar(TEXT54, "54.als");
- else if (objeto_que_lleva == MOVER)
- hablar(TEXT19, "19.als");
- else if (objeto_que_lleva == COGER)
- hablar(TEXT11, "11.als");
- else if (objeto_que_lleva == ABRIR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT16, "16.als");
- else
- hablar(TEXT11,"11.als");
- } else if (num_ejec == 2) {
- if (objeto_que_lleva == MIRAR) {
- hablar(mirar_t[c_mirar], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVER) {
- hablar(TEXT19, "19.als");
- } else if (objeto_que_lleva == COGER) {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == ABRIR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT16, "16.als");
- else {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 3) {
- if (objeto_que_lleva == MIRAR)
- hablar(TEXT316, "316.als");
- else if (objeto_que_lleva == MOVER)
- hablar(TEXT317, "317.als");
- else if (objeto_que_lleva == COGER)
- hablar(TEXT318, "318.als");
- else if (objeto_que_lleva == ABRIR)
- hablar(TEXT319, "319.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT319, "319.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT320, "320.als");
- else
- hablar(TEXT318, "318.als");
- } else if (num_ejec == 4) {
- if (objeto_que_lleva == MIRAR) {
- hablar(mirar_t[c_mirar], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVER)
- hablar(TEXT19, "19.als");
- else if (objeto_que_lleva == COGER) {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == ABRIR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT16, "16.als");
- else {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 5) {
- if (objeto_que_lleva == MIRAR) {
- hablar(mirar_t[c_mirar], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVER)
- hablar(TEXT19, "19.als");
- else if (objeto_que_lleva == COGER) {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == ABRIR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT16, "16.als");
- else {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 6) {
- if (objeto_que_lleva == MIRAR) {
- hablar(mirar_t[c_mirar], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVER)
- hablar(TEXT19, "19.als");
- else if (objeto_que_lleva == COGER) {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == ABRIR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == CERRAR)
- hablar(TEXT9, "9.als");
- else if (objeto_que_lleva == HABLAR)
- hablar(TEXT16, "16.als");
- else {
- hablar(poder_t[c_poder], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- }
-}
-
-void DrasculaEngine::pantalla_62(int fl) {
- if (objeto_que_lleva == HABLAR && fl == 53)
- conversa("op_13.cal");
- else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 0)
- animacion_3_1();
- else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 1)
- hablar(TEXT109, "109.als");
- else if (objeto_que_lleva == HABLAR && fl == 54)
- animacion_4_1();
- else if (objeto_que_lleva == MIRAR && fl == 100)
- hablar(TEXT168, "168.als");
- else if (objeto_que_lleva == HABLAR && fl == 100)
- hablar(TEXT169, "169.als");
- else if (objeto_que_lleva == COGER && fl == 100)
- hablar(TEXT170, "170.als");
- else if (objeto_que_lleva == MIRAR && fl == 101)
- hablar(TEXT171, "171.als");
- else if (objeto_que_lleva == MIRAR && fl == 102)
- hablar(TEXT167, "167.als");
- else if (objeto_que_lleva == MIRAR && fl == 103)
- hablar(TEXT166, "166.als");
- else hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_63(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 110)
- hablar(TEXT172, "172.als");
- else if (objeto_que_lleva == MIRAR && fl == 109)
- hablar(TEXT173, "173.als");
- else if (objeto_que_lleva == MOVER && fl == 109)
- hablar(TEXT174, "174.als");
- else if (objeto_que_lleva == MIRAR && fl == 108)
- hablar(TEXT334, "334.als");
- else if (objeto_que_lleva == HABLAR && fl == 108)
- hablar(TEXT333, "333.als");
- else
- hay_respuesta = 0;
-}
-
void DrasculaEngine::conversa(const char *nom_fich) {
int h;
int juego1 = 1, juego2 = 1, juego3 = 1, juego4 = 1;
@@ -5536,13 +3831,13 @@ void DrasculaEngine::conversa(const char *nom_fich) {
ald = NULL;
if (num_ejec == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
- strcpy(frase3, TEXT405);
+ strcpy(frase3, _text[_lang][405]);
strcpy(suena3, "405.als");
respuesta3 = 31;
}
if (num_ejec == 6 && !strcmp(nom_fich, "op_12.cal") && flags[7] == 1) {
- strcpy(frase3, TEXT273);
+ strcpy(frase3, _text[_lang][273]);
strcpy(suena3, "273.als");
respuesta3 = 14;
}
@@ -5573,8 +3868,8 @@ void DrasculaEngine::conversa(const char *nom_fich) {
if (frase4[h] == (char)0xa7)
frase4[h] = ' ';
- lee_dibujos("car.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("car.alg");
+ decompressPic(dir_hare_fondo, 1);
// 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
@@ -5582,7 +3877,7 @@ void DrasculaEngine::conversa(const char *nom_fich) {
bucle_opc:
- refresca_pantalla();
+ updateRoom();
if (num_ejec == 1 || num_ejec == 4 || num_ejec == 6) {
if (music_status() == 0 && flags[11] == 0)
@@ -5629,12 +3924,12 @@ bucle_opc:
print_abc_opc(frase3, 1, 18, juego3);
print_abc_opc(frase4, 1, 26, juego4);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
if ((boton_izq == 1) && (juego1 == 2)) {
delay(100);
usado1 = 1;
- hablar(frase1, suena1);
+ talk(frase1, suena1);
if (num_ejec == 3)
grr();
else
@@ -5642,7 +3937,7 @@ bucle_opc:
} else if ((boton_izq == 1) && (juego2 == 2)) {
delay(100);
usado2 = 1;
- hablar(frase2, suena2);
+ talk(frase2, suena2);
if (num_ejec == 3)
grr();
else
@@ -5650,14 +3945,14 @@ bucle_opc:
} else if ((boton_izq == 1) && (juego3 == 2)) {
delay(100);
usado3 = 1;
- hablar(frase3, suena3);
+ talk(frase3, suena3);
if (num_ejec == 3)
grr();
else
responde(respuesta3);
} else if ((boton_izq == 1) && (juego4 == 2)) {
delay(100);
- hablar(frase4, suena4);
+ talk(frase4, suena4);
rompo_y_salgo = 1;
}
@@ -5685,83 +3980,14 @@ bucle_opc:
goto bucle_opc;
if (num_ejec == 2)
- lee_dibujos(fondo_y_menu);
+ loadPic(fondo_y_menu);
else
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
if (num_ejec != 5)
sin_verbo();
}
-void DrasculaEngine::animacion_3_1() {
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT192, "192.als");
- habla_tabernero(TEXTT1, "t1.als");
- hablar(TEXT193, "193.als");
- habla_tabernero(TEXTT2, "t2.als");
- hablar(TEXT194, "194.als");
- habla_tabernero(TEXTT3, "t3.als");
- hablar(TEXT195, "195.als");
- habla_tabernero(TEXTT4, "t4.als");
- hablar(TEXT196, "196.als");
- habla_tabernero(TEXTT5, "t5.als");
- habla_tabernero(TEXTT6, "t6.als");
- hablar(TEXT197, "197.als");
- habla_tabernero(TEXTT7, "t7.als");
- hablar(TEXT198, "198.als");
- habla_tabernero(TEXTT8, "t8.als");
- hablar(TEXT199, "199.als");
- habla_tabernero(TEXTT9, "t9.als");
- hablar(TEXT200, "200.als");
- hablar(TEXT201, "201.als");
- hablar(TEXT202, "202.als");
-
- flags[0] = 1;
-
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
-void DrasculaEngine::animacion_4_1() {
- lee_dibujos("an12.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT205,"205.als");
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(228,112, 228,112, 47,60, dir_zona_pantalla);
-
- pausa(3);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
- stopmusic();
- flags[11] = 1;
-
- habla_pianista(TEXTP1, "p1.als");
- hablar(TEXT206, "206.als");
- habla_pianista(TEXTP2, "p2.als");
- hablar(TEXT207, "207.als");
- habla_pianista(TEXTP3, "p3.als");
- hablar(TEXT208, "208.als");
- habla_pianista(TEXTP4, "p4.als");
- hablar(TEXT209, "209.als");
-
- flags[11] = 0;
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pantalla, int juego) {
int pos_texto[6];
int y_de_signos, y_de_letra, x_de_letra = 0, h, longitud;
@@ -5907,7 +4133,7 @@ void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pant
pos_texto[4] = ANCHO_LETRAS_OPC;
pos_texto[5] = ALTO_LETRAS_OPC;
- DIBUJA_BLOQUE_CUT(pos_texto, dir_hare_fondo, dir_zona_pantalla);
+ copyRectClip(pos_texto, dir_hare_fondo, dir_zona_pantalla);
x_pantalla = x_pantalla + ANCHO_LETRAS_OPC;
}
@@ -5916,244 +4142,81 @@ void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pant
void DrasculaEngine::responde(int funcion) {
if (num_ejec == 1) {
if (funcion == 10)
- habla_borracho(TEXTB1, "B1.als");
+ talk_borracho(_textb[_lang][1], "B1.als");
else if (funcion == 11)
- habla_borracho(TEXTB2, "B2.als");
+ talk_borracho(_textb[_lang][2], "B2.als");
else if (funcion == 12)
- habla_borracho(TEXTB3, "B3.als");
+ talk_borracho(_textb[_lang][3], "B3.als");
} else if (num_ejec == 2) {
if (funcion == 8)
- animacion_8_2();
+ animation_8_2();
else if (funcion == 9)
- animacion_9_2();
+ animation_9_2();
else if (funcion == 10)
- animacion_10_2();
+ animation_10_2();
else if (funcion == 15)
- animacion_15_2();
+ animation_15_2();
else if (funcion == 16)
- animacion_16_2();
+ animation_16_2();
else if (funcion == 17)
- animacion_17_2();
+ animation_17_2();
else if (funcion == 19)
- animacion_19_2();
+ animation_19_2();
else if (funcion == 20)
- animacion_20_2();
+ animation_20_2();
else if (funcion == 21)
- animacion_21_2();
+ animation_21_2();
else if (funcion == 23)
- animacion_23_2();
+ animation_23_2();
else if (funcion == 28)
- animacion_28_2();
+ animation_28_2();
else if (funcion == 29)
- animacion_29_2();
+ animation_29_2();
else if (funcion == 30)
- animacion_30_2();
+ animation_30_2();
else if (funcion == 31)
- animacion_31_2();
+ animation_31_2();
} else if (num_ejec == 4) {
if (funcion == 2)
- animacion_2_4();
+ animation_2_4();
else if (funcion == 3)
- animacion_3_4();
+ animation_3_4();
else if (funcion == 4)
- animacion_4_4();
+ animation_4_4();
} else if (num_ejec == 5) {
if (funcion == 2)
- animacion_2_5();
+ animation_2_5();
else if (funcion == 3)
- animacion_3_5();
+ animation_3_5();
else if (funcion == 6)
- animacion_6_5();
+ animation_6_5();
else if (funcion == 7)
- animacion_7_5();
+ animation_7_5();
else if (funcion == 8)
- animacion_8_5();
+ animation_8_5();
else if (funcion == 15)
- animacion_15_5();
+ animation_15_5();
else if (funcion == 16)
- animacion_16_5();
+ animation_16_5();
else if (funcion == 17)
- animacion_17_5();
+ animation_17_5();
} else if (num_ejec == 6) {
if (funcion == 2)
- animacion_2_6();
+ animation_2_6();
else if (funcion == 3)
- animacion_3_6();
+ animation_3_6();
else if (funcion == 4)
- animacion_4_6();
+ animation_4_6();
else if (funcion == 11)
- animacion_11_6();
+ animation_11_6();
else if (funcion == 12)
- animacion_12_6();
+ animation_12_6();
else if (funcion == 13)
- animacion_13_6();
+ animation_13_6();
else if (funcion == 14)
- animacion_14_6();
+ animation_14_6();
else if (funcion == 15)
- animacion_15_6();
- }
-}
-
-void DrasculaEngine::habla_pianista(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- int x_habla[4] = { 97, 145, 193, 241 };
- int cara;
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(3);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 139, 228, 112, 47, 60,
- dir_hare_dch, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 128);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_borracho(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 1, 21, 41, 61, 81, 101, 121, 141 };
- int cara;
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec == 1) {
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- }
-
- flags[13] = 1;
-
-bebiendo:
-
- if (flags[12] == 1) {
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- goto bebiendo;
- }
-
- buffer_teclado();
-
- color_abc(VERDE_OSCURO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz\n");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 181, 54);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- flags[13] = 0;
- if (num_ejec == 1) {
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- }
-
- if (num_ejec == 1) {
- if (music_status() == 0 && flags[11] == 0)
- playmusic(musica_room);
- } else if (num_ejec == 2) {
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
+ animation_15_6();
}
}
@@ -6307,1011 +4370,6 @@ void DrasculaEngine::actualiza_datos() {
}
}
-void DrasculaEngine::animacion_1_2() {
- lleva_al_hare(178, 121);
- lleva_al_hare(169, 135);
-}
-
-void DrasculaEngine::animacion_2_2() {
- int n, x=0;
-
- sentido_hare = 0;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- lee_dibujos("an2_1.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("an2_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_FONDO(1, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(201,87, 201,87, 50,52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 55, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++){
- x++;
- DIBUJA_FONDO(x, 109, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- x = 0;
- comienza_sound("s2.als");
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(201,87, 201,87, 50,52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 55, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
- x = 0;
-
- for (n = 0; n < 2; n++) {
- x++;
- DIBUJA_FONDO(x, 109, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- fin_sound();
-
- pausa (4);
-
- comienza_sound("s1.als");
- hipo_sin_nadie(12);
- fin_sound();
-}
-
-void DrasculaEngine::animacion_3_2() {
- lleva_al_hare(163, 106);
- lleva_al_hare(287, 101);
- sentido_hare = 0;
-}
-
-void DrasculaEngine::animacion_4_2() {
- stopmusic();
- flags[9] = 1;
-
- pausa(12);
- hablar(TEXTD56, "d56.als");
- pausa(8);
-
- borra_pantalla();
- lee_dibujos("ciego1.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("ciego2.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("ciego3.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("ciego4.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("ciego5.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(10);
-
- habla_ciego(TEXTD68, "d68.als", "44472225500022227555544444664447222550002222755554444466");
- pausa(5);
- habla_hacker(TEXTD57, "d57.als");
- pausa(6);
- habla_ciego(TEXTD69,"d69.als","444722255000222275555444446655033336666664464402256555005504450005446");
- pausa(4);
- habla_hacker(TEXTD58,"d58.als");
- habla_ciego(TEXTD70,"d70.als", "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046");
- delay(14);
- habla_hacker(TEXTD59,"d59.als");
- habla_ciego(TEXTD71,"d71.als", "550330227556444744446660004446655544444722255000222275555444446644444");
- habla_hacker(TEXTD60,"d60.als");
- habla_ciego(TEXTD72,"d72.als", "55033022755644455550444744400044504447222550002222755554444466000");
- habla_hacker(TEXTD61,"d61.als");
- habla_ciego(TEXTD73,"d73.als", "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446");
- habla_hacker(TEXTD62,"d62.als");
- habla_ciego(TEXTD74,"d74.als", "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666");
- habla_hacker(TEXTD63,"d63.als");
- habla_ciego(TEXTD75,"d75.als", "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555");
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- _system->delayMillis(1);
- habla_hacker(TEXTD64, "d64.als");
- habla_ciego(TEXTD76, "d76.als", "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444");
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(14);
-
- borra_pantalla();
-
- playmusic(musica_room);
- lee_dibujos("9.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("aux9.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- sin_verbo();
-
- flags[9] = 0;
- flags[4] = 1;
-}
-
-void DrasculaEngine::animacion_8_2() {
- habla_pianista(TEXTP6, "P6.als");
- hablar(TEXT358, "358.als");
- habla_pianista(TEXTP7, "P7.als");
- habla_pianista(TEXTP8, "P8.als");
-}
-
-void DrasculaEngine::animacion_9_2() {
- habla_pianista(TEXTP9, "P9.als");
- habla_pianista(TEXTP10, "P10.als");
- habla_pianista(TEXTP11, "P11.als");
-}
-
-void DrasculaEngine::animacion_10_2() {
- habla_pianista(TEXTP12, "P12.als");
- hablar(TEXT361, "361.als");
- pausa(40);
- habla_pianista(TEXTP13, "P13.als");
- hablar(TEXT362, "362.als");
- habla_pianista(TEXTP14, "P14.als");
- hablar(TEXT363, "363.als");
- habla_pianista(TEXTP15, "P15.als");
- hablar(TEXT364, "364.als");
- habla_pianista(TEXTP16, "P16.als");
-}
-
-void DrasculaEngine::animacion_14_2() {
- int n, pos_cabina[6];
- int l = 0;
-
- lee_dibujos("an14_2.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an14_1.alg");
-
- pos_cabina[0] = 150;
- pos_cabina[1] = 6;
- pos_cabina[2] = 69;
- pos_cabina[3] = -160;
- pos_cabina[4] = 158;
- pos_cabina[5] = 161;
-
- for (n = -160; n <= 0; n = n + 5 + l) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- pon_hare();
- pon_vb();
- pos_cabina[3] = n;
- DIBUJA_BLOQUE_CUT(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- l = l + 1;
- }
-
- flags[24] = 1;
-
- descomprime_dibujo(dir_dibujo1, 1);
-
- comienza_sound("s7.als");
- hipo(15);
-
- fin_sound();
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::animacion_15_2() {
- habla_borracho(TEXTB8, "B8.als");
- pausa(7);
- habla_borracho(TEXTB9, "B9.als");
- habla_borracho(TEXTB10, "B10.als");
- habla_borracho(TEXTB11, "B11.als");
-}
-
-void DrasculaEngine::animacion_16_2() {
- int l;
-
- habla_borracho(TEXTB12, "B12.als");
- hablar(TEXT371, "371.als");
-
- borra_pantalla();
-
- playmusic(32);
- int key = getscan();
- if (key != 0)
- goto asco;
-
- color_abc(VERDE_OSCURO);
-
- lee_dibujos("his1.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(HIS1, 180, 180);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- if (key != 0)
- goto asco;
-
- _system->delayMillis(4);
- key = getscan();
- if (key != 0)
- goto asco;
-
- FundeAlNegro(1);
- key = getscan();
- if (key != 0)
- goto asco;
-
- borra_pantalla();
- lee_dibujos("his2.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(HIS2, 180, 180);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- if (key != 0)
- goto asco;
-
- _system->delayMillis(4);
- key = getscan();
- if (key != 0)
- goto asco;
-
- FundeAlNegro(1);
- key = getscan();
- if (key != 0)
- goto asco;
-
- borra_pantalla();
- lee_dibujos("his3.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(HIS3, 180, 180);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- if (key != 0)
- goto asco;
-
- _system->delayMillis(4);
- key = getscan();
- if (key != 0)
- goto asco;
-
- FundeAlNegro(1);
-
- borra_pantalla();
- lee_dibujos("his4_1.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("his4_2.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo3, dir_zona_pantalla);
- centra_texto(HIS1, 180, 180);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- if (key != 0)
- goto asco;
-
- _system->delayMillis(4);
- key = getscan();
- if (key != 0)
- goto asco;
-
- for (l = 1; l < 200; l++) {
- DIBUJA_FONDO(0, 0, 0, l, 320, 200 - l, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(0, 200 - l, 0, 0, 320, l, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- if (key != 0)
- goto asco;
- }
-
- pausa(5);
- FundeAlNegro(2);
- borra_pantalla();
-
-asco:
- lee_dibujos(pantalla_disco);
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos(num_room);
- descomprime_dibujo(dir_dibujo1, MEDIA);
- Negro();
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(0);
- if (musica_room != 0)
- playmusic(musica_room);
- else
- stopmusic();
-}
-
-void DrasculaEngine::animacion_17_2() {
- habla_borracho(TEXTB13, "B13.als");
- habla_borracho(TEXTB14, "B14.als");
- flags[40] = 1;
-}
-
-void DrasculaEngine::animacion_19_2() {
- habla_vbpuerta(TEXTVB5, "VB5.als");
-}
-
-void DrasculaEngine::animacion_20_2() {
- habla_vbpuerta(TEXTVB7, "VB7.als");
- habla_vbpuerta(TEXTVB8, "VB8.als");
- hablar(TEXT383, "383.als");
- habla_vbpuerta(TEXTVB9, "VB9.als");
- hablar(TEXT384, "384.als");
- habla_vbpuerta(TEXTVB10, "VB10.als");
- hablar(TEXT385, "385.als");
- habla_vbpuerta(TEXTVB11, "VB11.als");
- if (flags[23] == 0) {
- hablar(TEXT350, "350.als");
- habla_vbpuerta(TEXTVB57, "VB57.als");
- } else {
- hablar(TEXT386, "386.als");
- habla_vbpuerta(TEXTVB12, "VB12.als");
- flags[18] = 0;
- flags[14] = 1;
- abre_puerta(15, 1);
- sal_de_la_habitacion(1);
- animacion_23_2();
- sal_de_la_habitacion(0);
- flags[21] = 0;
- flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
-
- rompo_y_salgo = 1;
- }
-}
-
-void DrasculaEngine::animacion_21_2() {
- habla_vbpuerta(TEXTVB6, "VB6.als");
-}
-
-void DrasculaEngine::animacion_23_2() {
- lee_dibujos("an24.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- flags[21] = 1;
-
- if (flags[25] == 0) {
- habla_vb(TEXTVB13, "VB13.als");
- habla_vb(TEXTVB14, "VB14.als");
- pausa(10);
- hablar(TEXT387, "387.als");
- }
-
- habla_vb(TEXTVB15, "VB15.als");
- lleva_vb(42);
- sentido_vb = 1;
- habla_vb(TEXTVB16, "VB16.als");
- sentido_vb = 2;
- lleva_al_hare(157, 147);
- lleva_al_hare(131, 149);
- sentido_hare = 0;
- animacion_14_2();
- if (flags[25] == 0)
- habla_vb(TEXTVB17, "VB17.als");
- pausa(8);
- sentido_vb = 1;
- habla_vb(TEXTVB18, "VB18.als");
-
- if (flags[29] == 0)
- animacion_23_anexo();
- else
- animacion_23_anexo2();
-
- sentido_vb = 2;
- animacion_25_2();
- lleva_vb(99);
-
- if (flags[29] == 0) {
- habla_vb(TEXTVB19, "VB19.als");
- if (flags[25] == 0) {
- habla_vb(TEXTVB20,"VB20.als");
- if (resta_objeto(7) == 0)
- flags[30] = 1;
- if (resta_objeto(18) == 0)
- flags[31] = 1;
- if (resta_objeto(19) == 0)
- flags[32] = 1;
- }
- habla_vb(TEXTVB21, "VB21.als");
- } else
- animacion_27_2();
-
- flags[25] = 1;
- rompo_y_salgo = 1;
-}
-
-void DrasculaEngine::animacion_23_anexo() {
- int n, p_x = hare_x + 2, p_y = hare_y - 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};
-
- lee_dibujos("an23.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 34; n++) {
- DIBUJA_BLOQUE(p_x, p_y, p_x, p_y, 36, 74, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x[n], y[n], p_x, p_y, 36, 74, dir_hare_fondo, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(p_x, p_y, p_x, p_y, 36, 74, dir_zona_pantalla);
- pausa(5);
- }
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::animacion_23_anexo2() {
- int n, p_x = hare_x + 4, p_y = hare_y;
- 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};
-
- pausa(50);
-
- lee_dibujos("an23_2.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 14; n++) {
- DIBUJA_BLOQUE(p_x, p_y, p_x, p_y, 33, 71, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x[n], y[n], p_x, p_y, 33, 71, dir_hare_fondo, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(p_x,p_y, p_x,p_y, 33,71, dir_zona_pantalla);
- pausa(5);
- }
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo,1);
-}
-
-void DrasculaEngine::animacion_25_2() {
- int n, pos_cabina[6];
-
- lee_dibujos("an14_2.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("18.alg");
- descomprime_dibujo(dir_dibujo1, 1);
-
- pos_cabina[0] = 150;
- pos_cabina[1] = 6;
- pos_cabina[2] = 69;
- pos_cabina[3] = 0;
- pos_cabina[4] = 158;
- pos_cabina[5] = 161;
-
- flags[24] = 0;
-
- comienza_sound("s6.als");
-
- for (n = 0; n >= -160; n = n - 8) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
- pon_hare();
- pon_vb();
-
- pos_cabina[3] = n;
-
- DIBUJA_BLOQUE_CUT(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
-
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- fin_sound();
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::animacion_27_2() {
- flags[22] = 1;
-
- sin_verbo();
- resta_objeto(23);
- suma_objeto(11);
-
- habla_vb(TEXTVB23, "VB23.als");
- habla_vb(TEXTVB24, "VB24.als");
- if (flags[30] == 1)
- suma_objeto(7);
- if (flags[31] == 1)
- suma_objeto(18);
- if (flags[32] == 1)
- suma_objeto(19);
- habla_vb(TEXTVB25,"VB25.als");
- habla_vb(TEXTVB26,"VB26.als");
-}
-
-void DrasculaEngine::animacion_28_2() {
- habla_vb(TEXTVB27, "VB27.als");
- habla_vb(TEXTVB28, "VB28.als");
- habla_vb(TEXTVB29, "VB29.als");
- habla_vb(TEXTVB30, "VB30.als");
-}
-
-void DrasculaEngine::animacion_29_2() {
- if (flags[33] == 0) {
- habla_vb(TEXTVB32, "VB32.als");
- hablar(TEXT398, "398.als");
- habla_vb(TEXTVB33, "VB33.als");
- hablar(TEXT399, "399.als");
- habla_vb(TEXTVB34, "VB34.als");
- habla_vb(TEXTVB35, "VB35.als");
- hablar(TEXT400, "400.als");
- habla_vb(TEXTVB36, "VB36.als");
- habla_vb(TEXTVB37, "VB37.als");
- hablar(TEXT386, "386.als");
- habla_vb(TEXTVB38, "VB38.als");
- habla_vb(TEXTVB39, "VB39.als");
- hablar(TEXT401, "401.als");
- habla_vb(TEXTVB40, "VB40.als");
- habla_vb(TEXTVB41, "VB41.als");
- flags[33] = 1;
- } else
- habla_vb(TEXTVB43, "VB43.als");
-
- hablar(TEXT402, "402.als");
- habla_vb(TEXTVB42, "VB42.als");
-
- if (flags[38] == 0) {
- hablar(TEXT403, "403.als");
- rompo_y_salgo = 1;
- } else
- hablar(TEXT386, "386.als");
-}
-
-void DrasculaEngine::animacion_30_2() {
- habla_vb(TEXTVB31, "VB31.als");
- hablar(TEXT396, "396.als");
-}
-
-void DrasculaEngine::animacion_31_2() {
- habla_vb(TEXTVB44, "VB44.als");
- lleva_vb(-50);
- pausa(15);
- lleva_al_hare(159, 140);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- sentido_hare = 2;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(78);
- sentido_hare = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(22);
- hablar(TEXT406, "406.als");
- lleva_vb(98);
- habla_vb(TEXTVB45, "VB45.als");
- habla_vb(TEXTVB46, "VB46.als");
- habla_vb(TEXTVB47, "VB47.als");
- hablar(TEXT407, "407.als");
- habla_vb(TEXTVB48, "VB48.als");
- habla_vb(TEXTVB49, "VB49.als");
- hablar(TEXT408, "408.als");
- habla_vb(TEXTVB50, "VB50.als");
- habla_vb(TEXTVB51, "VB51.als");
- hablar(TEXT409, "409.als");
- habla_vb(TEXTVB52, "VB52.als");
- habla_vb(TEXTVB53, "VB53.als");
- pausa(12);
- habla_vb(TEXTVB54, "VB54.als");
- habla_vb(TEXTVB55, "VB55.als");
- hablar(TEXT410, "410.als");
- habla_vb(TEXTVB56, "VB56.als");
-
- rompo_y_salgo = 1;
-
- flags[38] = 0;
- flags[36] = 1;
- sin_verbo();
- resta_objeto(8);
- resta_objeto(13);
- resta_objeto(15);
- resta_objeto(16);
- resta_objeto(17);
- suma_objeto(20);
-}
-
-void DrasculaEngine::animacion_35_2() {
- int n, x = 0;
-
- lleva_al_hare(96, 165);
- lleva_al_hare(79, 165);
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- lee_dibujos("an35_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an35_2.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(70,90, 70,90, 46,80,dir_zona_pantalla);
- x = x + 46;
- pausa(3);
- }
-
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
- x = x + 46;
- pausa(3);
- }
-
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
-
- x = x + 46;
-
- pausa(3);
- }
-
- x = 0;
- for (n = 0; n < 2; n++) {
- x++;
- DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(70, 90, 70,90, 46, 80,dir_zona_pantalla);
- x = x + 46;
- pausa(3);
- }
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(19);
-
- comienza_sound("s1.als");
- hipo_sin_nadie(18);
- fin_sound();
-
- pausa(10);
-
- FundeAlNegro(2);
-}
-
-void DrasculaEngine::habla_vb(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[6] = {1, 27, 53, 79, 105, 131};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(VON_BRAUN);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- DIBUJA_FONDO(vb_x + 5, 64, ANCHOBJ + 1, 0, 25, 27, dir_dibujo1, dir_dibujo3);
-
-bucless:
-
- if (sentido_vb == 1) {
- cara = _rnd->getRandomNumber(5);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- pon_hare();
- pon_vb();
-
- DIBUJA_FONDO(ANCHOBJ + 1, 0, vb_x + 5, 64, 25, 27, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_BLOQUE(x_habla[cara], 34, vb_x + 5, 64, 25, 27, dir_hare_frente, dir_zona_pantalla);
- actualiza_refresco();
- }
-
- if (con_voces == 0)
- centra_texto(dicho, vb_x, 66);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
-}
-
-void DrasculaEngine::habla_vbpuerta(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(VON_BRAUN);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- refresca_pantalla();
- if (con_voces == 0)
- centra_texto(dicho, 150, 80);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
-}
-
-void DrasculaEngine::habla_ciego(const char *dicho, const char *filename, const char *sincronia) {
- byte *num_cara;
- int p = 0;
- int pos_ciego[6];
- int cara = 0;
-
- int longitud;
- longitud = strlen(dicho);
-
- buffer_teclado();
-
- color_abc(VON_BRAUN);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- pos_ciego[1] = 2;
- pos_ciego[2] = 73;
- pos_ciego[3] = 1;
- pos_ciego[4] = 126;
- pos_ciego[5] = 149;
-
-bucless:
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pos_ciego[5] = 149;
- char c = toupper(sincronia[p]);
- if (c == '0')
- cara = 0;
- if (c == '1')
- cara = 1;
- if (c == '2')
- cara = 2;
- if (c == '3')
- cara = 3;
- if (c == '4')
- cara = 4;
- if (c == '5')
- cara = 5;
- if (c == '6')
- cara = 6;
- if (c == '7')
- cara = 7;
-
- if (cara == 0 || cara == 2 || cara == 4 || cara == 6)
- pos_ciego[0] = 1;
- else
- pos_ciego[0] = 132;
-
- if (cara == 0)
- num_cara = dir_dibujo3;
- else if (cara == 1)
- num_cara = dir_dibujo3;
- else if (cara == 2)
- num_cara = dir_hare_dch;
- else if (cara == 3)
- num_cara = dir_hare_dch;
- else if (cara == 4)
- num_cara = dir_hare_fondo;
- else if (cara == 5)
- num_cara = dir_hare_fondo;
- else {
- num_cara = dir_hare_frente;
- pos_ciego[5] = 146;
- }
-
- DIBUJA_BLOQUE_CUT( pos_ciego, num_cara, dir_zona_pantalla);
-
- if (con_voces == 0)
- centra_texto(dicho, 310, 71);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(2);
- p++;
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-}
-
-void DrasculaEngine::habla_hacker(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
- if (con_voces == 0)
- centra_texto(dicho, 156, 170);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- key = 0;
-}
-
void DrasculaEngine::anda_pabajo() {
direccion_hare = 4;
sentido_hare = 3;
@@ -7357,7 +4415,7 @@ void DrasculaEngine::pon_vb() {
frame_vb = 1;
}
- DIBUJA_BLOQUE_CUT(pos_vb, dir_hare_frente, dir_zona_pantalla);
+ copyRectClip(pos_vb, dir_hare_frente, dir_zona_pantalla);
}
void DrasculaEngine::lleva_vb(int punto_x) {
@@ -7369,8 +4427,8 @@ void DrasculaEngine::lleva_vb(int punto_x) {
vb_se_mueve = 1;
for (;;) {
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
if (sentido_vb == 0) {
vb_x = vb_x - 5;
if (vb_x <= punto_x)
@@ -7380,7 +4438,7 @@ void DrasculaEngine::lleva_vb(int punto_x) {
if (vb_x >= punto_x)
break;
}
- pausa(5);
+ pause(5);
}
vb_se_mueve = 0;
@@ -7394,11 +4452,11 @@ void DrasculaEngine::hipo_sin_nadie(int contador){
comienza:
contador--;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
if (num_ejec == 3)
- VUELCA_PANTALLA(0, 0, 0, y, 320, 200, dir_zona_pantalla);
+ updateScreen(0, 0, 0, y, 320, 200, dir_zona_pantalla);
else
- VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla);
+ updateScreen(0, 1, 0, y, 320, 198, dir_zona_pantalla);
if (sentido == 0)
y++;
@@ -7419,8 +4477,8 @@ comienza:
if (contador > 0)
goto comienza;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
}
void DrasculaEngine::abre_puerta(int nflag, int n_puerta) {
@@ -7437,8 +4495,8 @@ void DrasculaEngine::abre_puerta(int nflag, int n_puerta) {
if (n_puerta != NO_PUERTA)
puertas_cerradas(n_puerta);
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
fin_sound();
sin_verbo();
}
@@ -7461,247 +4519,6 @@ void DrasculaEngine::mapa() {
hay_nombre = 0;
}
-void DrasculaEngine::refresca_1_antes() {
- int cambio_col_antes = cambio_de_color;
-
- if (hare_x > 98 && hare_x < 153)
- cambio_de_color = 1;
- else
- cambio_de_color = 0;
-
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
-
- if (flags[8] == 0)
- DIBUJA_FONDO(2, 158, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_2(){
- int pos_murci[6];
- int diferencia;
- int murci_x[] = {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,
- 30, 88, 146, 204, 262,
- 88, 146, 204, 262,
- 88, 146, 204, 262};
-
- int murci_y[] = {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,
- 78, 78, 78, 78, 78,
- 41, 41, 41, 41,
- 4, 4, 4, 4};
-
- if (frame_murcielago == 41)
- frame_murcielago = 0;
-
- pos_murci[0] = murci_x[frame_murcielago];
- pos_murci[1] = murci_y[frame_murcielago];
-
- if (frame_murcielago < 22) {
- pos_murci[4] = 37;
- pos_murci[5] = 21;
- } else if (frame_murcielago > 27) {
- pos_murci[4] = 57;
- pos_murci[5] = 36;
- } else {
- pos_murci[4] = 47;
- pos_murci[5] = 22;
- }
-
- pos_murci[2] = 239;
- pos_murci[3] = 19;
-
- DIBUJA_BLOQUE_CUT(pos_murci, dir_dibujo3, dir_zona_pantalla);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 6) {
- frame_murcielago++;
- conta_ciego_vez = vez();
- }
-
- DIBUJA_BLOQUE(29, 37, 58, 114, 57, 39, dir_dibujo3, dir_zona_pantalla);
- mapa();
-}
-
-void DrasculaEngine::refresca_3_antes() {
- if (flags[3] == 1)
- DIBUJA_FONDO(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_3() {
- if (hare_y + alto_hare < 118)
- DIBUJA_BLOQUE(129, 110, 194, 36, 126, 88, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_BLOQUE(47, 57, 277, 143, 43, 50, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_4() {
- int cambio_col_antes = cambio_de_color;
- if (hare_x > 190)
- cambio_de_color = 1;
- else
- cambio_de_color = 0;
-
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
-}
-
-void DrasculaEngine::refresca_5() {
- DIBUJA_BLOQUE(114, 130, 211, 87, 109, 69, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_15() {
- DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_17() {
- DIBUJA_BLOQUE(48, 135, 78, 139, 80, 30, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_18() {
- if (flags[24] == 1)
- DIBUJA_BLOQUE(177, 1, 69, 29, 142, 130, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_BLOQUE(105, 132, 109, 108, 196, 65, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_5_antes(){
- if (flags[8] == 0)
- DIBUJA_FONDO(256, 152, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_6_antes() {
- int cambio_col_antes = cambio_de_color;
-
- 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))
- cambio_de_color = 0;
- else
- cambio_de_color = 1;
-
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
-
- if (flags[1] == 0)
- DIBUJA_FONDO(97, 117, 34, 148, 36, 31, dir_dibujo3, dir_zona_pantalla);
- if (flags[0] == 0)
- DIBUJA_FONDO(3, 103, 185, 69, 23, 76, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0)
- DIBUJA_FONDO(28, 100, 219, 72, 64, 97, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_7_antes() {
- if (flags[35] == 0)
- DIBUJA_FONDO(1, 72, 158, 162, 19, 12, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_9_antes() {
- int ciego_x[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
- int ciego_y[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
- int diferencia;
-
- DIBUJA_BLOQUE(ciego_x[frame_ciego], ciego_y[frame_ciego], 122, 57, 41, 72, dir_dibujo3, dir_zona_pantalla);
- if (flags[9] == 0) {
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 11) {
- frame_ciego++;
- conta_ciego_vez = vez();
- }
- if (frame_ciego == 9)
- frame_ciego = 0;
- } else
- frame_ciego = 3;
-}
-
-void DrasculaEngine::refresca_12_antes() {
- if (flags[16] == 0)
- DIBUJA_FONDO(1, 131, 106, 117, 55, 68, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_14_antes() {
- int velas_y[] = {158, 172, 186};
- int cirio_x[] = {14, 19, 24};
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
- int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1};
- int diferencia;
-
- DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
-
- if (parpadeo == 5)
- DIBUJA_FONDO(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
- if (hare_x > 101 && hare_x < 155)
- DIBUJA_FONDO(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
- if (flags[11] == 0)
- DIBUJA_FONDO(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
- else if (flags[5] == 0)
- DIBUJA_FONDO(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- else
- DIBUJA_FONDO(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[12] == 1)
- DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 6) {
- if (flags[12] == 1) {
- frame_borracho++;
- if (frame_borracho == 8) {
- frame_borracho = 0;
- flags[12] = 0;
- }
- } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
- flags[12] = 1;
-
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- frame_piano++;
- if (frame_piano == 9)
- frame_piano = 0;
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
- }
-}
-
-void DrasculaEngine::refresca_16_antes() {
- if (flags[17] == 0)
- DIBUJA_FONDO(1, 103, 24, 72, 33, 95, dir_dibujo3, dir_zona_pantalla);
- if (flags[19] == 1)
- DIBUJA_FONDO(37, 151, 224, 115, 56, 47, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_17_antes() {
- if (flags[15] == 1)
- DIBUJA_FONDO(1, 135, 108, 65, 44, 63, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_18_antes() {
- int diferencia;
- int ronquido_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95};
- int ronquido_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18};
-
- if (flags[21] == 0) {
- DIBUJA_FONDO(1, 69, 120, 58, 56, 61, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(ronquido_x[frame_ronquido], ronquido_y[frame_ronquido], 124, 59, 40, 37, dir_dibujo3, dir_zona_pantalla);
- } else
- pon_vb();
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 9) {
- frame_ronquido++;
- if (frame_ronquido == 16)
- frame_ronquido = 0;
- conta_ciego_vez = vez();
- }
-}
-
void DrasculaEngine::grr() {
int longitud;
longitud = 30;
@@ -7721,459 +4538,15 @@ void DrasculaEngine::grr() {
ctvd_output(sku);
}
- refresca_pantalla();
- DIBUJA_FONDO(253, 110, 150, 65, 20, 30, dir_dibujo3, dir_zona_pantalla);
+ updateRoom();
+ copyBackground(253, 110, 150, 65, 20, 30, dir_dibujo3, dir_zona_pantalla);
if (con_voces == 0)
centra_texto(".groaaarrrrgghhh!", 153, 65);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
-bucless:
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-bool DrasculaEngine::pantalla_13(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 51) {
- hablar(TEXT411, "411.als");
- sentido_hare = 3;
- hablar(TEXT412, "412.als");
- strcpy(nombre_obj[1], "yoda");
- } else if (objeto_que_lleva == HABLAR && fl == 51)
- conversa("op_7.cal");
- else if (objeto_que_lleva == 19 && fl == 51)
- animacion_1_3();
- else if (objeto_que_lleva == 9 && fl == 51) {
- animacion_2_3();
- return true;
- } else
- hay_respuesta = 0;
- return false;
-}
-
-void DrasculaEngine::refresca_13() {
- if (hare_x > 55 && flags[3] == 0)
- animacion_6_3();
- if (flags[1] == 0)
- DIBUJA_BLOQUE(185, 110, 121, 65, 67, 88, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0)
- DIBUJA_BLOQUE(185, 21, 121, 63, 67, 88, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_BLOQUE(3, 127, 99, 102, 181, 71, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_20() {
- DIBUJA_BLOQUE(1, 137, 106, 121, 213, 61, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::animacion_1_3() {
- hablar(TEXT413, "413.als");
- grr();
- pausa(50);
- hablar(TEXT414, "414.als");
-}
-
-void DrasculaEngine::animacion_2_3() {
- flags[0] = 1;
- playmusic(13);
- animacion_3_3();
- playmusic(13);
- animacion_4_3();
- flags[1] = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(120, 0, 120, 0, 200, 200, dir_zona_pantalla);
- animacion_5_3();
- flags[0] = 0;
- flags[1] = 1;
-
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- lleva_al_hare(332, 127);
-}
-
-void DrasculaEngine::animacion_3_3() {
- int n, x = 0;
- int px = hare_x - 20, py = hare_y - 1;
-
- lee_dibujos("an2y_1.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("an2y_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an2y_3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-}
-
-void DrasculaEngine::animacion_4_3() {
- int n, x = 0;
- int px = 120, py = 63;
-
- lee_dibujos("any_1.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("any_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("any_3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++){
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pausa(3);
- }
-}
-
-void DrasculaEngine::animacion_5_3() {
- int n, x = 0;
- int px = hare_x - 20, py = hare_y - 1;
-
- lee_dibujos("an3y_1.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("an3y_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an3y_3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(px,py, px,py, 71,72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pausa(3);
- }
-}
-
-void DrasculaEngine::animacion_6_3() {
- int frame = 0, px = 112, py = 62;
- int yoda_x[] = { 3 ,82, 161, 240, 3, 82 };
- int yoda_y[] = { 3, 3, 3, 3, 94, 94 };
-
- hare_se_mueve = 0;
- flags[3] = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- flags[1] = 0;
-
- lee_dibujos("an4y.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- for (frame = 0; frame < 6; frame++) {
- pausa(3);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(yoda_x[frame], yoda_y[frame], px, py, 78, 90, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(px, py, px, py, 78, 90, dir_zona_pantalla);
- }
-
- flags[2] = 1;
-
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::animacion_rayo() {
- lee_dibujos("anr_1.alg");
- descomprime_dibujo(dir_hare_frente, MEDIA);
- lee_dibujos("anr_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("anr_3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("anr_4.alg");
- descomprime_dibujo(dir_dibujo1, 1);
- lee_dibujos("anr_5.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_frente);
-
- pausa(50);
-
- comienza_sound("s5.als");
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_dch);
- pausa(3);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_fondo);
- pausa(3);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1);
- pausa(3);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_fondo);
- pausa(3);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo3);
- pausa(3);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_frente);
- fin_sound();
-}
-
-void DrasculaEngine::animacion_2_4() {
- habla_igor_sentado(TEXTI16, "I16.als");
- hablar(TEXT278, "278.als");
- habla_igor_sentado(TEXTI17, "I17.als");
- hablar(TEXT279, "279.als");
- habla_igor_sentado(TEXTI18, "I18.als");
-}
-
-void DrasculaEngine::animacion_3_4() {
- habla_igor_sentado(TEXTI19, "I19.als");
- habla_igor_sentado(TEXTI20, "I20.als");
- hablar(TEXT281, "281.als");
-}
-
-void DrasculaEngine::animacion_4_4() {
- hablar(TEXT287, "287.als");
- habla_igor_sentado(TEXTI21, "I21.als");
- hablar(TEXT284, "284.als");
- habla_igor_sentado(TEXTI22, "I22.als");
- hablar(TEXT285, "285.als");
- habla_igor_sentado(TEXTI23, "I23.als");
-}
-
-void DrasculaEngine::habla_igor_sentado(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[4] = { 80, 102, 124, 146 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
bucless:
-
- cara = _rnd->getRandomNumber(3);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 109, 207, 92, 21, 23, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 102);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
int key = getscan();
if (key != 0)
ctvd_stop();
@@ -8190,3828 +4563,39 @@ bucless:
goto bucless;
}
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::animacion_7_4() {
- Negro();
- hablar(TEXT427, "427.als");
- FundeDelNegro(1);
- resta_objeto(8);
- resta_objeto(10);
- resta_objeto(12);
- resta_objeto(16);
- suma_objeto(17);
- flags[30] = 0;
- flags[29] = 0;
-}
-
-void DrasculaEngine::animacion_1_5() {
- if (flags[0] == 0) {
- hablar(TEXT430, "430.als");
- habla_bj(TEXTBJ16, "BJ16.als");
- habla_bj(TEXTBJ17, "BJ17.als");
- habla_bj(TEXTBJ18, "BJ18.als");
- hablar(TEXT217, "217.als");
- habla_bj(TEXTBJ19, "BJ19.als");
- hablar(TEXT229, "229.als");
- pausa(5);
- lleva_al_hare(114, 170);
- sentido_hare = 3;
- hablar(TEXT431, "431.als");
- habla_bj(TEXTBJ20, "BJ20.als");
- sentido_hare = 2;
- pausa(4);
- hablar(TEXT438, "438.als");
- sitio_x = 120;
- sitio_y = 157;
- anda_a_objeto = 1;
- sentido_final = 1;
- empieza_andar();
- habla_bj(TEXTBJ21, "BJ21.als");
-
- for (;;) {
- if (hare_se_mueve == 0)
- break;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- sentido_hare = 1;
- hablar(TEXT229, "229.als");
- flags[0] = 1;
- }
-
- sentido_hare = 1;
- conversa("op_8.cal");
-}
-
-void DrasculaEngine::animacion_2_5() {
- habla_bj(TEXTBJ22, "BJ22.als");
-}
-
-void DrasculaEngine::animacion_3_5() {
- habla_bj(TEXTBJ23, "BJ23.als");
- agarra_objeto(10);
- rompo_y_salgo = 1;
-}
-
-void DrasculaEngine::animacion_4_5() {
- flags[7] = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT228, "228.als");
- habla_lobo(TEXTL1, "L1.als");
- habla_lobo(TEXTL2, "L2.als");
- pausa(23);
- hablar(TEXT229, "229.als");
- habla_lobo(TEXTL3, "L3.als");
- habla_lobo(TEXTL4, "L4.als");
- hablar(TEXT230, "230.als");
- habla_lobo(TEXTL5, "L5.als");
- hablar(TEXT231, "231.als");
- habla_lobo(TEXTL6, "L6.als");
- habla_lobo(TEXTL7, "L7.als");
- pausa(33);
- hablar(TEXT232, "232.als");
- habla_lobo(TEXTL8, "L8.als");
-}
-
-void DrasculaEngine::animacion_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 pixel_x = hare_x - 53, pixel_y = hare_y - 9;
-
- sin_verbo();
- resta_objeto(8);
-
- lleva_al_hare(hare_x - 19, hare_y + alto_hare);
- sentido_hare = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- lee_dibujos("3an5_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("3an5_2.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- for (frame = 0; frame < 9; frame++) {
- pausa(3);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(pixel_x, pixel_y, pixel_x,pixel_y, 97,64, dir_zona_pantalla);
- }
-
- DIBUJA_FONDO(52, 161, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(198, 81, 198, 81, 26, 24, dir_zona_pantalla);
-
- for (frame = 0; frame < 9; frame++) {
- pausa(3);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(pixel_x, pixel_y, pixel_x,pixel_y, 97, 64, dir_zona_pantalla);
- }
-
- flags[6] = 1;
- actualiza_datos();
- pausa(12);
-
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- for (h = 0; h < (200 - 18); h++)
- DIBUJA_FONDO(0, 53, 0, h, 320, 19, dir_hare_frente, dir_zona_pantalla);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- lee_dibujos("101.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("3an5_3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("3an5_4.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1);
- pausa(9);
- for (frame = 0; frame < 5; frame++) {
- pausa(3);
- DIBUJA_FONDO(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
- }
- for (frame = 0; frame < 5; frame++) {
- pausa(3);
- DIBUJA_FONDO(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
- }
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1);
-
- comienza_sound("s1.als");
- fin_sound();
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- borra_pantalla();
-
- lee_dibujos("49.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
-}
-
-void DrasculaEngine::animacion_6_5() {
- habla_lobo(TEXTL9, "L9.als");
- hablar(TEXT234, "234.als");
-}
-
-void DrasculaEngine::animacion_7_5() {
- habla_lobo(TEXTL10, "L10.als");
- hablar(TEXT236, "236.als");
- habla_lobo(TEXTL11, "L11.als");
- habla_lobo(TEXTL12, "L12.als");
- habla_lobo(TEXTL13, "L13.als");
- pausa(34);
- habla_lobo(TEXTL14, "L14.als");
-}
-
-void DrasculaEngine::animacion_8_5() {
- habla_lobo(TEXTL15, "L15.als");
- hablar(TEXT238, "238.als");
- habla_lobo(TEXTL16, "L16.als");
-}
-
-void DrasculaEngine::animacion_9_5() {
- flags[4] = 1;
- hablar(TEXT401, "401.als");
- sin_verbo();
- resta_objeto(15);
-}
-
-void DrasculaEngine::animacion_10_5() {
- flags[3] = 1;
- hablar(TEXT401, "401.als");
- sin_verbo();
- resta_objeto(12);
-}
-
-void DrasculaEngine::animacion_11_5() {
- flags[9] = 1;
- if (flags[2] == 1 && flags[3] == 1 && flags[4] == 1)
- animacion_12_5();
- else {
- flags[9] = 0;
- hablar(TEXT33, "33.als");
- }
-}
-
-void DrasculaEngine::animacion_12_5() {
- DacPalette256 palFondo1;
- DacPalette256 palFondo2;
- DacPalette256 palFondo3;
-
- int frame;
- const int rayo_x[] = {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, componente;
- char fundido;
-
- playmusic(26);
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(27);
- anima("rayo1.bin", 23);
- comienza_sound("s5.als");
- anima("rayo2.bin", 17);
- sentido_hare = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- hare_oscuro();
-
- for (color = 0; color < 255; color++)
- for (componente = 0; componente < 3; componente++) {
- palFondo1[color][componente] = palJuego[color][componente];
- palFondo2[color][componente] = palJuego[color][componente];
- palFondo3[color][componente] = palJuego[color][componente];
- }
-
- for (fundido = 1; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo1[color][componente] = LimitaVGA(palFondo1[color][componente] - 8 + fundido);
- }
-
- for (fundido = 2; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo2[color][componente] = LimitaVGA(palFondo2[color][componente] - 8 + fundido);
- }
-
- for (fundido = 3; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo3[color][componente] = LimitaVGA(palFondo3[color][componente] - 8 + fundido);
- }
-
- lee_dibujos("3an11_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (frame = 0; frame < 8; frame++) {
- if (frame == 2 || frame == 4 || frame == 8 || frame==10)
- setvgapalette256((byte *)&palFondo1);
- else if (frame == 1 || frame == 5 || frame == 7 || frame == 9)
- setvgapalette256((byte *)&palFondo2);
- else
- setvgapalette256((byte *)&palFondo3);
-
- pausa(4);
- refresca_pantalla();
- DIBUJA_BLOQUE(rayo_x[frame], 1, 41, 0, 44, 44, dir_hare_fondo, dir_zona_pantalla);
- DIBUJA_BLOQUE(frusky_x[frame], 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- fin_sound_corte();
-
- for (frame = 0; frame < 15; frame++) {
- if (frame == 2 || frame == 4 || frame == 7 || frame == 9)
- setvgapalette256((byte *)&palFondo1);
- else if (frame == 1 || frame == 5)
- setvgapalette256((byte *)&palJuego);
- else
- setvgapalette256((byte *)&palFondo2);
-
- pausa(4);
- refresca_pantalla();
- DIBUJA_BLOQUE(elfrusky_x[frame], 47, 192, 39, 66, 106, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- anima("frel.bin", 16);
- borra_pantalla();
- hare_claro();
- ActualizaPaleta();
-
- flags[1] = 1;
-
- animacion_13_5();
- comienza_sound("s1.als");
- hipo(12);
- fin_sound();
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- lleva_al_hare(40, 169);
- lleva_al_hare(-14, 175);
-
- rompo = 1;
- musica_antes = musica_room;
- hare_se_ve = 1;
- borra_pantalla();
- sentido_hare = 1;
- hare_se_mueve = 0;
- hare_x = -1;
- obj_saliendo = 104;
- sin_verbo();
- carga_escoba("57.ald");
-}
-
-void DrasculaEngine::animacion_13_5() {
- int frank_x = 199;
- int frame = 0;
- int frus_x[] = {1, 46, 91, 136, 181, 226, 271};
- int frus_y[] = {1, 1, 1, 1, 1, 1, 1, 89};
- int pos_frusky[6];
-
- lee_dibujos("auxfr.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- pos_frusky[3] = 81;
- pos_frusky[4] = 44;
- pos_frusky[5] = 87;
- pos_frusky[0] = 1;
- pos_frusky[1] = 1;
- pos_frusky[2] = frank_x;
- refresca_pantalla();
- DIBUJA_BLOQUE_CUT(pos_frusky, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(15);
-
- playmusic(18);
-
- for (;;) {
- refresca_pantalla();
- pos_frusky[0] = frus_x[frame];
- pos_frusky[1] = frus_y[frame];
- pos_frusky[2] = frank_x;
- DIBUJA_BLOQUE_CUT( pos_frusky, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- frank_x = frank_x - 5;
- frame++;
- if (frank_x <= -45)
- break;
- if (frame == 7) {
- frame = 0;
- sentido_hare = 3;
- }
- pausa(6);
- }
-}
-
-void DrasculaEngine::animacion_14_5() {
- flags[11] = 1;
- comienza_sound("s3.als");
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0,0 , 320, 200, dir_zona_pantalla);
- fin_sound();
- pausa(17);
- sentido_hare = 3;
- hablar(TEXT246,"246.als");
- lleva_al_hare(89, 160);
- flags[10] = 1;
- comienza_sound("s7.als");
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- pausa(14);
- sentido_hare = 3;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- habla_solo(TEXTD18, "d18.als");
- FundeAlNegro(1);
-}
-
-void DrasculaEngine::animacion_15_5() {
- habla_mus(TEXTE4, "E4.als");
- habla_mus(TEXTE5, "E5.als");
- habla_mus(TEXTE6, "E6.als");
- hablar(TEXT291, "291.als");
- habla_mus(TEXTE7, "E7.als");
-}
-
-void DrasculaEngine::animacion_16_5() {
- habla_mus(TEXTE8, "E8.als");
-}
-
-void DrasculaEngine::animacion_17_5() {
- habla_mus(TEXTE9, "E9.als");
-}
-
-void DrasculaEngine::refresca_49_antes() {
- if (flags[6] == 0)
- DIBUJA_FONDO(2, 136, 176, 81, 49, 62, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_53_antes() {
- if (flags[1] == 0)
- DIBUJA_BLOQUE(2, 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0)
- DIBUJA_FONDO(41, 159, 27, 117, 25, 40, dir_dibujo3, dir_zona_pantalla);
- if (flags[9] == 1)
- DIBUJA_FONDO(67, 184, 56, 93, 32, 15, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_54_antes() {
- if (flags[5] == 1)
- DIBUJA_FONDO(168, 156, 187, 111, 7, 11, dir_dibujo3, dir_zona_pantalla);
- if (flags[12] == 1)
- DIBUJA_FONDO(16, 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_56_antes() {
- if (flags[10] == 0)
- DIBUJA_FONDO(2, 126, 42, 67, 57, 67, dir_dibujo3, dir_zona_pantalla);
- if (flags[11] == 1)
- DIBUJA_FONDO(60, 160, 128, 97, 103, 38, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_50() {
- DIBUJA_BLOQUE(4, 153, 118, 95, 67, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_57() {
- DIBUJA_BLOQUE(7, 113, 166, 61, 62, 82, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::pantalla_49(int fl){
- if (objeto_que_lleva == HABLAR && fl ==51)
- conversa("op_9.cal");
- else if (objeto_que_lleva == MIRAR && fl == 51)
- hablar(TEXT132, "132.als");
- else if ((objeto_que_lleva == 8 && fl == 51) || (objeto_que_lleva == 8 && fl == 203))
- animacion_5_5();
- else if (objeto_que_lleva == MIRAR && fl == 200)
- hablar(TEXT133, "133.als");
- else if (objeto_que_lleva == HABLAR && fl == 200)
- hablar(TEXT134, "134.als");
- else if (objeto_que_lleva == MIRAR && fl == 201)
- hablar(TEXT135, "135.als");
- else if (objeto_que_lleva == MIRAR && fl == 203)
- hablar(TEXT137, "137.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_53(int fl) {
- if (objeto_que_lleva == COGER && fl == 120) {
- agarra_objeto(16);
- visible[3] = 0;
- } else if (objeto_que_lleva == MIRAR && fl == 121)
- hablar(TEXT128, "128.als");
- else if (objeto_que_lleva == MIRAR && fl == 209)
- hablar(TEXT129, "129.als");
- else if (objeto_que_lleva == MOVER && fl == 123)
- animacion_11_5();
- else if (objeto_que_lleva == MIRAR && fl == 52)
- hablar(TEXT447, "447.als");
- else if (objeto_que_lleva == HABLAR && fl == 52)
- hablar(TEXT131, "131.als");
- else if (objeto_que_lleva == 12 && fl == 52)
- animacion_10_5();
- else if (objeto_que_lleva == 15 && fl == 52)
- animacion_9_5();
- else if (objeto_que_lleva == 16 && fl == 121) {
- flags[2] = 1;
- sin_verbo();
- actualiza_datos();
- } else if (objeto_que_lleva == 16) {
- hablar(TEXT439, "439.als");
- sin_verbo();
- visible[3] = 1;
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_54(int fl) {
- if ((objeto_que_lleva == HABLAR && fl == 118) || (objeto_que_lleva == MIRAR && fl == 118 && flags[0] == 0))
- animacion_1_5();
- else if (objeto_que_lleva == MIRAR && fl == 118 && flags[0]==1)
- hablar(TEXT124, "124.als");
- else if (objeto_que_lleva == MIRAR && fl == 53)
- hablar(TEXT127, "127.als");
- else if (objeto_que_lleva == HABLAR && fl == 53 && flags[14] == 0) {
- hablar(TEXT288, "288.als");
- flags[12] = 1;
- pausa(10);
- habla_mus(TEXTE1, "E1.als");
- hablar(TEXT289, "289.als");
- habla_mus(TEXTE2, "E2.als");
- habla_mus(TEXTE3, "E3.als");
- conversa("op_10.cal");
- flags[12] = 0;
- flags[14] = 1;
- } else if (objeto_que_lleva == HABLAR && fl == 53 && flags[14] == 1)
- hablar(TEXT109, "109.als");
- else if (objeto_que_lleva == COGER && fl == 9999 && flags[13] == 0) {
- agarra_objeto(8);
- flags[13] = 1;
- habla_mus(TEXTE10, "e10.als");
- actualiza_datos();
- } else if (objeto_que_lleva == ABRIR && fl == 119)
- hablar(TEXT125, "125.als");
- else if (objeto_que_lleva == MIRAR && fl == 119)
- hablar(TEXT126, "126.als");
- else if (objeto_que_lleva == 10 && fl == 119) {
- pausa(4);
- hablar(TEXT436, "436.als");
- sin_verbo();
- resta_objeto(10);
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_55(int fl) {
- if (objeto_que_lleva == COGER && fl == 122) {
- agarra_objeto(12);
- flags[8] = 1;
- actualiza_datos();
- } else if (objeto_que_lleva == MIRAR && fl == 122)
- hablar(TEXT138, "138.als");
- else if (objeto_que_lleva == MIRAR && fl == 204)
- hablar(TEXT139, "139.als");
- else if (objeto_que_lleva == MIRAR && fl == 205)
- hablar(TEXT140, "140.als");
- else if (fl == 206) {
- comienza_sound("s11.als");
- anima("det.bin", 17);
- fin_sound();
- lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6);
- } else
- hay_respuesta = 0;
-}
-
-bool DrasculaEngine::pantalla_56(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 124) {
- animacion_14_5();
- return true;
- } else if (objeto_que_lleva == MIRAR && fl == 124)
- hablar(TEXT450, "450.als");
- else if (objeto_que_lleva == ABRIR && fl == 207)
- hablar(TEXT141, "141.als");
- else if (objeto_que_lleva == MIRAR && fl == 208)
- hablar(TEXT142, "142.als");
- else
- hay_respuesta = 0;
-
- return false;
-}
-
-void DrasculaEngine::habla_lobo(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[9] = {52, 79, 106, 133, 160, 187, 214, 241, 268};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(8);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 136, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 203, 78);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_mus(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = { 16, 35, 54, 73, 92, 111, 130, 149};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 197, 64);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::animacion_1_6() {
- int l;
-
- sentido_hare = 0;
- hare_x = 103;
- hare_y = 108;
- flags[0] = 1;
- for (l = 0; l < 200; l++)
- factor_red[l] = 98;
-
- lee_dibujos("auxig2.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("auxdr.alg");
- descomprime_dibujo(dir_dibujo2, 1);
- lee_dibujos("car.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- habla_dr_dch(TEXTD19, "D19.als");
- hablar(TEXT247, "247.als");
- habla_dr_dch(TEXTD20, "d20.als");
- habla_dr_dch(TEXTD21, "d21.als");
- hablar(TEXT248, "248.als");
- habla_dr_dch(TEXTD22, "d22.als");
- hablar(TEXT249, "249.als");
- habla_dr_dch(TEXTD23, "d23.als");
- conversa("op_11.cal");
- habla_dr_dch(TEXTD26, "d26.als");
-
- anima("fum.bin", 15);
-
- habla_dr_dch(TEXTD27, "d27.als");
- hablar(TEXT254, "254.als");
- habla_dr_dch(TEXTD28, "d28.als");
- hablar(TEXT255, "255.als");
- habla_dr_dch(TEXTD29, "d29.als");
- FundeAlNegro(1);
- borra_pantalla();
- lee_dibujos("time1.alg");
- descomprime_dibujo(dir_zona_pantalla, 1);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(930);
- borra_pantalla();
- Negro();
- hare_se_ve = 0;
- flags[0] = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- hablar(TEXT256, "256.als");
- habla_dr_dch(TEXTD30, "d30.als");
- hablar(TEXT257, "257.als");
- FundeAlNegro(0);
- borra_pantalla();
- lee_dibujos("time1.alg");
- descomprime_dibujo(dir_zona_pantalla,1);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(900);
- borra_pantalla();
- Negro();
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- hablar(TEXT258, "258.als");
- habla_dr_dch(TEXTD31, "d31.als");
- animacion_5_6();
- habla_dr_dch(TEXTD32, "d32.als");
- habla_igor_dch(TEXTI11, "I11.als");
- sentido_igor = 3;
- habla_dr_dch(TEXTD33, "d33.als");
- habla_igor_frente(TEXTI12, "I12.als");
- habla_dr_dch(TEXTD34, "d34.als");
- sentido_dr = 0;
- habla_dr_izq(TEXTD35, "d35.als");
- borra_pantalla();
- carga_escoba("102.ald");
- activa_pendulo();
-}
-
-void DrasculaEngine::animacion_2_6() {
- habla_dr_dch(TEXTD24, "d24.als");
-}
-
-void DrasculaEngine::animacion_3_6() {
- habla_dr_dch(TEXTD24, "d24.als");
-}
-
-void DrasculaEngine::animacion_4_6() {
- habla_dr_dch(TEXTD25, "d25.als");
-}
-
-void DrasculaEngine::animacion_5_6() {
- int n, pos_pen[6];
-
- pos_pen[0] = 1;
- pos_pen[1] = 29;
- pos_pen[2] = 204;
- pos_pen[3] = -125;
- pos_pen[4] = 18;
- pos_pen[5] = 125;
-
- anima("man.bin", 14);
-
- for (n = -125; n <= 0; n = n + 2) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- pos_pen[3] = n;
- DIBUJA_BLOQUE_CUT(pos_pen, dir_dibujo3, dir_zona_pantalla);
-
- actualiza_refresco();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(2);
- }
-
- flags[3] = 1;
-}
-
-void DrasculaEngine::animacion_6_6() {
- anima("rct.bin", 11);
- borra_pantalla();
- sin_verbo();
- resta_objeto(20);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- rompo = 1;
- obj_saliendo = 104;
- hare_x = -1;
- sin_verbo();
- carga_escoba("58.ald");
- hare_se_ve = 1;
- sentido_hare = 1;
- anima("hbp.bin", 14);
-
- sentido_hare = 3;
- flags[0] = 1;
- flags[1] = 0;
- flags[2] = 1;
-}
-
-void DrasculaEngine::animacion_7_6() {
- flags[8] = 1;
- actualiza_datos();
-}
-
-void DrasculaEngine::animacion_9_6() {
- int v_cd;
-
- anima("fin.bin", 14);
- playmusic(13);
- flags[5] = 1;
- anima("drf.bin", 16);
- FundeAlNegro(0);
- borra_pantalla();
- hare_x = -1;
- obj_saliendo = 108;
- carga_escoba("59.ald");
- strcpy(num_room, "nada.alg");
- lee_dibujos("nota2.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- Negro();
- sentido_hare = 1;
- hare_x -= 21;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(0);
- pausa(96);
- lleva_al_hare(116, 178);
- sentido_hare = 2;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- playmusic(9);
- borra_pantalla();
- lee_dibujos("nota.alg");
- descomprime_dibujo(dir_dibujo1, COMPLETA);
- color_abc(BLANCO);
- habla_solo(TEXTBJ24, "bj24.als");
- habla_solo(TEXTBJ25, "bj25.als");
- habla_solo(TEXTBJ26, "bj26.als");
- habla_solo(TEXTBJ27, "bj27.als");
- habla_solo(TEXTBJ28, "bj28.als");
- sentido_hare = 3;
- borra_pantalla();
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("nota2.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- hablar(TEXT296, "296.als");
- hablar(TEXT297, "297.als");
- hablar(TEXT298, "298.als");
- sentido_hare = 1;
- hablar(TEXT299, "299.als");
- hablar(TEXT300, "300.als");
- refresca_pantalla();
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- color_abc(VERDE_CLARO);
- habla_solo("GOOOOOOOOOOOOOOOL", "s15.als");
- lee_dibujos("nota2.alg");
- descomprime_dibujo(dir_dibujo1, 1);
- sentido_hare = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT301, "301.als");
- v_cd = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
- v_cd = v_cd + 4;
- playmusic(17);
- FundeAlNegro(1);
- borra_pantalla();
- fliplay("qpc.bin", 1);
- MusicFadeout();
- stopmusic();
- borra_pantalla();
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
- playmusic(3);
- fliplay("crd.bin", 1);
- stopmusic();
-}
-
-void DrasculaEngine::animacion_10_6() {
- comienza_sound ("s14.als");
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_FONDO(164, 85, 155, 48, 113, 114, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- habla_taber2(TEXTT23, "t23.als");
- flags[7] = 1;
-}
-
-void DrasculaEngine::animacion_11_6() {
- habla_taber2(TEXTT10, "t10.als");
- hablar(TEXT268, "268.als");
- habla_taber2(TEXTT11, "t11.als");
-}
-
-void DrasculaEngine::animacion_12_6() {
- habla_taber2(TEXTT12, "t12.als");
- hablar(TEXT270, "270.als");
- habla_taber2(TEXTT13, "t13.als");
- habla_taber2(TEXTT14, "t14.als");
-}
-
-void DrasculaEngine::animacion_13_6() {
- habla_taber2(TEXTT15, "t15.als");
-}
-
-void DrasculaEngine::animacion_14_6() {
- habla_taber2(TEXTT24, "t24.als");
- suma_objeto(21);
- flags[10] = 1;
- rompo_y_salgo = 1;
-}
-
-void DrasculaEngine::animacion_15_6() {
- habla_taber2(TEXTT16, "t16.als");
-}
-
-void DrasculaEngine::animacion_18_6() {
- flags[6] = 1;
- sin_verbo();
- resta_objeto(21);
- anima("beb.bin", 10);
-}
-
-void DrasculaEngine::animacion_19_6() {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_FONDO(140, 23, 161, 69, 35, 80, dir_dibujo3, dir_zona_pantalla);
-
- actualiza_refresco_antes();
- pon_hare();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(6);
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s4.als");
- pausa(6);
- fin_sound();
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
}
void DrasculaEngine::activa_pendulo() {
flags[1] = 2;
hare_se_ve = 0;
strcpy(num_room, "102.alg");
- lee_dibujos("102.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("an_p1.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("an_p2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an_p3.alg");
- descomprime_dibujo(dir_hare_frente, 1);
+ loadPic("102.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ loadPic("an_p1.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("an_p2.alg");
+ decompressPic(dir_hare_dch, 1);
+ loadPic("an_p3.alg");
+ decompressPic(dir_hare_frente, 1);
- DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ copyBackground(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
conta_ciego_vez = vez();
}
-void DrasculaEngine::habla_pen(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[8] = {112, 138, 164, 190, 216, 242, 268, 294};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- flags[1] = 1;
-
- refresca_pantalla();
- DIBUJA_BLOQUE(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_BLOQUE(x_habla[cara], 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 160, 105);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- flags[1] = 0;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_pen2(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[5]={122, 148, 174, 200, 226};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- flags[1] = 1;
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(4);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
-
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 195, 107);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- flags[1] = 0;
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_taber2(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[6] = {1, 23, 45, 67, 89, 111};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(5);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 130, 151, 43, 21, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 132, 45);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_58() {
- if (hare_se_ve == 1)
- DIBUJA_BLOQUE(67, 139, 140, 147, 12, 16, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_60() {
- if (hare_y - 10 < y_dr && flags[5] == 0)
- pon_dr();
-}
-
-void DrasculaEngine::refresca_61() {
- DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_58_antes() {
- if (flags[0] == 0)
- DIBUJA_FONDO(1, 156, 143, 120, 120, 43, dir_dibujo3, dir_zona_pantalla);
- if (flags[1] == 2)
- DIBUJA_BLOQUE(252, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
- if (flags[1] == 0 && flags[0] == 0)
- DIBUJA_BLOQUE(278, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0) {
- pon_igor();
- pon_dr();
- }
- if (flags[3] == 1)
- DIBUJA_BLOQUE(1, 29, 204, 0, 18, 125, dir_dibujo3, dir_zona_pantalla);
- if (flags[8] == 1)
- DIBUJA_FONDO(20, 60, 30, 64, 46, 95, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_59_antes() {
- if (flags[4] == 0)
- DIBUJA_BLOQUE(1, 146, 65, 106, 83, 40, dir_dibujo3, dir_zona_pantalla);
- if (flags[9] == 1) {
- DIBUJA_FONDO(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(1, 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
- }
-}
-
-void DrasculaEngine::refresca_60_antes() {
- int velas_y[] = {158, 172, 186};
- int diferencia;
-
- if (flags[5] == 0)
- pon_dr();
-
- DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
-
- if (flag_tv == 1)
- DIBUJA_FONDO(114, 158, 8, 30, 8, 23, dir_dibujo3, dir_zona_pantalla);
-
- diferencia = vez() - conta_ciego_vez;
- parpadeo = _rnd->getRandomNumber(7);
- if (parpadeo == 5 && flag_tv == 0)
- flag_tv = 1;
- else if (parpadeo == 5 && flag_tv == 1)
- flag_tv = 0;
- if (diferencia > 6) {
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- conta_ciego_vez = vez();
- }
-}
-
-void DrasculaEngine::pantalla_58(int fl) {
- if (objeto_que_lleva == MOVER && fl == 103)
- animacion_7_6();
- else if (objeto_que_lleva == MIRAR && fl == 104)
- hablar(TEXT454, "454.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_59(int fl) {
- if ((objeto_que_lleva == HABLAR && fl == 51) || (objeto_que_lleva == MIRAR && fl == 51)) {
- flags[9] = 1;
- hablar(TEXT259, "259.als");
- habla_bj_cama(TEXTBJ13, "bj13.als");
- hablar(TEXT263, "263.als");
- habla_bj_cama(TEXTBJ14, "bj14.als");
- pausa(40);
- hablar(TEXT264, "264.als");
- habla_bj_cama(TEXTBJ15, "BJ15.als");
- hablar(TEXT265, "265.als");
- flags[9] = 0;
- if (flags[11] == 0) {
- comienza_sound("s12.als");
- delay(40);
- fin_sound();
- delay(10);
- lleva_al_hare(174, 168);
- sentido_hare = 2;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(40);
- comienza_sound("s12.als");
- pausa(19);
- fin_sound_corte();
- hare_se_ve = 0;
- refresca_pantalla();
- DIBUJA_BLOQUE(101, 34, hare_x - 4, hare_y - 1, 37, 70, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_ve = 1;
- borra_pantalla();
- lee_dibujos("tlef0.alg");
- descomprime_dibujo(dir_dibujo1, COMPLETA);
- lee_dibujos("tlef1.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("tlef2.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("tlef3.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- habla_htel(TEXT240, "240.als");
-
- color_abc(VON_BRAUN);
- habla_solo(TEXTVB58, "VB58.als");
- habla_htel(TEXT241, "241.als");
- color_abc(VON_BRAUN);
- habla_solo(TEXTVB59, "VB59.als");
- habla_htel(TEXT242, "242.als");
- color_abc(VON_BRAUN);
- habla_solo(TEXTVB60, "VB60.als");
- habla_htel(TEXT196, "196.als");
- color_abc(VON_BRAUN);
- habla_solo(TEXTVB61,"VB61.als");
- habla_htel(TEXT244, "244.als");
- color_abc(VON_BRAUN);
- habla_solo(TEXTVB62, "VB62.als");
- borra_pantalla();
- lee_dibujos("aux59.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, COMPLETA);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("59.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- sentido_hare = 3;
- hablar(TEXT245, "245.als");
- sin_verbo();
- flags[11] = 1;
- }
- } else
- hay_respuesta = 0;
-}
-
-bool DrasculaEngine::pantalla_60(int fl) {
- if (objeto_que_lleva == MOVER && fl == 112)
- animacion_10_6();
- else if (objeto_que_lleva == MIRAR && fl == 112)
- hablar(TEXT440, "440.als");
- else if (objeto_que_lleva == HABLAR && fl == 52) {
- hablar(TEXT266, "266.als");
- habla_taber2(TEXTT1, "t1.als");
- conversa("op_12.cal");
- sin_verbo();
- objeto_que_lleva = 0;
- } else if (objeto_que_lleva == HABLAR && fl == 115)
- hablar(TEXT455, "455.als");
- else if (objeto_que_lleva == HABLAR && fl == 56)
- hablar(TEXT455, "455.als");
- else if (objeto_que_lleva == MIRAR && fl == 114)
- hablar(TEXT167, "167.als");
- else if (objeto_que_lleva == MIRAR && fl == 113)
- hablar(TEXT168, "168.als");
- else if (objeto_que_lleva == COGER && fl == 113)
- hablar(TEXT170, "170.als");
- else if (objeto_que_lleva == MOVER && fl == 113)
- hablar(TEXT170, "170.als");
- else if (objeto_que_lleva == HABLAR && fl == 113)
- hablar(TEXT169, "169.als");
- else if (objeto_que_lleva == 21 && fl == 56)
- animacion_18_6();
- else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 1) {
- animacion_9_6();
- return true;
- } else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 0) {
- anima("cnf.bin", 14);
- hablar(TEXT455, "455.als");
- } else
- hay_respuesta = 0;
-
- return false;
-}
-
-void DrasculaEngine::pantalla_61(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 116)
- hablar(TEXT172, "172.als");
- else if (objeto_que_lleva == MIRAR && fl == 117)
- hablar(TEXT173, "173.als");
- else if (objeto_que_lleva == MOVER && fl == 117)
- hablar(TEXT174, "174.als");
- else if (objeto_que_lleva == ABRIR && fl == 117)
- hablar(TEXT174, "174.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::habla_bj_cama(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[5] = {51, 101, 151, 201, 251};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(4);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x_habla[cara], 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 104, 102);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_htel(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- char *num_cara;
-
- int x_habla[3] = {1, 94, 187};
- int cara, pantalla;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(2);
- pantalla = _rnd->getRandomNumber(2);
-
- if (cara == 0 && pantalla == 0)
- num_cara = (char *)dir_dibujo3;
- else if (pantalla == 1)
- num_cara = (char *)dir_hare_frente;
- else
- num_cara = (char *)dir_hare_fondo;
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- DIBUJA_FONDO(x_habla[cara], 1, 45, 24, 92, 108, (byte *)num_cara, dir_zona_pantalla);
-
- if (con_voces == 0)
- centra_texto(dicho, 90, 50);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_pendulo() {
- int pendulo_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
- int diferencia;
-
- if (frame_pen <= 4)
- dir_pendulo = dir_dibujo3;
- else if (frame_pen <= 11)
- dir_pendulo = dir_hare_dch;
- else
- dir_pendulo = dir_hare_frente;
-
- DIBUJA_FONDO(pendulo_x[frame_pen], 19, 152, 0, 55, 125, dir_pendulo, dir_zona_pantalla);
-
- if (flags[1] == 2)
- DIBUJA_BLOQUE(18, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[1] == 0)
- DIBUJA_BLOQUE(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 8) {
- frame_pen++;
- if (frame_pen == 17)
- frame_pen = 0;
- conta_ciego_vez = vez();
- }
-}
-
-void DrasculaEngine::pantalla_pendulo(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 100)
- hablar(TEXT452, "452.als");
- else if (objeto_que_lleva == MIRAR && fl == 101)
- hablar (TEXT123, "123.als");
- else if (objeto_que_lleva == COGER && fl == 101)
- agarra_objeto(20);
- else if (objeto_que_lleva == 20 && fl == 100)
- animacion_6_6();
- else if (objeto_que_lleva == COGER || objeto_que_lleva == ABRIR)
- hablar(TEXT453, "453.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::refresca_21_antes() {
- if (flags[0] == 1)
- DIBUJA_FONDO(2, 171, 84, 126, 17, 26, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[10] == 1)
- DIBUJA_FONDO(20, 163, 257, 149, 14, 34, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_22_antes() {
- if (flags[24] == 1)
- DIBUJA_FONDO(2, 187, 107, 106, 62, 12, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[27] == 0)
- DIBUJA_FONDO(32, 181, 203, 88, 13, 5, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[26] == 0)
- DIBUJA_FONDO(2, 133, 137, 83, 29, 53, dir_dibujo3, dir_zona_pantalla);
- else
- DIBUJA_FONDO(65, 174, 109, 145, 55, 25, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_23_antes() {
- if (flags[11] == 1 && flags[0] == 0)
- DIBUJA_FONDO(87, 171, 237, 110, 20, 28, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[0] == 1)
- DIBUJA_FONDO(29, 126, 239, 94, 57, 73, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[1] == 1)
- DIBUJA_BLOQUE(1, 135, 7, 94, 27, 64, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_24_antes() {
- if (flags[1] == 1)
- DIBUJA_FONDO(1, 163, 225, 124, 12, 36, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[2] == 1)
- DIBUJA_FONDO(14, 153, 30, 107, 23, 46, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_26_antes() {
- int diferencia;
-
- if (flags[2] == 1)
- DIBUJA_FONDO(1, 130, 87, 44, 50, 69, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[12] == 1)
- DIBUJA_FONDO(52, 177, 272, 103, 27, 22, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[18] == 0)
- DIBUJA_FONDO(80, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
-
- if (parpadeo == 5 && flags[18] == 0)
- DIBUJA_FONDO(52, 172, 226, 106, 3, 4, dir_dibujo3, dir_zona_pantalla);
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 10) {
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
- }
-
- if (flags[20] == 1)
- DIBUJA_FONDO(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_27_antes() {
- if (flags[5] == 1)
- DIBUJA_BLOQUE(1, 175, 59, 109, 17, 24, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[6] == 1)
- DIBUJA_BLOQUE(19, 177, 161, 103, 18, 22, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_29_antes() {
- if (flags[4] == 1)
- DIBUJA_FONDO(12, 113, 247, 49, 41, 84, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_30_antes() {
- if (flags[4] == 1)
- DIBUJA_FONDO(1, 148, 148, 66, 35, 51, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[16] == 1)
- DIBUJA_FONDO(37, 173, 109, 84, 20, 26, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_31_antes() {
- if (flags[13] == 1)
- DIBUJA_FONDO(1, 163, 116, 41, 61, 36, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[5] == 1)
- DIBUJA_FONDO(1, 78, 245, 63, 30, 84, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_34_antes() {
- if (flags[7] == 1)
- DIBUJA_FONDO(99, 127, 73, 41, 79, 72, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[8] == 1)
- DIBUJA_FONDO(36, 129, 153, 41, 62, 65, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_35_antes() {
- if (flags[14] == 1)
- DIBUJA_FONDO(1, 86, 246, 65, 68, 87, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[17] == 0 && flags[15] == 1)
- DIBUJA_FONDO(111, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[17] == 1)
- DIBUJA_FONDO(70, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_26() {
- if (flags[29] == 1)
- DIBUJA_BLOQUE(93, 1, hare_x, hare_y, 45, 78, dir_hare_fondo, dir_zona_pantalla);
-
- DIBUJA_BLOQUE(233, 107, 17, 102, 66, 92, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_27() {
- DIBUJA_BLOQUE(38, 177, 103, 171, 21, 22, dir_dibujo3, dir_zona_pantalla);
- DIBUJA_BLOQUE(60, 162, 228, 156, 18, 37, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_29() {
- DIBUJA_BLOQUE(1, 180, 150, 126, 10, 17, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_31() {
- DIBUJA_BLOQUE(63, 190, 223, 157, 17, 9, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_34() {
- DIBUJA_BLOQUE(5, 171, 234, 126, 29, 23, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::refresca_35() {
- DIBUJA_BLOQUE(1, 174, 54, 152, 195, 25, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::pantalla_1(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 118) {
- hablar(TEXT1, "1.als");
- pausa(10);
- hablar(TEXT2, "2.als");
- } else if (objeto_que_lleva == COGER && fl == 118)
- hablar(TEXT5, "5.als");
- else if (objeto_que_lleva == ABRIR && fl == 118)
- hablar(TEXT3, "3.als");
- else if (objeto_que_lleva == CERRAR && fl == 118)
- hablar(TEXT4, "4.als");
- else if (objeto_que_lleva == HABLAR && fl == 118)
- hablar(TEXT6, "6.als");
- else if (objeto_que_lleva == MIRAR && fl == 119)
- hablar(TEXT8, "8.als");
- else if (objeto_que_lleva == MOVER && fl == 119)
- hablar(TEXT13, "13.als");
- else if (objeto_que_lleva == CERRAR && fl == 119)
- hablar(TEXT10, "10.als");
- else if (objeto_que_lleva == HABLAR && fl == 119)
- hablar(TEXT12, "12.als");
- else if (objeto_que_lleva == MIRAR && fl == 120 && flags[8] == 0)
- hablar(TEXT14, "14.als");
- else if (objeto_que_lleva == MOVER && fl == 120)
- hablar(TEXT13, "13.als");
- else if (objeto_que_lleva == ABRIR && fl == 120)
- hablar(TEXT18, "18.als");
- else if (objeto_que_lleva == HABLAR && fl == 120)
- hablar(TEXT15, "15.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_3(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 129)
- hablar(TEXT21, "21.als");
- else if (objeto_que_lleva == COGER && fl == 129)
- hablar(TEXT5, "5.als");
- else if (objeto_que_lleva == MOVER && fl == 129)
- hablar(TEXT24, "24.als");
- else if (objeto_que_lleva == ABRIR && fl == 129)
- hablar(TEXT22, "22.als");
- else if (objeto_que_lleva == CERRAR && fl == 129)
- hablar(TEXT10, "10.als");
- else if (objeto_que_lleva == HABLAR && fl == 129) {
- hablar(TEXT23, "23.als");
- pausa(6);
- hablar_sinc(TEXT50, "50.als", "11111111111144432554433");
- } else if (objeto_que_lleva == MIRAR && fl == 131)
- hablar(TEXT27, "27.als");
- else if (objeto_que_lleva == COGER && fl == 131)
- hablar(TEXT5, "5.als");
- else if (objeto_que_lleva == MOVER && fl == 131)
- hablar(TEXT24, "24.als");
- else if (objeto_que_lleva == ABRIR && fl == 131)
- hablar(TEXT22, "22.als");
- else if (objeto_que_lleva == CERRAR && fl == 131)
- hablar(TEXT10, "10.als");
- else if (objeto_que_lleva == HABLAR && fl == 131)
- hablar(TEXT23, "23.als");
- else if (objeto_que_lleva == MIRAR && fl == 132)
- hablar(TEXT28, "28.als");
- else if (objeto_que_lleva == COGER && fl == 132)
- hablar(TEXT5, "5.als");
- else if (objeto_que_lleva == MOVER && fl == 132)
- hablar(TEXT24, "24.als");
- else if (objeto_que_lleva == ABRIR && fl == 132)
- hablar(TEXT22, "22.als");
- else if (objeto_que_lleva == CERRAR && fl == 132)
- hablar(TEXT10, "10.als");
- else if (objeto_que_lleva == HABLAR && fl == 132)
- hablar(TEXT23, "23.als");
- else if (objeto_que_lleva == MIRAR && fl == 133)
- hablar(TEXT321, "321.als");
- else if (objeto_que_lleva == COGER && fl == 133)
- hablar(TEXT31, "31.als");
- else if (objeto_que_lleva == MOVER && fl == 133)
- hablar(TEXT34, "34.als");
- else if (objeto_que_lleva == ABRIR && fl == 133)
- hablar(TEXT30, "30.als");
- else if (objeto_que_lleva == CERRAR && fl == 133)
- hablar(TEXT10, "10.als");
- else if (objeto_que_lleva == HABLAR && fl == 133) {
- hablar_sinc(TEXT322, "322.als", "13333334125433333333");
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(25);
- hablar(TEXT33, "33.als");
- } else if (objeto_que_lleva == MIRAR && fl == 165) {
- hablar(TEXT149, "149.als");
- hablar(TEXT150, "150.als");
- } else if (objeto_que_lleva == COGER && fl == 165) {
- DIBUJA_FONDO(0, 0, 0,0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(4);
- agarra_objeto(10);
- flags[3] = 1;
- visible[8] = 0;
- } else if (objeto_que_lleva == MIRAR && fl == 166)
- hablar(TEXT55, "55.als");
- else if (objeto_que_lleva == COGER && fl == 166)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 0) {
- animacion_7_2();
- agarra_objeto(8);
- } else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 1)
- hablar(TEXT323, "323.als");
- else if (objeto_que_lleva == MIRAR && fl == 211)
- hablar(TEXT184, "184.als");
- else if (objeto_que_lleva == HABLAR && fl == 211) {
- hablar(TEXT185, "185.als");
- hablar(TEXT186, "186.als");
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_4(int fl) {
- if (objeto_que_lleva == MOVER && fl == 189 && flags[34] == 0) {
- hablar(TEXT327, "327.als");
- agarra_objeto(13);
- flags[34] = 1;
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
- } else if (objeto_que_lleva == MIRAR && fl == 189)
- hablar(TEXT182, "182.als");
- else if (objeto_que_lleva == MIRAR && fl == 207)
- hablar(TEXT175, "175.als");
- else if (objeto_que_lleva == HABLAR && fl == 207)
- hablar(TEXT176, "176.als");
- else if (objeto_que_lleva == MIRAR && fl == 208)
- hablar(TEXT177, "177.als");
- else if (objeto_que_lleva == MIRAR && fl == 209)
- hablar(TEXT179, "179.als");
- else if (objeto_que_lleva == MIRAR && fl == 210)
- hablar(TEXT180, "180.als");
- else if (objeto_que_lleva == ABRIR && fl == 210)
- hablar(TEXT181, "181.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_5(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 136 && flags[8]==0) hablar(TEXT14, "14.als");
- else if (objeto_que_lleva == MOVER && fl == 136)
- hablar(TEXT13, "13.als");
- else if (objeto_que_lleva == ABRIR && fl == 136)
- hablar(TEXT18, "18.als");
- else if (objeto_que_lleva == HABLAR && fl == 136)
- hablar(TEXT15, "15.als");
- else if (objeto_que_lleva == 10 && fl == 136) {
- animacion_5_2();
- resta_objeto(10);
- } else if (objeto_que_lleva == MIRAR && fl == 212)
- hablar(TEXT187, "187.als");
- else if (objeto_que_lleva == HABLAR && fl == 212)
- hablar(TEXT188, "188.als");
- else if (objeto_que_lleva == MIRAR && fl == 213)
- hablar(TEXT189, "189.als");
- else if (objeto_que_lleva == ABRIR && fl == 213)
- hablar(TEXT190, "190.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_6(int fl){
- if (objeto_que_lleva == MIRAR && fl==144) {
- hablar(TEXT41, "41.als");
- hablar(TEXT42, "42.als");
- } else if (objeto_que_lleva == COGER && fl == 144)
- hablar(TEXT43, "43.als");
- else if (objeto_que_lleva == MIRAR && fl == 138)
- hablar(TEXT35, "35.als");
- else if (objeto_que_lleva == ABRIR && fl == 138)
- abre_puerta(0, 1);
- else if (objeto_que_lleva == CERRAR && fl == 138)
- cierra_puerta(0, 1);
- else if (objeto_que_lleva == HABLAR && fl == 138)
- hablar(TEXT6, "6.als");
- else if (objeto_que_lleva == MIRAR && fl == 143)
- hablar(TEXT37, "37.als");
- else if (objeto_que_lleva == COGER && fl == 143)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == MOVER && fl == 143)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == ABRIR && fl == 143 && flags[2] == 0) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(10);
- comienza_sound("s3.als");
- flags[2] = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == CERRAR && fl == 143 && flags[2] == 1) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- flags[2] = 0;
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(5);
- comienza_sound("s4.als");
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == HABLAR && fl == 143)
- hablar(TEXT38, "38.als");
- else if (objeto_que_lleva == MIRAR && fl == 139)
- hablar(TEXT36, "36.als");
- else if (objeto_que_lleva == ABRIR && fl == 139 && flags[1] == 0) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(19);
- comienza_sound("s3.als");
- flags[1] = 1;
- visible[4] = 1;
- visible[2] = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == MIRAR && fl == 140)
- hablar(TEXT147, "147.als");
- else if (objeto_que_lleva == COGER && fl == 140) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(19);
- agarra_objeto(9);
- visible[4] = 0;
- flags[10] = 1;
- } else if (objeto_que_lleva == ABRIR && fl == 140)
- hay_respuesta = 1;
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_7(int fl){
- if (objeto_que_lleva == MIRAR && fl == 169)
- hablar(TEXT44, "44.als");
- else if (objeto_que_lleva == MIRAR && fl == 164)
- hablar(TEXT35, "35.als" );
- else if (objeto_que_lleva == COGER && fl == 190) {
- agarra_objeto(17);
- flags[35] = 1;
- visible[3] = 0;
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_8(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 147 && flags[7] == 0) {
- hablar(TEXT58, "58.als");
- agarra_objeto(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 (objeto_que_lleva == MIRAR && fl == 147)
- hablar(TEXT59, "59.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_9(int fl){
- if (objeto_que_lleva == MIRAR && fl == 150)
- hablar(TEXT35, "35.als");
- else if (objeto_que_lleva == HABLAR && fl == 150)
- hablar(TEXT6, "6.als");
- else if (objeto_que_lleva == MIRAR && fl == 51)
- hablar(TEXT60, "60.als");
- else if (objeto_que_lleva == HABLAR && fl == 51 && flags[4] == 0)
- animacion_4_2();
- else if (objeto_que_lleva == HABLAR && fl == 51 && flags[4] == 1)
- animacion_33_2();
- else if (objeto_que_lleva == 7 && fl == 51) {
- animacion_6_2();
- resta_objeto(7);
- agarra_objeto(14);}
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_12(int fl){
- if (objeto_que_lleva == MIRAR && fl == 154)
- hablar(TEXT329, "329.als");
- else if (objeto_que_lleva == HABLAR && fl == 154)
- hablar(TEXT330, "330.als");
- else if (objeto_que_lleva == MOVER && fl == 155)
- hablar(TEXT48, "48.als");
- else if (objeto_que_lleva == HABLAR && fl == 155)
- hablar(TEXT331, "331.als");
- else if (objeto_que_lleva == MIRAR && fl == 156)
- hablar(TEXT35, "35.als");
- else if (objeto_que_lleva == MOVER && fl == 156)
- hablar(TEXT48, "48.als");
- else if (objeto_que_lleva == HABLAR && fl == 156)
- hablar(TEXT50, "50.als");
- else if (objeto_que_lleva == ABRIR && fl == 156)
- abre_puerta(16, 4);
- else if (objeto_que_lleva == CERRAR && fl == 156)
- cierra_puerta(16, 4);
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_14(int fl) {
- if (objeto_que_lleva == HABLAR && fl == 54 && flags[39] == 0)
- animacion_12_2();
- else if (objeto_que_lleva == HABLAR && fl == 54 && flags[39] == 1)
- hablar(TEXT109, "109.als");
- else if (objeto_que_lleva == 12 && fl == 54)
- animacion_26_2();
- else if (objeto_que_lleva == HABLAR && fl == 52 && flags[5] == 0)
- animacion_11_2();
- else if (objeto_que_lleva == HABLAR && fl == 52 && flags[5] == 1)
- animacion_36_2();
- else if (objeto_que_lleva == HABLAR && fl == 53)
- animacion_13_2();
- else if (objeto_que_lleva == MIRAR && fl == 200)
- hablar(TEXT165, "165.als");
- else if (objeto_que_lleva == MIRAR && fl == 201)
- hablar(TEXT166, "166.als");
- else if (objeto_que_lleva == MIRAR && fl == 202)
- hablar(TEXT167, "167.als");
- else if (objeto_que_lleva == MIRAR && fl == 203)
- hablar(TEXT168, "168.als");
- else if (objeto_que_lleva == COGER && fl == 203)
- hablar(TEXT170, "170.als");
- else if (objeto_que_lleva == MOVER && fl == 203)
- hablar(TEXT170, "170.als");
- else if (objeto_que_lleva == HABLAR && fl == 203)
- hablar(TEXT169, "169.als");
- else if (objeto_que_lleva == MIRAR && fl == 204)
- hablar(TEXT171, "171.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_15(int fl) {
- if (objeto_que_lleva == HABLAR && fl == 188)
- hablar(TEXT333, "333.als");
- else if (objeto_que_lleva == MIRAR && fl == 188)
- hablar(TEXT334, "334.als");
- else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 0)
- hablar(TEXT335, "335.als");
- else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 1) {
- hablar(TEXT336, "336.als");
- sentido_hare = 3;
- hablar(TEXT337, "337.als");
- hablar_sinc(TEXT46, "46.als", "4442444244244");
- sentido_hare = 1;
- } else if (objeto_que_lleva == 18 && fl == 188 && flags[26] == 0) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(133, 135, hare_x + 6, hare_y, 39, 63, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s8.als");
- fin_sound();
- hablar(TEXT338, "338.als");
- flags[27] = 0;
- agarra_objeto(19);
- resta_objeto(18);
- } else if (objeto_que_lleva == MOVER && fl == 188 && flags[27] == 0) {
- animacion_34_2();
- hablar(TEXT339, "339.als");
- agarra_objeto(16);
- flags[26] = 1;
- flags[27] = 1;
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
- } else if (objeto_que_lleva == MIRAR && fl == 205)
- hablar(TEXT172, "172.als");
- else if (objeto_que_lleva == MIRAR && fl == 206)
- hablar(TEXT173, "173.als");
- else if (objeto_que_lleva == MOVER && fl == 206)
- hablar(TEXT174, "174.als");
- else if (objeto_que_lleva == ABRIR && fl == 206)
- hablar(TEXT174, "174.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_16(int fl) {
- if (objeto_que_lleva == HABLAR && fl == 163)
- hablar(TEXT6, "6.als");
- else if (objeto_que_lleva == ABRIR && fl == 163)
- abre_puerta(17, 0);
- else if (objeto_que_lleva == CERRAR && fl == 163)
- cierra_puerta(17, 0);
- else if (objeto_que_lleva == MIRAR && fl == 183)
- hablar(TEXT340, "340.als");
- else if (objeto_que_lleva == HABLAR && fl == 183) {
- hablar(TEXT341, "341.als");
- pausa(10);
- hablar_sinc(TEXT50, "50.als", "11111111111144432554433");
- pausa(3);
- habla_baul("bla, bla, bla.", "d83.als");
- } else if (objeto_que_lleva == ABRIR && fl == 183) {
- abre_puerta(19, NO_PUERTA);
- if (flags[20] == 0) {
- flags[20] = 1;
- sentido_hare = 3;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT342, "342.als");
- agarra_objeto(22);
- }
- } else if (objeto_que_lleva == CERRAR && fl == 183)
- cierra_puerta(19, NO_PUERTA);
- else if (objeto_que_lleva == MIRAR && fl == 185)
- hablar(TEXT37, "37.als");
- else if (objeto_que_lleva == COGER && fl == 185)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == MOVER && fl == 185)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == HABLAR && fl == 185)
- hablar(TEXT38, "38.als");
- else if (objeto_que_lleva == MIRAR && fl == 187) {
- hablar(TEXT343, "343.als");
- sentido_hare = 3;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hablar(TEXT344, "344.als");
- } else if (objeto_que_lleva == HABLAR && fl == 187)
- hablar(TEXT345, "345.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_17(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 177)
- hablar(TEXT35, "35.als");
- else if (objeto_que_lleva == HABLAR && fl == 177 && flags[18] == 0)
- hablar(TEXT6, "6.als");
- else if (objeto_que_lleva == HABLAR && fl == 177 && flags[18] == 1)
- animacion_18_2();
- else if (objeto_que_lleva == ABRIR && fl == 177 && flags[18] == 1)
- hablar(TEXT346, "346.als");
- else if (objeto_que_lleva == ABRIR && fl == 177 && flags[14] == 0 && flags[18] == 0)
- animacion_22_2();
- else if (objeto_que_lleva == ABRIR && fl == 177 && flags[14] == 1)
- abre_puerta(15, 1);
- else if (objeto_que_lleva == CERRAR && fl == 177 && flags[14] == 1)
- cierra_puerta(15, 1);
- else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
- hablar(TEXT347, "347.als");
- flags[29] = 1;
- agarra_objeto(23);
- resta_objeto(11);
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_18(int fl) {
- if (objeto_que_lleva == HABLAR && fl == 55 && flags[36] == 0)
- animacion_24_2();
- else if (objeto_que_lleva == HABLAR && fl == 55 && flags[36] == 1)
- hablar(TEXT109, "109.als");
- else if (objeto_que_lleva == MIRAR && fl == 181)
- hablar(TEXT348, "348.als");
- else if (objeto_que_lleva == COGER && fl == 182) {
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(4);
- agarra_objeto(12);
- visible[2] = 0;
- flags[28] = 1;
- } else if (objeto_que_lleva == MIRAR && fl == 182)
- hablar(TEXT154, "154.als");
- else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- hablar(TEXT349, "349.als");
- else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- hablar(TEXT349, "349.als");
- else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- hablar(TEXT349, "349.als");
- else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- hablar(TEXT349, "349.als");
- else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- hablar(TEXT349, "349.als");
- else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animacion_24_2();
- else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animacion_24_2();
- else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animacion_24_2();
- else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animacion_24_2();
- else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animacion_24_2();
- else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
- sentido_hare = 3;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- actualiza_refresco_antes();
- DIBUJA_BLOQUE(1, 1, hare_x - 1, hare_y + 3, 42, 67, dir_dibujo2, dir_zona_pantalla);
- actualiza_refresco();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(6);
- hablar(TEXT347, "347.als");
- flags[29] = 1;
- agarra_objeto(23);
- resta_objeto(11);
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_19(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 214)
- hablar(TEXT191, "191.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::hablar_sinc(const char *dicho, const char *filename, const char *sincronia) {
- int suma_1_pixel = 1;
- int y_mask_habla = 170;
- int x_habla_dch[6] = {1, 25, 49, 73, 97, 121};
- int x_habla_izq[6] = {145, 169, 193, 217, 241, 265};
- int p, cara = 0;
-
- int longitud;
- longitud = strlen(dicho);
-
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (num_ejec == 1) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
- }
-
- p = 0;
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- if (sincronia[p] == '0')
- cara = 0;
- if (sincronia[p] == '1')
- cara = 1;
- if (sincronia[p] == '2')
- cara = 2;
- if (sincronia[p] == '3')
- cara = 3;
- if (sincronia[p] == '4')
- cara = 4;
- if (sincronia[p] == '5')
- cara = 5;
- if (sincronia[p] == '6')
- cara = 6;
- if (sincronia[p] == '7')
- cara = 7;
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
- if (num_ejec == 2)
- DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_habla - 1, dir_zona_pantalla, dir_dibujo3);
- else
- DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_habla - 1) / 100) * factor_red[hare_y + alto_hare]), dir_zona_pantalla, dir_dibujo3);
- pon_hare();
- if (num_ejec == 2) {
- if (alto_hare != 56)
- DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_habla - 1, dir_dibujo3, dir_zona_pantalla);
- } else
- DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_habla - 1) / 100) * factor_red[hare_y + alto_hare]), dir_dibujo3, dir_zona_pantalla);
-
- if (sentido_hare == 0) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_izq[cara], y_mask_habla, hare_x + 8, hare_y - 1, ancho_habla, alto_habla, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_izq[cara], y_mask_habla, (int)(hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- actualiza_refresco();
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 12, hare_y, ancho_habla, alto_habla, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_dch[cara], y_mask_habla, (int)(hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- actualiza_refresco();
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_izq[cara], y_mask_habla, hare_x + 12, hare_y, ancho_habla, alto_habla, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_izq[cara], y_mask_habla,
- (int)(suma_1_pixel + hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- actualiza_refresco();
- } else if (sentido_hare == 3) {
- if (num_ejec == 2)
- DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 8, hare_y, ancho_habla, alto_habla, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_habla_dch[cara], y_mask_habla,
- (int)(suma_1_pixel + hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- actualiza_refresco();
- }
-
- if (con_voces == 0)
- centra_texto(dicho, hare_x, hare_y);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- p++;
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- if (num_ejec == 1 && music_status() == 0 && flags[11] == 0)
- playmusic(musica_room);
- if (num_ejec == 2 && music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
-}
-
-void DrasculaEngine::habla_baul(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- int cara = 0, cara_antes;
- int longitud;
-
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- cara_antes = flags[19];
-
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- if (cara == 1)
- cara = 0;
- else
- cara = 1;
-
- flags[19] = cara;
- refresca_pantalla();
-
- if (con_voces == 0)
- centra_texto(dicho, 263, 69);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(4);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- flags[19] = cara_antes;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
void DrasculaEngine::cierra_puerta(int nflag, int n_puerta) {
if (flags[nflag] == 1) {
comienza_sound("s4.als");
flags[nflag] = 0;
if (n_puerta != NO_PUERTA)
puertas_cerradas(n_puerta);
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
fin_sound();
sin_verbo();
}
}
-void DrasculaEngine::animacion_12_2() {
- lee_dibujos("an12.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT356, "356.als");
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
-
- pausa(3);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
- stopmusic();
- flags[11] = 1;
-
- habla_pianista(TEXTP5, "P5.als");
- conversa("op_1.cal");
-
- flags[11] = 0;
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
-void DrasculaEngine::animacion_26_2() {
- int n, x = 0;
-
- lee_dibujos("an12.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT392, "392.als");
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
-
- pausa(3);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
- stopmusic();
- flags[11] = 1;
-
- habla_pianista(TEXTP5, "P5.als");
- hablar(TEXT393, "393.als");
- habla_pianista(TEXTP17, "P17.als");
- habla_pianista(TEXTP18, "P18.als");
- habla_pianista(TEXTP19, "P19.als");
-
- lee_dibujos("an26.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- for (n = 0; n < 6; n++){
- x++;
- DIBUJA_FONDO(x, 1, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(225,113, 225,113, 50,59, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 61, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
- x = x + 50;
- if (n == 2)
- comienza_sound("s9.als");
- pausa(3);
- }
-
- fin_sound_corte();
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 121, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
- x = x + 50;
- pausa(3);
- }
-
- agarra_objeto(11);
- resta_objeto(12);
-
- flags[11] = 0;
- flags[39] = 1;
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- musica_room = 16;
-}
-
-void DrasculaEngine::animacion_11_2() {
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT352, "352.als");
- habla_tabernero(TEXTT1, "T1.als");
- hablar(TEXT353, "353.als");
- habla_tabernero(TEXTT17, "T17.als");
- hablar(TEXT354, "354.als");
- habla_tabernero(TEXTT18, "T18.als");
- hablar(TEXT355, "355.als");
- pausa(40);
- habla_tabernero("No, nada", "d82.als");
-
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
-void DrasculaEngine::animacion_13_2() {
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- if (flags[41] == 0) {
- hablar(TEXT103, "103.als");
- habla_borracho(TEXTB4, "B4.als");
- flags[12] = 1;
- hablar(TEXT367, "367.als");
- habla_borracho(TEXTB5, "B5.als");
- flags[12] = 1;
- hablar(TEXT368, "368.als");
- habla_borracho(TEXTB6, "B6.als");
- habla_borracho(TEXTB7, "B7.als");
- flags[41] = 1;
- }
- conversa("op_2.cal");
-
- lee_dibujos("964.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-}
-
-void DrasculaEngine::animacion_18_2() {
- hablar(TEXT378, "378.als");
- habla_vbpuerta(TEXTVB4, "VB4.als");
- conversa("op_3.cal");
-}
-
-void DrasculaEngine::animacion_22_2() {
- hablar(TEXT374,"374.als");
-
- sentido_hare=2;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s13.als");
- fin_sound();
- sentido_hare = 1;
-
- habla_vbpuerta(TEXTVB1, "VB1.als");
- hablar(TEXT375, "375.als");
- habla_vbpuerta(TEXTVB2, "VB2.als");
- hablar(TEXT376, "376.als");
- habla_vbpuerta(TEXTVB3, "VB3.als");
-
- flags[18] = 1;
-}
-
-void DrasculaEngine::animacion_24_2() {
- if (hare_x < 178)
- lleva_al_hare(208, 136);
- sentido_hare = 3;
- refresca_pantalla();
- pausa(3);
- sentido_hare = 0;
-
- hablar(TEXT356, "356.als");
-
- lee_dibujos("an24.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- animacion_32_2();
-
- flags[21] = 1;
-
- habla_vb(TEXTVB22, "VB22.als");
-
- if (flags[22] == 0)
- conversa("op_4.cal");
- else
- conversa("op_5.cal");
-
- sal_de_la_habitacion(0);
- flags[21] = 0;
- flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
-}
-
-void DrasculaEngine::animacion_32_2() {
- int n, x = 0;
-
- lee_dibujos("an32_1.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("an32_2.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pausa(4);
- }
-
- x = 0;
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(x, 83, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pausa(4);
- }
-
- x = 0;
- for (n = 0; n < 4; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pausa(4);
- }
-
- x = 0;
- for (n = 0; n < 3; n++) {
- x++;
- DIBUJA_FONDO(x, 83, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- if (n < 2)
- pausa(4);
- }
-
- lee_dibujos("aux18.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-}
-
-void DrasculaEngine::animacion_34_2() {
- int n, x = 0;
-
- sentido_hare = 1;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- lee_dibujos("an34_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an34_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- for (n = 0; n < 3; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
- x = x + 83;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 3; n++) {
- x++;
- DIBUJA_FONDO(x, 77, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
- x = x + 83;
- pausa(3);
- }
-
- x = 0;
- comienza_sound("s8.als");
-
- for (n = 0; n < 3; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(218, 79, 218, 79, 83,75, dir_zona_pantalla);
- x = x + 83;
- pausa(3);
- }
- fin_sound();
-
- pausa(30);
-
- DIBUJA_FONDO(1, 77, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
- pausa(3);
-
- lee_dibujos("994.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
-void DrasculaEngine::animacion_36_2() {
- lee_dibujos("an11y13.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- hablar(TEXT404, "404.als");
- habla_tabernero(TEXTT19, "T19.als");
- habla_tabernero(TEXTT20, "T20.als");
- habla_tabernero(TEXTT21, "T21.als");
- hablar(TEXT355, "355.als");
- pausa(40);
- habla_tabernero("No, nada", "d82.als");
-
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-}
-
-void DrasculaEngine::animacion_7_2() {
- int n, x = 0;
-
- lee_dibujos("an7_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an7_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an7_3.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- if (flags[3] == 1)
- DIBUJA_FONDO(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_dibujo1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
- lee_dibujos("an7_4.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an7_5.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an7_6.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("an7_7.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51,73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 2; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
- lee_dibujos("an7_8.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an7_9.alg");
- descomprime_dibujo(dir_hare_dch, 1);
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pausa(3);
- }
-
-
- DIBUJA_FONDO(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- DIBUJA_BLOQUE(1, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
-
- flags[37] = 1;
-
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
-
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("aux3.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-}
-
-void DrasculaEngine::animacion_5_2() {
- int n, x = 0;
-
- sentido_hare = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- lee_dibujos("an5_1.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("an5_2.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("an5_3.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("an5_4.alg");
- descomprime_dibujo(dir_dibujo3, 1);
-
- DIBUJA_FONDO(1, 1, 213, 66, 53,84, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84,dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 86, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 86, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- comienza_sound("s1.als");
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 86, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
- fin_sound_corte();
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- DIBUJA_FONDO(x, 1, 213, 66, 53, 84, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pausa(3);
- }
-
- lee_dibujos("994.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("974.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("964.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("aux5.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- flags[8] = 1;
- hare_x = hare_x - 4;
- hablar_sinc(TEXT46, "46.als", "4442444244244");
- sin_verbo();
-}
-
-void DrasculaEngine::animacion_6_2() {
- stopmusic();
- flags[9] = 1;
-
- borra_pantalla();
- lee_dibujos("ciego1.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("ciego2.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("ciego3.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("ciego4.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("ciego5.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(1);
-
- if (flags[4] == 1)
- habla_hacker(TEXTD66, "d66.als");
- pausa(6);
- habla_ciego(TEXTD78, "d78.als",
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777");
- pausa(4);
- habla_hacker(TEXTD67, "d67.als");
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(10);
-
- borra_pantalla();
-
- playmusic(musica_room);
- lee_dibujos("9.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("aux9.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- sin_verbo();
-
- flags[9] = 0;
-}
-
-void DrasculaEngine::animacion_33_2() {
- stopmusic();
- flags[9] = 1;
-
- pausa(12);
- hablar(TEXTD56, "d56.als" );
- pausa(8);
-
- borra_pantalla();
- lee_dibujos("ciego1.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("ciego2.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("ciego3.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("ciego4.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lee_dibujos("ciego5.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(10);
-
- habla_ciego(TEXTD68, "d68.als", "44472225500022227555544444472225500022227555544444664466");
- pausa(5);
- habla_hacker(TEXTD57, "d57.als");
- pausa(6);
- _system->delayMillis(1000);
- habla_ciego(TEXTD77, "d77.als", "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444");
- habla_hacker(TEXTD65, "d65.als");
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(14);
-
- borra_pantalla();
-
- playmusic(musica_room);
- lee_dibujos("9.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("aux9.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("97.alg");
- descomprime_dibujo(dir_hare_dch, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- sin_verbo();
-
- flags[33] = 1;
- flags[9] = 0;
-}
-
-bool DrasculaEngine::pantalla_21(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 101 && flags[28] == 0)
- hablar(TEXT419, "419.als");
- else if (objeto_que_lleva == ABRIR && fl == 101 && flags[28] == 1)
- abre_puerta(0, 1);
- else if (objeto_que_lleva == CERRAR && fl == 101)
- cierra_puerta(0, 1);
- else if(objeto_que_lleva == COGER && fl == 141) {
- agarra_objeto(19);
- visible[2] = 0;
- flags[10] = 1;
- } else if(objeto_que_lleva == 7 && fl == 101) {
- flags[28] = 1;
- abre_puerta(0, 1);
- sin_verbo();
- } else if (objeto_que_lleva == 21 && fl == 179) {
- animacion_9_4();
- return true;
- } else
- hay_respuesta = 0;
-
- return false;
-}
-
-void DrasculaEngine::pantalla_22(int fl) {
- if (objeto_que_lleva == COGER && fl == 140)
- hablar(TEXT7, "7.als");
- else if (objeto_que_lleva == 11 && fl == 140) {
- agarra_objeto(18);
- visible[1] = 0;
- flags[24] = 1;
- } else if (objeto_que_lleva == 22 && fl == 52) {
- anima("up.bin",14);
- flags[26]=1;
- comienza_sound("s1.als");
- hipo(14);
- fin_sound();
- sin_verbo();
- resta_objeto(22);
- actualiza_datos();
- sentido_hare = 3;
- hablar(TEXT499, "499.als");
- hablar(TEXT500, "500.als");
- } else if (objeto_que_lleva == MIRAR && fl == 52)
- hablar(TEXT497, "497.als");
- else if (objeto_que_lleva == HABLAR && fl == 52)
- hablar(TEXT498, "498.als");
- else if (objeto_que_lleva == COGER && fl == 180 && flags[26] == 0)
- hablar(TEXT420, "420.als");
- else if (objeto_que_lleva == COGER && fl == 180 && flags[26] == 1) {
- agarra_objeto(7);
- visible[3] = 0;
- flags[27] = 1;
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_23(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 103) {
- abre_puerta(0, 0);
- actualiza_datos();
- } else if(objeto_que_lleva == CERRAR && fl == 103) {
- cierra_puerta(0, 0);
- actualiza_datos();
- } else if(objeto_que_lleva == ABRIR && fl == 104)
- abre_puerta(1, 1);
- else if(objeto_que_lleva == CERRAR && fl == 104)
- cierra_puerta(1, 1);
- else if(objeto_que_lleva == COGER && fl == 142) {
- agarra_objeto(8);
- visible[2] = 0;
- flags[11] = 1;
- if (flags[22] == 1 && flags[14] == 1)
- flags[18] = 1;
- if (flags[18] == 1)
- animacion_6_4();
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_24(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 105)
- abre_puerta(1, 0);
- else if (objeto_que_lleva == CERRAR && fl == 105)
- cierra_puerta(1, 0);
- else if (objeto_que_lleva == ABRIR && fl == 106)
- abre_puerta(2, 1);
- else if (objeto_que_lleva == CERRAR && fl == 106)
- cierra_puerta(2, 1);
- else if (objeto_que_lleva == MIRAR && fl == 151)
- hablar(TEXT461, "461.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_26(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 107 && flags[30] == 0)
- abre_puerta(2, 0);
- else if (objeto_que_lleva == ABRIR && fl == 107 && flags[30] == 1)
- hablar(TEXT421, "421.als");
- else if (objeto_que_lleva == CERRAR && fl == 107)
- cierra_puerta(2, 0);
- else if (objeto_que_lleva == 10 && fl == 50 && flags[18] == 1 && flags[12] == 1)
- animacion_5_4();
- else if (objeto_que_lleva == 8 && fl == 50 && flags[18] == 1 && flags[12] == 1)
- animacion_5_4();
- else if (objeto_que_lleva == 12 && fl == 50 && flags[18] == 1 && flags[12] == 1)
- animacion_5_4();
- else if (objeto_que_lleva == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
- animacion_5_4();
- else if (objeto_que_lleva == COGER && fl == 143 && flags[18] == 1) {
- lleva_al_hare(260, 180);
- agarra_objeto(10);
- visible[1] = 0;
- flags[12] = 1;
- cierra_puerta(2, 0);
- sentido_hare = 2;
- habla_igorpuerta(TEXTI27, "I27.als");
- flags[30] = 1;
- habla_igorpuerta(TEXTI28, "I28.als");
- lleva_al_hare(153, 180);
- } else if (objeto_que_lleva == COGER && fl == 143 && flags[18] == 0) {
- lleva_al_hare(260, 180);
- DIBUJA_FONDO(80, 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(199, 94, 199, 94, 38, 27, dir_zona_pantalla);
- pausa(3);
- habla_igor_peluca(TEXTI25, "I25.als");
- lleva_al_hare(153, 180);
- } else if (objeto_que_lleva == HABLAR && fl == 51)
- animacion_1_4();
- else if (objeto_que_lleva == ABRIR && fl == 167)
- hablar(TEXT467, "467.als");
- else if (objeto_que_lleva == MIRAR && fl == 164)
- hablar(TEXT470, "470.als");
- else if (objeto_que_lleva == ABRIR && fl == 164)
- hablar(TEXT471, "471.als");
- else if (objeto_que_lleva == MIRAR && fl == 163)
- hablar(TEXT472, "472.als");
- else if (objeto_que_lleva == COGER && fl == 163)
- hablar(TEXT473, "473.als");
- else if (objeto_que_lleva == MIRAR && fl == 165)
- hablar(TEXT474, "474.als");
- else if (objeto_que_lleva == MIRAR && fl == 168)
- hablar(TEXT476, "476.als");
- else if (objeto_que_lleva == COGER && fl == 168)
- hablar(TEXT477, "477.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_27(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 110)
- abre_puerta(6, 1);
- else if (objeto_que_lleva == CERRAR && fl == 110)
- cierra_puerta(6, 1);
- else if (objeto_que_lleva == ABRIR && fl == 116 && flags[23] == 0)
- hablar(TEXT419, "419.als");
- else if (objeto_que_lleva == ABRIR && fl == 116 && flags[23] == 1)
- abre_puerta(5, 3);
- else if (objeto_que_lleva == 17 && fl == 116) {
- flags[23] = 1;
- abre_puerta(5,3);
- sin_verbo();
- } else if (objeto_que_lleva == MIRAR && fl == 175)
- hablar(TEXT429, "429.als");
- else if (fl == 150)
- hablar(TEXT460, "460.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_29(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 114)
- abre_puerta(4, 1);
- else if (objeto_que_lleva == CERRAR && fl == 114)
- cierra_puerta(4, 1);
- else if (objeto_que_lleva == MIRAR && fl == 152)
- hablar(TEXT463, "463.als");
- else if (objeto_que_lleva == ABRIR && fl == 152)
- hablar(TEXT464, "464.als");
- else if (objeto_que_lleva == MIRAR && fl == 153)
- hablar(TEXT465, "465.als");
- else if (objeto_que_lleva == COGER && fl == 154)
- hablar(TEXT466, "466.als");
- else if (objeto_que_lleva == ABRIR && fl == 156)
- hablar(TEXT467, "467.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_30(int fl) {
- if (objeto_que_lleva == ABRIR && fl == 115)
- abre_puerta(4, 0);
- else if (objeto_que_lleva == CERRAR && fl == 115)
- cierra_puerta(4, 0);
- else if (objeto_que_lleva == ABRIR && fl == 144 && flags[19] == 0)
- hablar(TEXT422, "422.als");
- else if (objeto_que_lleva == ABRIR && fl == 144 && flags[19] == 1 && flags[22] == 1)
- abre_puerta(16, 1);
- else if (objeto_que_lleva == ABRIR && fl == 144 && flags[19] == 1 && flags[22] == 0) {
- abre_puerta(16, 1);
- hablar(TEXT423, "423.als");
- flags[22] = 1;
- agarra_objeto(12);
- if (flags[11] == 1 && flags[14] == 1)
- flags[18] = 1;
- if (flags[18] == 1)
- animacion_6_4();
- } else if (objeto_que_lleva == CERRAR && fl == 144)
- cierra_puerta(16, 1);
- else if (objeto_que_lleva == 13 && fl == 144) {
- hablar(TEXT424, "424.als");
- flags[19] = 1;
- } else if (objeto_que_lleva == ABRIR && fl == 157)
- hablar(TEXT468, "468.als");
- else if (objeto_que_lleva == MIRAR && fl == 158)
- hablar(TEXT469, "469.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_31(int fl) {
- if (objeto_que_lleva == COGER && fl == 145) {
- agarra_objeto(11);
- visible[1] = 0;
- flags[13] = 1;
- } else if (objeto_que_lleva == ABRIR && fl == 117)
- abre_puerta(5, 0);
- else if (objeto_que_lleva == CERRAR && fl == 117)
- cierra_puerta(5, 0);
- else if (objeto_que_lleva == MIRAR && fl == 161)
- hablar(TEXT470, "470.als");
- else if (objeto_que_lleva == ABRIR && fl == 161)
- hablar(TEXT471, "471.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_34(int fl) {
- if (objeto_que_lleva == MOVER && fl == 146)
- animacion_8_4();
- else if (objeto_que_lleva == MIRAR && fl == 146)
- hablar(TEXT458, "458.als");
- else if (objeto_que_lleva == COGER && fl == 146)
- hablar(TEXT459, "459.als");
- else if (objeto_que_lleva == ABRIR && fl == 120 && flags[25] == 1)
- abre_puerta(8, 2);
- else if (objeto_que_lleva == ABRIR && fl == 120 && flags[25] == 0) {
- abre_puerta(8, 2);
- sentido_hare = 3;
- hablar(TEXT425, "425.als");
- agarra_objeto(14);
- flags[25] = 1;
- } else if (objeto_que_lleva == CERRAR && fl == 120)
- cierra_puerta(8, 2);
- else
- hay_respuesta=0;
-}
-
-void DrasculaEngine::pantalla_35(int fl) {
- if (objeto_que_lleva == COGER && fl == 148) {
- agarra_objeto(16);
- visible[2] = 0;
- flags[14] = 1;
- if (flags[11] == 1 && flags[22] == 1)
- flags[18] = 1;
- if (flags[18] == 1)
- animacion_6_4();
- } else if (objeto_que_lleva == COGER && fl == 147) {
- hablar(TEXT426, "426.als");
- agarra_objeto(15);
- visible[1] = 0;
- flags[15] = 1;
- flags[17] = 1;
- actualiza_datos();
- } else if (objeto_que_lleva == COGER && fl == 149) {
- agarra_objeto(13);
- visible[3] = 0;
- flags[17] = 0;
- } else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::pantalla_44(int fl) {
- if (objeto_que_lleva == MIRAR && fl == 172)
- hablar(TEXT428, "428.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::habla_igorpuerta(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1){
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- refresca_pantalla();
- if (con_voces == 0)
- centra_texto(dicho, 87, 66);
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::habla_igor_peluca(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_habla[4] = {119, 158, 197, 236};
- int cara = 0;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1){
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- _rnd->getRandomNumber(3);
-
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(x_habla[cara], 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- actualiza_refresco();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 102);
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1){
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::animacion_1_4() {
- if (flags[21] == 0) {
- strcpy(nombre_obj[2], "igor");
- hablar(TEXT275, "275.als");
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
-
- pausa(3);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pausa(3);
- flags[18] = 1;
- flags[20] = 1;
-
- habla_igor_sentado(TEXTI13, "I13.als");
- habla_igor_sentado(TEXTI14, "I14.als");
- habla_igor_sentado(TEXTI15, "I15.als");
- flags[21] = 1;
- } else {
- hablar(TEXT356, "356.als");
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- VUELCA_PANTALLA(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
- pausa(2);
-
- actualiza_refresco_antes();
-
- DIBUJA_FONDO(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
-
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- flags[18] = 1;
- flags[20] = 1;
-
- hablar(TEXT276, "276.als");
- pausa(14);
- habla_igor_sentado(TEXTI6, "I6.als");
- }
-
- conversa("op_6.cal");
- flags[20] = 0;
- flags[18] = 0;
-}
-
-void DrasculaEngine::animacion_5_4(){
- sentido_hare = 3;
- lee_dibujos("anh_dr.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- lleva_al_hare(99, 160);
- lleva_al_hare(38, 177);
- hare_se_ve = 0;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(800);
- anima("bio.bin", 14);
- flags[29] = 1;
- hare_x = 95;
- hare_y = 82;
- refresca_pantalla();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- abre_puerta(2, 0);
- lee_dibujos("auxigor.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- x_igor = 100;
- y_igor = 65;
- habla_igor_frente(TEXTI29, "I29.ALS");
- habla_igor_frente(TEXTI30, "I30.als");
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos("99.alg");
- descomprime_dibujo(dir_hare_fondo, 1);
- hare_se_ve = 1;
- FundeAlNegro(0);
- sal_de_la_habitacion(0);
-}
-
-void DrasculaEngine::animacion_6_4() {
- char room[13];
-
- strcpy(room, num_room);
- strcpy(num_room, "26.alg");
- borra_pantalla();
- lee_dibujos("26.alg");
- descomprime_dibujo(dir_dibujo1, MEDIA);
- lee_dibujos("aux26.alg");
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos("auxigor.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- refresca_26_antes();
- x_igor = 104;
- y_igor = 71;
- pon_igor();
- VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pausa(40);
- habla_igor_frente(TEXTI26, "I26.als");
- strcpy(num_room, room);
- borra_pantalla();
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- lee_dibujos(pantalla_disco);
- descomprime_dibujo(dir_dibujo3, 1);
- lee_dibujos(num_room);
- descomprime_dibujo(dir_dibujo1, MEDIA);
- sin_verbo();
- refresca_pantalla();
-}
-
-void DrasculaEngine::animacion_8_4() {
- int frame;
- 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};
-
- lee_dibujos("an_8.alg");
- descomprime_dibujo(dir_hare_frente, 1);
-
- for (frame = 0; frame < 14; frame++) {
- pausa(2);
- DIBUJA_FONDO(estanteria_x[frame], estanteria_y[frame], 77, 45, 73, 72, dir_hare_frente, dir_zona_pantalla);
- VUELCA_PANTALLA(77, 45, 77, 45, 73, 72, dir_zona_pantalla);
- }
-
- lee_dibujos("96.alg");
- descomprime_dibujo(dir_hare_frente, 1);
- abre_puerta(7, 2);
-}
-
-void DrasculaEngine::animacion_9_4() {
- anima("st.bin", 14);
- FundeAlNegro(1);
-}
-
} // End of namespace Drascula
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index a55c247629..e1043561d3 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -62,12 +62,12 @@ struct DrasculaGameDescription;
#define F8 0x42
#define F9 0x43
#define F10 0x44
-#define MIRAR 1
-#define COGER 2
-#define ABRIR 3
-#define CERRAR 4
-#define HABLAR 5
-#define MOVER 6
+#define LOOK 1
+#define PICK 2
+#define OPEN 3
+#define CLOSE 4
+#define TALK 5
+#define MOVE 6
#define INICISOUND 6
#define FINALSOUND 8
#define FINDRV 9
@@ -229,8 +229,8 @@ struct DrasculaGameDescription;
#define X_N9 258
#define X_N0 267
#define ESPACIO 250
-#define ALTO_HABLA_HARE 25
-#define ANCHO_HABLA_HARE 23
+#define ALTO_TALK_HARE 25
+#define ANCHO_TALK_HARE 23
#define VON_BRAUN 1
#define AZUL_OSCURO 2
#define VERDE_CLARO 3
@@ -332,7 +332,6 @@ class DrasculaEngine : public ::Engine {
Common::KeyState _keyPressed;
protected:
-
int init();
int go();
// void shutdown();
@@ -358,8 +357,8 @@ public:
void libera_memoria();
void salir_al_dos(int r);
- void lee_dibujos(const char *);
- void descomprime_dibujo(byte *dir_escritura, int plt);
+ void loadPic(const char *);
+ void decompressPic(byte *dir_escritura, int plt);
typedef char DacPalette256[256][3];
@@ -368,12 +367,12 @@ public:
void paleta_hare();
void ActualizaPaleta();
void setvgapalette256(byte *PalBuf);
- void DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho,
+ void copyBackground(int xorg, int yorg, int xdes, int ydes, int Ancho,
int Alto, byte *Origen, byte *Destino);
- void DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho,
+ void copyRect(int xorg, int yorg, int xdes, int ydes, int Ancho,
int Alto, byte *Origen, byte *Destino);
- void DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino);
- void VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer);
+ void copyRectClip(int *Array, byte *Origen, byte *Destino);
+ void updateScreen(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer);
DacPalette256 palJuego;
DacPalette256 palHare;
@@ -401,7 +400,7 @@ public:
int hay_sb;
int nivel_osc, musica_antes, musica_room;
- char num_room[20], pantalla_disco[20];
+ char num_room[20], roomDisk[20];
char datos_actuales[20];
int objs_room;
char fondo_y_menu[20];
@@ -433,7 +432,7 @@ public:
int rompo, rompo2;
int paso_x, paso_y;
int alto_hare, ancho_hare, alto_pies;
- int alto_habla, ancho_habla;
+ int alto_talk, ancho_talk;
int suelo_x1, suelo_y1, suelo_x2, suelo_y2;
int cerca, lejos;
int sentido_final, anda_a_objeto;
@@ -472,10 +471,10 @@ public:
bool escoba();
void Negro();
- void habla_vb(const char *, const char *);
- void habla_vbpuerta(const char *dicho, const char *filename);
- void habla_ciego(const char *, const char *, const char *);
- void habla_hacker(const char *, const char *);
+ void talk_vb(const char *, const char *);
+ void talk_vbpuerta(const char *dicho, const char *filename);
+ void talk_ciego(const char *, const char *, const char *);
+ void talk_hacker(const char *, const char *);
void agarra_objeto(int);
void anda_parriba();
void anda_pabajo();
@@ -485,91 +484,91 @@ public:
void abre_puerta(int nflag, int n_puerta);
void mapa();
void buffer_teclado() { }
- void animacion_1_1();
- void animacion_2_1();
- void animacion_1_2();
- void animacion_2_2();
- void animacion_3_1();
- void animacion_4_1();
- void animacion_3_2();
- void animacion_4_2();
- void animacion_5_2();
- void animacion_6_2();
- void animacion_7_2();
- void animacion_8_2();
- void animacion_9_2();
- void animacion_10_2();
- void animacion_11_2();
- void animacion_12_2();
- void animacion_13_2();
- void animacion_14_2();
- void animacion_15_2();
- void animacion_16_2();
- void animacion_17_2();
- void animacion_18_2();
- void animacion_19_2();
- void animacion_20_2();
- void animacion_21_2();
- void animacion_22_2();
- void animacion_23_2();
- void animacion_23_anexo();
- void animacion_23_anexo2();
- void animacion_24_2();
- void animacion_25_2();
- void animacion_26_2();
- void animacion_27_2();
- void animacion_28_2();
- void animacion_29_2();
- void animacion_30_2();
- void animacion_31_2();
- void animacion_32_2();
- void animacion_33_2();
- void animacion_34_2();
- void animacion_35_2();
- void animacion_36_2();
-
- void refresca_1_antes();
- void refresca_2();
- void refresca_3();
- void refresca_3_antes();
- void refresca_4();
- void refresca_5();
- void refresca_5_antes();
- void refresca_6_antes();
- void refresca_7_antes();
- void refresca_9_antes();
- void refresca_12_antes();
- void refresca_14_antes();
- void refresca_15();
- void refresca_16_antes();
- void refresca_17_antes();
- void refresca_17();
- void refresca_18_antes();
- void refresca_18();
- void refresca_21_antes();
- void refresca_22_antes();
- void refresca_23_antes();
- void refresca_24_antes();
- void refresca_26_antes();
- void refresca_26();
- void refresca_27();
- void refresca_27_antes();
- void refresca_29();
- void refresca_29_antes();
- void refresca_30_antes();
- void refresca_31_antes();
- void refresca_34_antes();
- void refresca_35_antes();
- void refresca_31();
- void refresca_34();
- void refresca_35();
+ 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_anexo();
+ void animation_23_anexo2();
+ 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 sin_verbo();
bool para_cargar(char[]);
void carga_escoba(const char *);
- void borra_pantalla();
+ void clearRoom();
void lleva_al_hare(int, int);
void mueve_cursor();
void comprueba_objetos();
@@ -595,33 +594,33 @@ public:
void color_abc(int cl);
void centra_texto(const char *,int,int);
void comienza_sound(const char *);
- void anima(const char *animacion, int FPS);
+ void anima(const char *animation, int FPS);
void fin_sound_corte();
void FundeAlNegro(int VelocidadDeFundido);
- void pausa(int);
- void habla_dr_grande(const char *dicho, const char *filename);
+ void pause(int);
+ void talk_dr_grande(const char *dicho, const char *filename);
void pon_igor();
void pon_bj();
void pon_dr();
- void habla_igor_dch(const char *dicho, const char *filename);
- void habla_dr_dch(const char *dicho, const char *filename);
- void habla_dr_izq(const char *dicho, const char *filename);
- void habla_solo(const char *, const char *);
- void habla_igor_frente(const char *, const char *);
- void habla_tabernero(const char *dicho, const char *filename);
- void habla_igorpuerta(const char *dicho, const char *filename);
- void habla_igor_peluca(const char *dicho, const char *filename);
+ void talk_igor_dch(const char *dicho, const char *filename);
+ void talk_dr_dch(const char *dicho, const char *filename);
+ void talk_dr_izq(const char *dicho, const char *filename);
+ void talk_solo(const char *, const char *);
+ void talk_igor_frente(const char *, const char *);
+ void talk_tabernero(const char *dicho, const char *filename);
+ void talk_igorpuerta(const char *dicho, const char *filename);
+ void talk_igor_peluca(const char *dicho, const char *filename);
void hipo(int);
void fin_sound();
- void habla_bj(const char *, const char *);
- void habla_baul(const char *dicho, const char *filename);
- void hablar(const char *, const char *);
- void hablar_sinc(const char *, const char *, const char *);
+ void talk_bj(const char *, const char *);
+ void talk_baul(const char *dicho, const char *filename);
+ void talk(const char *, const char *);
+ void talk_sinc(const char *, const char *, const char *);
void cierra_puerta(int nflag, int n_puerta);
void playmusic(int p);
void stopmusic();
int music_status();
- void refresca_pantalla();
+ void updateRoom();
bool carga_partida(const char *);
void puertas_cerradas(int);
void animafin_sound_corte();
@@ -632,8 +631,8 @@ public:
void hare_claro();
void actualiza_datos();
void empieza_andar();
- void actualiza_refresco();
- void actualiza_refresco_antes();
+ void updateRefresh();
+ void updateRefresh_pre();
void pon_hare();
void menu_sin_volcar();
void barra_menu();
@@ -684,49 +683,49 @@ public:
void cuadrante_2();
void cuadrante_3();
void cuadrante_4();
- void refresca_62();
- void refresca_62_antes();
- void refresca_63();
+ void update_62();
+ void update_62_pre();
+ void update_63();
void graba_partida(char[]);
void aumenta_num_frame();
int sobre_que_objeto();
bool comprueba_banderas_menu();
- void pantalla_0();
- void pantalla_1(int);
- void pantalla_2(int);
- void pantalla_3(int);
- void pantalla_4(int);
- void pantalla_5(int);
- void pantalla_6(int);
- void pantalla_7(int);
- void pantalla_8(int);
- void pantalla_9(int);
- void pantalla_12(int);
- void pantalla_14(int);
- void pantalla_15(int);
- void pantalla_16(int);
- void pantalla_17(int);
- void pantalla_18(int);
- void pantalla_19(int);
- bool pantalla_21(int);
- void pantalla_22(int);
- void pantalla_23(int);
- void pantalla_24(int);
- void pantalla_26(int);
- void pantalla_27(int);
- void pantalla_29(int);
- void pantalla_30(int);
- void pantalla_31(int);
- void pantalla_34(int);
- void pantalla_35(int);
- void pantalla_44(int);
- void pantalla_62(int);
- void pantalla_63(int);
+ void room_0();
+ void room_1(int);
+ void room_2(int);
+ void room_3(int);
+ void room_4(int);
+ void room_5(int);
+ void room_6(int);
+ void room_7(int);
+ void room_8(int);
+ void room_9(int);
+ void room_12(int);
+ void room_14(int);
+ void room_15(int);
+ void room_16(int);
+ void room_17(int);
+ void room_18(int);
+ void room_19(int);
+ bool room_21(int);
+ void room_22(int);
+ void room_23(int);
+ void room_24(int);
+ void room_26(int);
+ void room_27(int);
+ void room_29(int);
+ void room_30(int);
+ void room_31(int);
+ void room_34(int);
+ void room_35(int);
+ void room_44(int);
+ void room_62(int);
+ void room_63(int);
void conversa(const char *);
void print_abc_opc(const char *, int, int, int);
void responde(int);
- void habla_borracho(const char *dicho, const char *filename);
- void habla_pianista(const char *dicho, const char *filename);
+ void talk_borracho(const char *dicho, const char *filename);
+ void talk_pianista(const char *dicho, const char *filename);
void MusicFadeout();
void ctvd_end();
@@ -736,97 +735,108 @@ public:
void ctvd_output(Common::File *file_handle);
void ctvd_init(int b);
void grr();
- bool pantalla_13(int fl);
- void refresca_13();
- void refresca_20();
- void animacion_1_3();
- void animacion_2_3();
- void animacion_3_3();
- void animacion_4_3();
- void animacion_5_3();
- void animacion_6_3();
- void animacion_rayo();
- void animacion_1_4();
- void animacion_2_4();
- void animacion_3_4();
- void animacion_4_4();
- void animacion_5_4();
- void animacion_6_4();
- void animacion_7_4();
- void animacion_8_4();
- void animacion_9_4();
- void animacion_1_5();
- void animacion_2_5();
- void animacion_3_5();
- void animacion_4_5();
- void animacion_5_5();
- void animacion_6_5();
- void animacion_7_5();
- void animacion_8_5();
- void animacion_9_5();
- void animacion_10_5();
- void animacion_11_5();
- void animacion_12_5();
- void animacion_13_5();
- void animacion_14_5();
- void animacion_15_5();
- void animacion_16_5();
- void animacion_17_5();
- void pantalla_49(int);
- void pantalla_53(int);
- void pantalla_54(int);
- void pantalla_55(int);
- bool pantalla_56(int);
- void refresca_53_antes();
- void refresca_54_antes();
- void refresca_49_antes();
- void refresca_56_antes();
- void refresca_50();
- void refresca_57();
- void habla_igor_sentado(const char *, const char *);
- void habla_lobo(const char *dicho, const char *filename);
- void habla_mus(const char *dicho, const char *filename);
- void pantalla_58(int);
- void pantalla_59(int);
- bool pantalla_60(int);
- void pantalla_61(int);
- void pantalla_pendulo(int);
- void refresca_pendulo();
- void refresca_58();
- void refresca_58_antes();
- void refresca_59_antes();
- void refresca_60_antes();
- void refresca_60();
- void refresca_61();
- void animacion_1_6();
- void animacion_2_6();
- void animacion_3_6();
- void animacion_4_6();
- void animacion_5_6();
- void animacion_6_6();
- void animacion_7_6();
- void animacion_9_6();
- void animacion_10_6();
- void animacion_11_6();
- void animacion_12_6();
- void animacion_13_6();
- void animacion_14_6();
- void animacion_15_6();
- void animacion_18_6();
- void animacion_19_6();
+ bool room_13(int fl);
+ void update_13();
+ void update_20();
+ 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_1_4();
+ void animation_2_4();
+ void animation_3_4();
+ void animation_4_4();
+ void animation_5_4();
+ void animation_6_4();
+ void animation_7_4();
+ void animation_8_4();
+ void animation_9_4();
+ void animation_1_5();
+ void animation_2_5();
+ void animation_3_5();
+ void animation_4_5();
+ void animation_5_5();
+ void animation_6_5();
+ void animation_7_5();
+ void animation_8_5();
+ void animation_9_5();
+ void animation_10_5();
+ void animation_11_5();
+ void animation_12_5();
+ void animation_13_5();
+ void animation_14_5();
+ 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 talk_igor_sentado(const char *, const char *);
+ void talk_lobo(const char *dicho, const char *filename);
+ void talk_mus(const char *dicho, const char *filename);
+ void room_58(int);
+ void room_59(int);
+ bool room_60(int);
+ void room_61(int);
+ void room_pendulo(int);
+ void update_pendulo();
+ 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();
+ void animation_4_6();
+ void animation_5_6();
+ void animation_6_6();
+ void animation_7_6();
+ void animation_9_6();
+ void animation_10_6();
+ void animation_11_6();
+ void animation_12_6();
+ void animation_13_6();
+ void animation_14_6();
+ void animation_15_6();
+ void animation_18_6();
+ void animation_19_6();
void activa_pendulo();
- void habla_pen(const char *, const char *);
- void habla_pen2(const char *, const char *);
- void habla_taber2(const char *, const char *);
- void habla_bj_cama(const char *dicho, const char * filename);
- void habla_htel(const char *dicho, const char *filename);
+ void talk_pen(const char *, const char *);
+ void talk_pen2(const char *, const char *);
+ void talk_taber2(const char *, const char *);
+ void talk_bj_cama(const char *dicho, const char * filename);
+ void talk_htel(const char *dicho, const char *filename);
private:
-
-public:
-
+ int _lang;
};
+extern const char *_text[][501];
+extern const char *_textd[][79];
+extern const char *_textb[][15];
+extern const char *_textbj[][29];
+extern const char *_texte[][24];
+extern const char *_texti[][33];
+extern const char *_textl[][32];
+extern const char *_textp[][20];
+extern const char *_textt[][25];
+extern const char *_textvb[][63];
+extern const char *_textsys[][4];
+extern const char *_texthis[][5];
+
} // End of namespace Drascula
#endif /* DRASCULA_H */
diff --git a/engines/drascula/module.mk b/engines/drascula/module.mk
index 51fb965915..042b227ca3 100644
--- a/engines/drascula/module.mk
+++ b/engines/drascula/module.mk
@@ -1,12 +1,16 @@
MODULE := engines/drascula
MODULE_OBJS = \
+ animation.o \
detection.o \
- drascula.o
+ drascula.o \
+ rooms.o \
+ talk.o \
+ texts.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_DRASCULA), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
new file mode 100644
index 0000000000..ba2f0d56b8
--- /dev/null
+++ b/engines/drascula/rooms.cpp
@@ -0,0 +1,2036 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+static const int mirar_t[3] = {100, 101, 54};
+static const char mirar_v[3][14] = {"100.als", "101.als", "54.als"};
+static const int poder_t[6] = {11, 109, 111, 110, 115, 116};
+static const char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"};
+
+void DrasculaEngine::room_0() {
+ if (num_ejec == 1) {
+ if (objeto_que_lleva == LOOK)
+ talk(_text[_lang][54], "54.als");
+ else if (objeto_que_lleva == MOVE)
+ talk(_text[_lang][19], "19.als");
+ else if (objeto_que_lleva == PICK)
+ talk(_text[_lang][11], "11.als");
+ else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][16], "16.als");
+ else
+ talk(_text[_lang][11],"11.als");
+ } else if (num_ejec == 2) {
+ if (objeto_que_lleva == LOOK) {
+ talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
+ c_mirar++;
+ if (c_mirar == 3)
+ c_mirar = 0;
+ } else if (objeto_que_lleva == MOVE) {
+ talk(_text[_lang][19], "19.als");
+ } else if (objeto_que_lleva == PICK) {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ } else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][16], "16.als");
+ else {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ }
+ } else if (num_ejec == 3) {
+ if (objeto_que_lleva == LOOK)
+ talk(_text[_lang][316], "316.als");
+ else if (objeto_que_lleva == MOVE)
+ talk(_text[_lang][317], "317.als");
+ else if (objeto_que_lleva == PICK)
+ talk(_text[_lang][318], "318.als");
+ else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][319], "319.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][319], "319.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][320], "320.als");
+ else
+ talk(_text[_lang][318], "318.als");
+ } else if (num_ejec == 4) {
+ if (objeto_que_lleva == LOOK) {
+ talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
+ c_mirar++;
+ if (c_mirar == 3)
+ c_mirar = 0;
+ } else if (objeto_que_lleva == MOVE)
+ talk(_text[_lang][19], "19.als");
+ else if (objeto_que_lleva == PICK) {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ } else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][16], "16.als");
+ else {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ }
+ } else if (num_ejec == 5) {
+ if (objeto_que_lleva == LOOK) {
+ talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
+ c_mirar++;
+ if (c_mirar == 3)
+ c_mirar = 0;
+ } else if (objeto_que_lleva == MOVE)
+ talk(_text[_lang][19], "19.als");
+ else if (objeto_que_lleva == PICK) {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ } else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][16], "16.als");
+ else {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ }
+ } else if (num_ejec == 6) {
+ if (objeto_que_lleva == LOOK) {
+ talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
+ c_mirar++;
+ if (c_mirar == 3)
+ c_mirar = 0;
+ } else if (objeto_que_lleva == MOVE)
+ talk(_text[_lang][19], "19.als");
+ else if (objeto_que_lleva == PICK) {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ } else if (objeto_que_lleva == OPEN)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == CLOSE)
+ talk(_text[_lang][9], "9.als");
+ else if (objeto_que_lleva == TALK)
+ talk(_text[_lang][16], "16.als");
+ else {
+ talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
+ c_poder++;
+ if (c_poder == 6)
+ c_poder = 0;
+ }
+ }
+}
+
+void DrasculaEngine::room_1(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 118) {
+ talk(_text[_lang][1], "1.als");
+ pause(10);
+ talk(_text[_lang][2], "2.als");
+ } else if (objeto_que_lleva == PICK && fl == 118)
+ talk(_text[_lang][5], "5.als");
+ else if (objeto_que_lleva == OPEN && fl == 118)
+ talk(_text[_lang][3], "3.als");
+ else if (objeto_que_lleva == CLOSE && fl == 118)
+ talk(_text[_lang][4], "4.als");
+ else if (objeto_que_lleva == TALK && fl == 118)
+ talk(_text[_lang][6], "6.als");
+ else if (objeto_que_lleva == LOOK && fl == 119)
+ talk(_text[_lang][8], "8.als");
+ else if (objeto_que_lleva == MOVE && fl == 119)
+ talk(_text[_lang][13], "13.als");
+ else if (objeto_que_lleva == CLOSE && fl == 119)
+ talk(_text[_lang][10], "10.als");
+ else if (objeto_que_lleva == TALK && fl == 119)
+ talk(_text[_lang][12], "12.als");
+ else if (objeto_que_lleva == LOOK && fl == 120 && flags[8] == 0)
+ talk(_text[_lang][14], "14.als");
+ else if (objeto_que_lleva == MOVE && fl == 120)
+ talk(_text[_lang][13], "13.als");
+ else if (objeto_que_lleva == OPEN && fl == 120)
+ talk(_text[_lang][18], "18.als");
+ else if (objeto_que_lleva == TALK && fl == 120)
+ talk(_text[_lang][15], "15.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_3(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 129)
+ talk(_text[_lang][21], "21.als");
+ else if (objeto_que_lleva == PICK && fl == 129)
+ talk(_text[_lang][5], "5.als");
+ else if (objeto_que_lleva == MOVE && fl == 129)
+ talk(_text[_lang][24], "24.als");
+ else if (objeto_que_lleva == OPEN && fl == 129)
+ talk(_text[_lang][22], "22.als");
+ else if (objeto_que_lleva == CLOSE && fl == 129)
+ talk(_text[_lang][10], "10.als");
+ else if (objeto_que_lleva == TALK && fl == 129) {
+ talk(_text[_lang][23], "23.als");
+ pause(6);
+ talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
+ } else if (objeto_que_lleva == LOOK && fl == 131)
+ talk(_text[_lang][27], "27.als");
+ else if (objeto_que_lleva == PICK && fl == 131)
+ talk(_text[_lang][5], "5.als");
+ else if (objeto_que_lleva == MOVE && fl == 131)
+ talk(_text[_lang][24], "24.als");
+ else if (objeto_que_lleva == OPEN && fl == 131)
+ talk(_text[_lang][22], "22.als");
+ else if (objeto_que_lleva == CLOSE && fl == 131)
+ talk(_text[_lang][10], "10.als");
+ else if (objeto_que_lleva == TALK && fl == 131)
+ talk(_text[_lang][23], "23.als");
+ else if (objeto_que_lleva == LOOK && fl == 132)
+ talk(_text[_lang][28], "28.als");
+ else if (objeto_que_lleva == PICK && fl == 132)
+ talk(_text[_lang][5], "5.als");
+ else if (objeto_que_lleva == MOVE && fl == 132)
+ talk(_text[_lang][24], "24.als");
+ else if (objeto_que_lleva == OPEN && fl == 132)
+ talk(_text[_lang][22], "22.als");
+ else if (objeto_que_lleva == CLOSE && fl == 132)
+ talk(_text[_lang][10], "10.als");
+ else if (objeto_que_lleva == TALK && fl == 132)
+ talk(_text[_lang][23], "23.als");
+ else if (objeto_que_lleva == LOOK && fl == 133)
+ talk(_text[_lang][321], "321.als");
+ else if (objeto_que_lleva == PICK && fl == 133)
+ talk(_text[_lang][31], "31.als");
+ else if (objeto_que_lleva == MOVE && fl == 133)
+ talk(_text[_lang][34], "34.als");
+ else if (objeto_que_lleva == OPEN && fl == 133)
+ talk(_text[_lang][30], "30.als");
+ else if (objeto_que_lleva == CLOSE && fl == 133)
+ talk(_text[_lang][10], "10.als");
+ else if (objeto_que_lleva == TALK && fl == 133) {
+ talk_sinc(_text[_lang][322], "322.als", "13333334125433333333");
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(25);
+ talk(_text[_lang][33], "33.als");
+ } else if (objeto_que_lleva == LOOK && fl == 165) {
+ talk(_text[_lang][149], "149.als");
+ talk(_text[_lang][150], "150.als");
+ } else if (objeto_que_lleva == PICK && fl == 165) {
+ copyBackground(0, 0, 0,0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(4);
+ agarra_objeto(10);
+ flags[3] = 1;
+ visible[8] = 0;
+ } else if (objeto_que_lleva == LOOK && fl == 166)
+ talk(_text[_lang][55], "55.als");
+ else if (objeto_que_lleva == PICK && fl == 166)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 0) {
+ animation_7_2();
+ agarra_objeto(8);
+ } else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 1)
+ talk(_text[_lang][323], "323.als");
+ else if (objeto_que_lleva == LOOK && fl == 211)
+ talk(_text[_lang][184], "184.als");
+ else if (objeto_que_lleva == TALK && fl == 211) {
+ talk(_text[_lang][185], "185.als");
+ talk(_text[_lang][186], "186.als");
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_4(int fl) {
+ if (objeto_que_lleva == MOVE && fl == 189 && flags[34] == 0) {
+ talk(_text[_lang][327], "327.als");
+ agarra_objeto(13);
+ flags[34] = 1;
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+ } else if (objeto_que_lleva == LOOK && fl == 189)
+ talk(_text[_lang][182], "182.als");
+ else if (objeto_que_lleva == LOOK && fl == 207)
+ talk(_text[_lang][175], "175.als");
+ else if (objeto_que_lleva == TALK && fl == 207)
+ talk(_text[_lang][176], "176.als");
+ else if (objeto_que_lleva == LOOK && fl == 208)
+ talk(_text[_lang][177], "177.als");
+ else if (objeto_que_lleva == LOOK && fl == 209)
+ talk(_text[_lang][179], "179.als");
+ else if (objeto_que_lleva == LOOK && fl == 210)
+ talk(_text[_lang][180], "180.als");
+ else if (objeto_que_lleva == OPEN && fl == 210)
+ talk(_text[_lang][181], "181.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_5(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 136 && flags[8]==0) talk(_text[_lang][14], "14.als");
+ else if (objeto_que_lleva == MOVE && fl == 136)
+ talk(_text[_lang][13], "13.als");
+ else if (objeto_que_lleva == OPEN && fl == 136)
+ talk(_text[_lang][18], "18.als");
+ else if (objeto_que_lleva == TALK && fl == 136)
+ talk(_text[_lang][15], "15.als");
+ else if (objeto_que_lleva == 10 && fl == 136) {
+ animation_5_2();
+ resta_objeto(10);
+ } else if (objeto_que_lleva == LOOK && fl == 212)
+ talk(_text[_lang][187], "187.als");
+ else if (objeto_que_lleva == TALK && fl == 212)
+ talk(_text[_lang][188], "188.als");
+ else if (objeto_que_lleva == LOOK && fl == 213)
+ talk(_text[_lang][189], "189.als");
+ else if (objeto_que_lleva == OPEN && fl == 213)
+ talk(_text[_lang][190], "190.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_6(int fl){
+ if (objeto_que_lleva == LOOK && fl==144) {
+ talk(_text[_lang][41], "41.als");
+ talk(_text[_lang][42], "42.als");
+ } else if (objeto_que_lleva == PICK && fl == 144)
+ talk(_text[_lang][43], "43.als");
+ else if (objeto_que_lleva == LOOK && fl == 138)
+ talk(_text[_lang][35], "35.als");
+ else if (objeto_que_lleva == OPEN && fl == 138)
+ abre_puerta(0, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 138)
+ cierra_puerta(0, 1);
+ else if (objeto_que_lleva == TALK && fl == 138)
+ talk(_text[_lang][6], "6.als");
+ else if (objeto_que_lleva == LOOK && fl == 143)
+ talk(_text[_lang][37], "37.als");
+ else if (objeto_que_lleva == PICK && fl == 143)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == MOVE && fl == 143)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == OPEN && fl == 143 && flags[2] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(10);
+ comienza_sound("s3.als");
+ flags[2] = 1;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ fin_sound();
+ } else if (objeto_que_lleva == CLOSE && fl == 143 && flags[2] == 1) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ flags[2] = 0;
+ updateRefresh_pre();
+ copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(5);
+ comienza_sound("s4.als");
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ fin_sound();
+ } else if (objeto_que_lleva == TALK && fl == 143)
+ talk(_text[_lang][38], "38.als");
+ else if (objeto_que_lleva == LOOK && fl == 139)
+ talk(_text[_lang][36], "36.als");
+ else if (objeto_que_lleva == OPEN && fl == 139 && flags[1] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(19);
+ comienza_sound("s3.als");
+ flags[1] = 1;
+ visible[4] = 1;
+ visible[2] = 0;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ fin_sound();
+ } else if (objeto_que_lleva == LOOK && fl == 140)
+ talk(_text[_lang][147], "147.als");
+ else if (objeto_que_lleva == PICK && fl == 140) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(19);
+ agarra_objeto(9);
+ visible[4] = 0;
+ flags[10] = 1;
+ } else if (objeto_que_lleva == OPEN && fl == 140)
+ hay_respuesta = 1;
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_7(int fl){
+ if (objeto_que_lleva == LOOK && fl == 169)
+ talk(_text[_lang][44], "44.als");
+ else if (objeto_que_lleva == LOOK && fl == 164)
+ talk(_text[_lang][35], "35.als" );
+ else if (objeto_que_lleva == PICK && fl == 190) {
+ agarra_objeto(17);
+ flags[35] = 1;
+ visible[3] = 0;
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_8(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 147 && flags[7] == 0) {
+ talk(_text[_lang][58], "58.als");
+ agarra_objeto(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 (objeto_que_lleva == LOOK && fl == 147)
+ talk(_text[_lang][59], "59.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_9(int fl){
+ if (objeto_que_lleva == LOOK && fl == 150)
+ talk(_text[_lang][35], "35.als");
+ else if (objeto_que_lleva == TALK && fl == 150)
+ talk(_text[_lang][6], "6.als");
+ else if (objeto_que_lleva == LOOK && fl == 51)
+ talk(_text[_lang][60], "60.als");
+ else if (objeto_que_lleva == TALK && fl == 51 && flags[4] == 0)
+ animation_4_2();
+ else if (objeto_que_lleva == TALK && fl == 51 && flags[4] == 1)
+ animation_33_2();
+ else if (objeto_que_lleva == 7 && fl == 51) {
+ animation_6_2();
+ resta_objeto(7);
+ agarra_objeto(14);}
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_12(int fl){
+ if (objeto_que_lleva == LOOK && fl == 154)
+ talk(_text[_lang][329], "329.als");
+ else if (objeto_que_lleva == TALK && fl == 154)
+ talk(_text[_lang][330], "330.als");
+ else if (objeto_que_lleva == MOVE && fl == 155)
+ talk(_text[_lang][48], "48.als");
+ else if (objeto_que_lleva == TALK && fl == 155)
+ talk(_text[_lang][331], "331.als");
+ else if (objeto_que_lleva == LOOK && fl == 156)
+ talk(_text[_lang][35], "35.als");
+ else if (objeto_que_lleva == MOVE && fl == 156)
+ talk(_text[_lang][48], "48.als");
+ else if (objeto_que_lleva == TALK && fl == 156)
+ talk(_text[_lang][50], "50.als");
+ else if (objeto_que_lleva == OPEN && fl == 156)
+ abre_puerta(16, 4);
+ else if (objeto_que_lleva == CLOSE && fl == 156)
+ cierra_puerta(16, 4);
+ else
+ hay_respuesta = 0;
+}
+
+bool DrasculaEngine::room_13(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 51) {
+ talk(_text[_lang][411], "411.als");
+ sentido_hare = 3;
+ talk(_text[_lang][412], "412.als");
+ strcpy(nombre_obj[1], "yoda");
+ } else if (objeto_que_lleva == TALK && fl == 51)
+ conversa("op_7.cal");
+ else if (objeto_que_lleva == 19 && fl == 51)
+ animation_1_3();
+ else if (objeto_que_lleva == 9 && fl == 51) {
+ animation_2_3();
+ return true;
+ } else
+ hay_respuesta = 0;
+ return false;
+}
+
+void DrasculaEngine::room_14(int fl) {
+ if (objeto_que_lleva == TALK && fl == 54 && flags[39] == 0)
+ animation_12_2();
+ else if (objeto_que_lleva == TALK && fl == 54 && flags[39] == 1)
+ talk(_text[_lang][109], "109.als");
+ else if (objeto_que_lleva == 12 && fl == 54)
+ animation_26_2();
+ else if (objeto_que_lleva == TALK && fl == 52 && flags[5] == 0)
+ animation_11_2();
+ else if (objeto_que_lleva == TALK && fl == 52 && flags[5] == 1)
+ animation_36_2();
+ else if (objeto_que_lleva == TALK && fl == 53)
+ animation_13_2();
+ else if (objeto_que_lleva == LOOK && fl == 200)
+ talk(_text[_lang][165], "165.als");
+ else if (objeto_que_lleva == LOOK && fl == 201)
+ talk(_text[_lang][166], "166.als");
+ else if (objeto_que_lleva == LOOK && fl == 202)
+ talk(_text[_lang][167], "167.als");
+ else if (objeto_que_lleva == LOOK && fl == 203)
+ talk(_text[_lang][168], "168.als");
+ else if (objeto_que_lleva == PICK && fl == 203)
+ talk(_text[_lang][170], "170.als");
+ else if (objeto_que_lleva == MOVE && fl == 203)
+ talk(_text[_lang][170], "170.als");
+ else if (objeto_que_lleva == TALK && fl == 203)
+ talk(_text[_lang][169], "169.als");
+ else if (objeto_que_lleva == LOOK && fl == 204)
+ talk(_text[_lang][171], "171.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_15(int fl) {
+ if (objeto_que_lleva == TALK && fl == 188)
+ talk(_text[_lang][333], "333.als");
+ else if (objeto_que_lleva == LOOK && fl == 188)
+ talk(_text[_lang][334], "334.als");
+ else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 0)
+ talk(_text[_lang][335], "335.als");
+ else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 1) {
+ talk(_text[_lang][336], "336.als");
+ sentido_hare = 3;
+ talk(_text[_lang][337], "337.als");
+ talk_sinc(_text[_lang][46], "46.als", "4442444244244");
+ sentido_hare = 1;
+ } else if (objeto_que_lleva == 18 && fl == 188 && flags[26] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyRect(133, 135, hare_x + 6, hare_y, 39, 63, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ comienza_sound("s8.als");
+ fin_sound();
+ talk(_text[_lang][338], "338.als");
+ flags[27] = 0;
+ agarra_objeto(19);
+ resta_objeto(18);
+ } else if (objeto_que_lleva == MOVE && fl == 188 && flags[27] == 0) {
+ animation_34_2();
+ talk(_text[_lang][339], "339.als");
+ agarra_objeto(16);
+ flags[26] = 1;
+ flags[27] = 1;
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+ } else if (objeto_que_lleva == LOOK && fl == 205)
+ talk(_text[_lang][172], "172.als");
+ else if (objeto_que_lleva == LOOK && fl == 206)
+ talk(_text[_lang][173], "173.als");
+ else if (objeto_que_lleva == MOVE && fl == 206)
+ talk(_text[_lang][174], "174.als");
+ else if (objeto_que_lleva == OPEN && fl == 206)
+ talk(_text[_lang][174], "174.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_16(int fl) {
+ if (objeto_que_lleva == TALK && fl == 163)
+ talk(_text[_lang][6], "6.als");
+ else if (objeto_que_lleva == OPEN && fl == 163)
+ abre_puerta(17, 0);
+ else if (objeto_que_lleva == CLOSE && fl == 163)
+ cierra_puerta(17, 0);
+ else if (objeto_que_lleva == LOOK && fl == 183)
+ talk(_text[_lang][340], "340.als");
+ else if (objeto_que_lleva == TALK && fl == 183) {
+ talk(_text[_lang][341], "341.als");
+ pause(10);
+ talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
+ pause(3);
+ talk_baul("bla, bla, bla.", "d83.als");
+ } else if (objeto_que_lleva == OPEN && fl == 183) {
+ abre_puerta(19, NO_PUERTA);
+ if (flags[20] == 0) {
+ flags[20] = 1;
+ sentido_hare = 3;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][342], "342.als");
+ agarra_objeto(22);
+ }
+ } else if (objeto_que_lleva == CLOSE && fl == 183)
+ cierra_puerta(19, NO_PUERTA);
+ else if (objeto_que_lleva == LOOK && fl == 185)
+ talk(_text[_lang][37], "37.als");
+ else if (objeto_que_lleva == PICK && fl == 185)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == MOVE && fl == 185)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == TALK && fl == 185)
+ talk(_text[_lang][38], "38.als");
+ else if (objeto_que_lleva == LOOK && fl == 187) {
+ talk(_text[_lang][343], "343.als");
+ sentido_hare = 3;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk(_text[_lang][344], "344.als");
+ } else if (objeto_que_lleva == TALK && fl == 187)
+ talk(_text[_lang][345], "345.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_17(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 177)
+ talk(_text[_lang][35], "35.als");
+ else if (objeto_que_lleva == TALK && fl == 177 && flags[18] == 0)
+ talk(_text[_lang][6], "6.als");
+ else if (objeto_que_lleva == TALK && fl == 177 && flags[18] == 1)
+ animation_18_2();
+ else if (objeto_que_lleva == OPEN && fl == 177 && flags[18] == 1)
+ talk(_text[_lang][346], "346.als");
+ else if (objeto_que_lleva == OPEN && fl == 177 && flags[14] == 0 && flags[18] == 0)
+ animation_22_2();
+ else if (objeto_que_lleva == OPEN && fl == 177 && flags[14] == 1)
+ abre_puerta(15, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 177 && flags[14] == 1)
+ cierra_puerta(15, 1);
+ else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
+ talk(_text[_lang][347], "347.als");
+ flags[29] = 1;
+ agarra_objeto(23);
+ resta_objeto(11);
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_18(int fl) {
+ if (objeto_que_lleva == TALK && fl == 55 && flags[36] == 0)
+ animation_24_2();
+ else if (objeto_que_lleva == TALK && fl == 55 && flags[36] == 1)
+ talk(_text[_lang][109], "109.als");
+ else if (objeto_que_lleva == LOOK && fl == 181)
+ talk(_text[_lang][348], "348.als");
+ else if (objeto_que_lleva == PICK && fl == 182) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(4);
+ agarra_objeto(12);
+ visible[2] = 0;
+ flags[28] = 1;
+ } else if (objeto_que_lleva == LOOK && fl == 182)
+ talk(_text[_lang][154], "154.als");
+ else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 0 && flags[33] == 1)
+ talk(_text[_lang][349], "349.als");
+ else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 0 && flags[33] == 1)
+ talk(_text[_lang][349], "349.als");
+ else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 0 && flags[33] == 1)
+ talk(_text[_lang][349], "349.als");
+ else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 0 && flags[33] == 1)
+ talk(_text[_lang][349], "349.als");
+ else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 0 && flags[33] == 1)
+ talk(_text[_lang][349], "349.als");
+ else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 1 && flags[33] == 1)
+ animation_24_2();
+ else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 1 && flags[33] == 1)
+ animation_24_2();
+ else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 1 && flags[33] == 1)
+ animation_24_2();
+ else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 1 && flags[33] == 1)
+ animation_24_2();
+ else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 1 && flags[33] == 1)
+ animation_24_2();
+ else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
+ sentido_hare = 3;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ copyRect(1, 1, hare_x - 1, hare_y + 3, 42, 67, dir_dibujo2, dir_zona_pantalla);
+ updateRefresh();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(6);
+ talk(_text[_lang][347], "347.als");
+ flags[29] = 1;
+ agarra_objeto(23);
+ resta_objeto(11);
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_19(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 214)
+ talk(_text[_lang][191], "191.als");
+ else
+ hay_respuesta = 0;
+}
+
+bool DrasculaEngine::room_21(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 101 && flags[28] == 0)
+ talk(_text[_lang][419], "419.als");
+ else if (objeto_que_lleva == OPEN && fl == 101 && flags[28] == 1)
+ abre_puerta(0, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 101)
+ cierra_puerta(0, 1);
+ else if(objeto_que_lleva == PICK && fl == 141) {
+ agarra_objeto(19);
+ visible[2] = 0;
+ flags[10] = 1;
+ } else if(objeto_que_lleva == 7 && fl == 101) {
+ flags[28] = 1;
+ abre_puerta(0, 1);
+ sin_verbo();
+ } else if (objeto_que_lleva == 21 && fl == 179) {
+ animation_9_4();
+ return true;
+ } else
+ hay_respuesta = 0;
+
+ return false;
+}
+
+void DrasculaEngine::room_22(int fl) {
+ if (objeto_que_lleva == PICK && fl == 140)
+ talk(_text[_lang][7], "7.als");
+ else if (objeto_que_lleva == 11 && fl == 140) {
+ agarra_objeto(18);
+ visible[1] = 0;
+ flags[24] = 1;
+ } else if (objeto_que_lleva == 22 && fl == 52) {
+ anima("up.bin",14);
+ flags[26]=1;
+ comienza_sound("s1.als");
+ hipo(14);
+ fin_sound();
+ sin_verbo();
+ resta_objeto(22);
+ actualiza_datos();
+ sentido_hare = 3;
+ talk(_text[_lang][499], "499.als");
+ talk(_text[_lang][500], "500.als");
+ } else if (objeto_que_lleva == LOOK && fl == 52)
+ talk(_text[_lang][497], "497.als");
+ else if (objeto_que_lleva == TALK && fl == 52)
+ talk(_text[_lang][498], "498.als");
+ else if (objeto_que_lleva == PICK && fl == 180 && flags[26] == 0)
+ talk(_text[_lang][420], "420.als");
+ else if (objeto_que_lleva == PICK && fl == 180 && flags[26] == 1) {
+ agarra_objeto(7);
+ visible[3] = 0;
+ flags[27] = 1;
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_23(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 103) {
+ abre_puerta(0, 0);
+ actualiza_datos();
+ } else if(objeto_que_lleva == CLOSE && fl == 103) {
+ cierra_puerta(0, 0);
+ actualiza_datos();
+ } else if(objeto_que_lleva == OPEN && fl == 104)
+ abre_puerta(1, 1);
+ else if(objeto_que_lleva == CLOSE && fl == 104)
+ cierra_puerta(1, 1);
+ else if(objeto_que_lleva == PICK && fl == 142) {
+ agarra_objeto(8);
+ visible[2] = 0;
+ flags[11] = 1;
+ if (flags[22] == 1 && flags[14] == 1)
+ flags[18] = 1;
+ if (flags[18] == 1)
+ animation_6_4();
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_24(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 105)
+ abre_puerta(1, 0);
+ else if (objeto_que_lleva == CLOSE && fl == 105)
+ cierra_puerta(1, 0);
+ else if (objeto_que_lleva == OPEN && fl == 106)
+ abre_puerta(2, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 106)
+ cierra_puerta(2, 1);
+ else if (objeto_que_lleva == LOOK && fl == 151)
+ talk(_text[_lang][461], "461.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_26(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 107 && flags[30] == 0)
+ abre_puerta(2, 0);
+ else if (objeto_que_lleva == OPEN && fl == 107 && flags[30] == 1)
+ talk(_text[_lang][421], "421.als");
+ else if (objeto_que_lleva == CLOSE && fl == 107)
+ cierra_puerta(2, 0);
+ else if (objeto_que_lleva == 10 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ animation_5_4();
+ else if (objeto_que_lleva == 8 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ animation_5_4();
+ else if (objeto_que_lleva == 12 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ animation_5_4();
+ else if (objeto_que_lleva == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ animation_5_4();
+ else if (objeto_que_lleva == PICK && fl == 143 && flags[18] == 1) {
+ lleva_al_hare(260, 180);
+ agarra_objeto(10);
+ visible[1] = 0;
+ flags[12] = 1;
+ cierra_puerta(2, 0);
+ sentido_hare = 2;
+ talk_igorpuerta(_texti[_lang][27], "I27.als");
+ flags[30] = 1;
+ talk_igorpuerta(_texti[_lang][28], "I28.als");
+ lleva_al_hare(153, 180);
+ } else if (objeto_que_lleva == PICK && fl == 143 && flags[18] == 0) {
+ lleva_al_hare(260, 180);
+ copyBackground(80, 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(199, 94, 199, 94, 38, 27, dir_zona_pantalla);
+ pause(3);
+ talk_igor_peluca(_texti[_lang][25], "I25.als");
+ lleva_al_hare(153, 180);
+ } else if (objeto_que_lleva == TALK && fl == 51)
+ animation_1_4();
+ else if (objeto_que_lleva == OPEN && fl == 167)
+ talk(_text[_lang][467], "467.als");
+ else if (objeto_que_lleva == LOOK && fl == 164)
+ talk(_text[_lang][470], "470.als");
+ else if (objeto_que_lleva == OPEN && fl == 164)
+ talk(_text[_lang][471], "471.als");
+ else if (objeto_que_lleva == LOOK && fl == 163)
+ talk(_text[_lang][472], "472.als");
+ else if (objeto_que_lleva == PICK && fl == 163)
+ talk(_text[_lang][473], "473.als");
+ else if (objeto_que_lleva == LOOK && fl == 165)
+ talk(_text[_lang][474], "474.als");
+ else if (objeto_que_lleva == LOOK && fl == 168)
+ talk(_text[_lang][476], "476.als");
+ else if (objeto_que_lleva == PICK && fl == 168)
+ talk(_text[_lang][477], "477.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_27(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 110)
+ abre_puerta(6, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 110)
+ cierra_puerta(6, 1);
+ else if (objeto_que_lleva == OPEN && fl == 116 && flags[23] == 0)
+ talk(_text[_lang][419], "419.als");
+ else if (objeto_que_lleva == OPEN && fl == 116 && flags[23] == 1)
+ abre_puerta(5, 3);
+ else if (objeto_que_lleva == 17 && fl == 116) {
+ flags[23] = 1;
+ abre_puerta(5,3);
+ sin_verbo();
+ } else if (objeto_que_lleva == LOOK && fl == 175)
+ talk(_text[_lang][429], "429.als");
+ else if (fl == 150)
+ talk(_text[_lang][460], "460.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_29(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 114)
+ abre_puerta(4, 1);
+ else if (objeto_que_lleva == CLOSE && fl == 114)
+ cierra_puerta(4, 1);
+ else if (objeto_que_lleva == LOOK && fl == 152)
+ talk(_text[_lang][463], "463.als");
+ else if (objeto_que_lleva == OPEN && fl == 152)
+ talk(_text[_lang][464], "464.als");
+ else if (objeto_que_lleva == LOOK && fl == 153)
+ talk(_text[_lang][465], "465.als");
+ else if (objeto_que_lleva == PICK && fl == 154)
+ talk(_text[_lang][466], "466.als");
+ else if (objeto_que_lleva == OPEN && fl == 156)
+ talk(_text[_lang][467], "467.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_30(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 115)
+ abre_puerta(4, 0);
+ else if (objeto_que_lleva == CLOSE && fl == 115)
+ cierra_puerta(4, 0);
+ else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 0)
+ talk(_text[_lang][422], "422.als");
+ else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 1 && flags[22] == 1)
+ abre_puerta(16, 1);
+ else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 1 && flags[22] == 0) {
+ abre_puerta(16, 1);
+ talk(_text[_lang][423], "423.als");
+ flags[22] = 1;
+ agarra_objeto(12);
+ if (flags[11] == 1 && flags[14] == 1)
+ flags[18] = 1;
+ if (flags[18] == 1)
+ animation_6_4();
+ } else if (objeto_que_lleva == CLOSE && fl == 144)
+ cierra_puerta(16, 1);
+ else if (objeto_que_lleva == 13 && fl == 144) {
+ talk(_text[_lang][424], "424.als");
+ flags[19] = 1;
+ } else if (objeto_que_lleva == OPEN && fl == 157)
+ talk(_text[_lang][468], "468.als");
+ else if (objeto_que_lleva == LOOK && fl == 158)
+ talk(_text[_lang][469], "469.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_31(int fl) {
+ if (objeto_que_lleva == PICK && fl == 145) {
+ agarra_objeto(11);
+ visible[1] = 0;
+ flags[13] = 1;
+ } else if (objeto_que_lleva == OPEN && fl == 117)
+ abre_puerta(5, 0);
+ else if (objeto_que_lleva == CLOSE && fl == 117)
+ cierra_puerta(5, 0);
+ else if (objeto_que_lleva == LOOK && fl == 161)
+ talk(_text[_lang][470], "470.als");
+ else if (objeto_que_lleva == OPEN && fl == 161)
+ talk(_text[_lang][471], "471.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_34(int fl) {
+ if (objeto_que_lleva == MOVE && fl == 146)
+ animation_8_4();
+ else if (objeto_que_lleva == LOOK && fl == 146)
+ talk(_text[_lang][458], "458.als");
+ else if (objeto_que_lleva == PICK && fl == 146)
+ talk(_text[_lang][459], "459.als");
+ else if (objeto_que_lleva == OPEN && fl == 120 && flags[25] == 1)
+ abre_puerta(8, 2);
+ else if (objeto_que_lleva == OPEN && fl == 120 && flags[25] == 0) {
+ abre_puerta(8, 2);
+ sentido_hare = 3;
+ talk(_text[_lang][425], "425.als");
+ agarra_objeto(14);
+ flags[25] = 1;
+ } else if (objeto_que_lleva == CLOSE && fl == 120)
+ cierra_puerta(8, 2);
+ else
+ hay_respuesta=0;
+}
+
+void DrasculaEngine::room_35(int fl) {
+ if (objeto_que_lleva == PICK && fl == 148) {
+ agarra_objeto(16);
+ visible[2] = 0;
+ flags[14] = 1;
+ if (flags[11] == 1 && flags[22] == 1)
+ flags[18] = 1;
+ if (flags[18] == 1)
+ animation_6_4();
+ } else if (objeto_que_lleva == PICK && fl == 147) {
+ talk(_text[_lang][426], "426.als");
+ agarra_objeto(15);
+ visible[1] = 0;
+ flags[15] = 1;
+ flags[17] = 1;
+ actualiza_datos();
+ } else if (objeto_que_lleva == PICK && fl == 149) {
+ agarra_objeto(13);
+ visible[3] = 0;
+ flags[17] = 0;
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_44(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 172)
+ talk(_text[_lang][428], "428.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_49(int fl){
+ if (objeto_que_lleva == TALK && fl ==51)
+ conversa("op_9.cal");
+ else if (objeto_que_lleva == LOOK && fl == 51)
+ talk(_text[_lang][132], "132.als");
+ else if ((objeto_que_lleva == 8 && fl == 51) || (objeto_que_lleva == 8 && fl == 203))
+ animation_5_5();
+ else if (objeto_que_lleva == LOOK && fl == 200)
+ talk(_text[_lang][133], "133.als");
+ else if (objeto_que_lleva == TALK && fl == 200)
+ talk(_text[_lang][134], "134.als");
+ else if (objeto_que_lleva == LOOK && fl == 201)
+ talk(_text[_lang][135], "135.als");
+ else if (objeto_que_lleva == LOOK && fl == 203)
+ talk(_text[_lang][137], "137.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_53(int fl) {
+ if (objeto_que_lleva == PICK && fl == 120) {
+ agarra_objeto(16);
+ visible[3] = 0;
+ } else if (objeto_que_lleva == LOOK && fl == 121)
+ talk(_text[_lang][128], "128.als");
+ else if (objeto_que_lleva == LOOK && fl == 209)
+ talk(_text[_lang][129], "129.als");
+ else if (objeto_que_lleva == MOVE && fl == 123)
+ animation_11_5();
+ else if (objeto_que_lleva == LOOK && fl == 52)
+ talk(_text[_lang][447], "447.als");
+ else if (objeto_que_lleva == TALK && fl == 52)
+ talk(_text[_lang][131], "131.als");
+ else if (objeto_que_lleva == 12 && fl == 52)
+ animation_10_5();
+ else if (objeto_que_lleva == 15 && fl == 52)
+ animation_9_5();
+ else if (objeto_que_lleva == 16 && fl == 121) {
+ flags[2] = 1;
+ sin_verbo();
+ actualiza_datos();
+ } else if (objeto_que_lleva == 16) {
+ talk(_text[_lang][439], "439.als");
+ sin_verbo();
+ visible[3] = 1;
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_54(int fl) {
+ if ((objeto_que_lleva == TALK && fl == 118) || (objeto_que_lleva == LOOK && fl == 118 && flags[0] == 0))
+ animation_1_5();
+ else if (objeto_que_lleva == LOOK && fl == 118 && flags[0]==1)
+ talk(_text[_lang][124], "124.als");
+ else if (objeto_que_lleva == LOOK && fl == 53)
+ talk(_text[_lang][127], "127.als");
+ else if (objeto_que_lleva == TALK && fl == 53 && flags[14] == 0) {
+ talk(_text[_lang][288], "288.als");
+ flags[12] = 1;
+ pause(10);
+ talk_mus(_texte[_lang][1], "E1.als");
+ talk(_text[_lang][289], "289.als");
+ talk_mus(_texte[_lang][2], "E2.als");
+ talk_mus(_texte[_lang][3], "E3.als");
+ conversa("op_10.cal");
+ flags[12] = 0;
+ flags[14] = 1;
+ } else if (objeto_que_lleva == TALK && fl == 53 && flags[14] == 1)
+ talk(_text[_lang][109], "109.als");
+ else if (objeto_que_lleva == PICK && fl == 9999 && flags[13] == 0) {
+ agarra_objeto(8);
+ flags[13] = 1;
+ talk_mus(_texte[_lang][10], "e10.als");
+ actualiza_datos();
+ } else if (objeto_que_lleva == OPEN && fl == 119)
+ talk(_text[_lang][125], "125.als");
+ else if (objeto_que_lleva == LOOK && fl == 119)
+ talk(_text[_lang][126], "126.als");
+ else if (objeto_que_lleva == 10 && fl == 119) {
+ pause(4);
+ talk(_text[_lang][436], "436.als");
+ sin_verbo();
+ resta_objeto(10);
+ } else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_55(int fl) {
+ if (objeto_que_lleva == PICK && fl == 122) {
+ agarra_objeto(12);
+ flags[8] = 1;
+ actualiza_datos();
+ } else if (objeto_que_lleva == LOOK && fl == 122)
+ talk(_text[_lang][138], "138.als");
+ else if (objeto_que_lleva == LOOK && fl == 204)
+ talk(_text[_lang][139], "139.als");
+ else if (objeto_que_lleva == LOOK && fl == 205)
+ talk(_text[_lang][140], "140.als");
+ else if (fl == 206) {
+ comienza_sound("s11.als");
+ anima("det.bin", 17);
+ fin_sound();
+ lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6);
+ } else
+ hay_respuesta = 0;
+}
+
+bool DrasculaEngine::room_56(int fl) {
+ if (objeto_que_lleva == OPEN && fl == 124) {
+ animation_14_5();
+ return true;
+ } else if (objeto_que_lleva == LOOK && fl == 124)
+ talk(_text[_lang][450], "450.als");
+ else if (objeto_que_lleva == OPEN && fl == 207)
+ talk(_text[_lang][141], "141.als");
+ else if (objeto_que_lleva == LOOK && fl == 208)
+ talk(_text[_lang][142], "142.als");
+ else
+ hay_respuesta = 0;
+
+ return false;
+}
+
+void DrasculaEngine::room_58(int fl) {
+ if (objeto_que_lleva == MOVE && fl == 103)
+ animation_7_6();
+ else if (objeto_que_lleva == LOOK && fl == 104)
+ talk(_text[_lang][454], "454.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_59(int fl) {
+ if ((objeto_que_lleva == TALK && fl == 51) || (objeto_que_lleva == LOOK && fl == 51)) {
+ flags[9] = 1;
+ talk(_text[_lang][259], "259.als");
+ talk_bj_cama(_textbj[_lang][13], "bj13.als");
+ talk(_text[_lang][263], "263.als");
+ talk_bj_cama(_textbj[_lang][14], "bj14.als");
+ pause(40);
+ talk(_text[_lang][264], "264.als");
+ talk_bj_cama(_textbj[_lang][15], "BJ15.als");
+ talk(_text[_lang][265], "265.als");
+ flags[9] = 0;
+ if (flags[11] == 0) {
+ comienza_sound("s12.als");
+ delay(40);
+ fin_sound();
+ delay(10);
+ lleva_al_hare(174, 168);
+ sentido_hare = 2;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(40);
+ comienza_sound("s12.als");
+ pause(19);
+ fin_sound_corte();
+ hare_se_ve = 0;
+ updateRoom();
+ copyRect(101, 34, hare_x - 4, hare_y - 1, 37, 70, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ hare_se_ve = 1;
+ clearRoom();
+ loadPic("tlef0.alg");
+ decompressPic(dir_dibujo1, COMPLETA);
+ loadPic("tlef1.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("tlef2.alg");
+ decompressPic(dir_hare_frente, 1);
+ loadPic("tlef3.alg");
+ decompressPic(dir_hare_fondo, 1);
+ talk_htel(_text[_lang][240], "240.als");
+
+ color_abc(VON_BRAUN);
+ talk_solo(_textvb[_lang][58], "VB58.als");
+ talk_htel(_text[_lang][241], "241.als");
+ color_abc(VON_BRAUN);
+ talk_solo(_textvb[_lang][59], "VB59.als");
+ talk_htel(_text[_lang][242], "242.als");
+ color_abc(VON_BRAUN);
+ talk_solo(_textvb[_lang][60], "VB60.als");
+ talk_htel(_text[_lang][196], "196.als");
+ color_abc(VON_BRAUN);
+ talk_solo(_textvb[_lang][61],"VB61.als");
+ talk_htel(_text[_lang][244], "244.als");
+ color_abc(VON_BRAUN);
+ talk_solo(_textvb[_lang][62], "VB62.als");
+ clearRoom();
+ loadPic("aux59.alg");
+ decompressPic(dir_dibujo3, 1);
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, COMPLETA);
+ loadPic("99.alg");
+ decompressPic(dir_hare_fondo, 1);
+ loadPic("59.alg");
+ decompressPic(dir_dibujo1, MEDIA);
+ sentido_hare = 3;
+ talk(_text[_lang][245], "245.als");
+ sin_verbo();
+ flags[11] = 1;
+ }
+ } else
+ hay_respuesta = 0;
+}
+
+bool DrasculaEngine::room_60(int fl) {
+ if (objeto_que_lleva == MOVE && fl == 112)
+ animation_10_6();
+ else if (objeto_que_lleva == LOOK && fl == 112)
+ talk(_text[_lang][440], "440.als");
+ else if (objeto_que_lleva == TALK && fl == 52) {
+ talk(_text[_lang][266], "266.als");
+ talk_taber2(_textt[_lang][1], "t1.als");
+ conversa("op_12.cal");
+ sin_verbo();
+ objeto_que_lleva = 0;
+ } else if (objeto_que_lleva == TALK && fl == 115)
+ talk(_text[_lang][455], "455.als");
+ else if (objeto_que_lleva == TALK && fl == 56)
+ talk(_text[_lang][455], "455.als");
+ else if (objeto_que_lleva == LOOK && fl == 114)
+ talk(_text[_lang][167], "167.als");
+ else if (objeto_que_lleva == LOOK && fl == 113)
+ talk(_text[_lang][168], "168.als");
+ else if (objeto_que_lleva == PICK && fl == 113)
+ talk(_text[_lang][170], "170.als");
+ else if (objeto_que_lleva == MOVE && fl == 113)
+ talk(_text[_lang][170], "170.als");
+ else if (objeto_que_lleva == TALK && fl == 113)
+ talk(_text[_lang][169], "169.als");
+ else if (objeto_que_lleva == 21 && fl == 56)
+ animation_18_6();
+ else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 1) {
+ animation_9_6();
+ return true;
+ } else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 0) {
+ anima("cnf.bin", 14);
+ talk(_text[_lang][455], "455.als");
+ } else
+ hay_respuesta = 0;
+
+ return false;
+}
+
+void DrasculaEngine::room_61(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 116)
+ talk(_text[_lang][172], "172.als");
+ else if (objeto_que_lleva == LOOK && fl == 117)
+ talk(_text[_lang][173], "173.als");
+ else if (objeto_que_lleva == MOVE && fl == 117)
+ talk(_text[_lang][174], "174.als");
+ else if (objeto_que_lleva == OPEN && fl == 117)
+ talk(_text[_lang][174], "174.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_62(int fl) {
+ if (objeto_que_lleva == TALK && fl == 53)
+ conversa("op_13.cal");
+ else if (objeto_que_lleva == TALK && fl == 52 && flags[0] == 0)
+ animation_3_1();
+ else if (objeto_que_lleva == TALK && fl == 52 && flags[0] == 1)
+ talk(_text[_lang][109], "109.als");
+ else if (objeto_que_lleva == TALK && fl == 54)
+ animation_4_1();
+ else if (objeto_que_lleva == LOOK && fl == 100)
+ talk(_text[_lang][168], "168.als");
+ else if (objeto_que_lleva == TALK && fl == 100)
+ talk(_text[_lang][169], "169.als");
+ else if (objeto_que_lleva == PICK && fl == 100)
+ talk(_text[_lang][170], "170.als");
+ else if (objeto_que_lleva == LOOK && fl == 101)
+ talk(_text[_lang][171], "171.als");
+ else if (objeto_que_lleva == LOOK && fl == 102)
+ talk(_text[_lang][167], "167.als");
+ else if (objeto_que_lleva == LOOK && fl == 103)
+ talk(_text[_lang][166], "166.als");
+ else hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_63(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 110)
+ talk(_text[_lang][172], "172.als");
+ else if (objeto_que_lleva == LOOK && fl == 109)
+ talk(_text[_lang][173], "173.als");
+ else if (objeto_que_lleva == MOVE && fl == 109)
+ talk(_text[_lang][174], "174.als");
+ else if (objeto_que_lleva == LOOK && fl == 108)
+ talk(_text[_lang][334], "334.als");
+ else if (objeto_que_lleva == TALK && fl == 108)
+ talk(_text[_lang][333], "333.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::room_pendulo(int fl) {
+ if (objeto_que_lleva == LOOK && fl == 100)
+ talk(_text[_lang][452], "452.als");
+ else if (objeto_que_lleva == LOOK && fl == 101)
+ talk (_text[_lang][123], "123.als");
+ else if (objeto_que_lleva == PICK && fl == 101)
+ agarra_objeto(20);
+ else if (objeto_que_lleva == 20 && fl == 100)
+ animation_6_6();
+ else if (objeto_que_lleva == PICK || objeto_que_lleva == OPEN)
+ talk(_text[_lang][453], "453.als");
+ else
+ hay_respuesta = 0;
+}
+
+void DrasculaEngine::updateRefresh() {
+ if (num_ejec == 1) {
+ if (!strcmp(num_room, "63.alg"))
+ update_63();
+ else if (!strcmp(num_room, "62.alg"))
+ update_62();
+ } else if (num_ejec == 2) {
+ if (!strcmp(num_room, "3.alg"))
+ update_3();
+ else if (!strcmp(num_room, "2.alg"))
+ update_2();
+ else if (!strcmp(num_room, "4.alg"))
+ update_4();
+ else if (!strcmp(num_room, "5.alg"))
+ update_5();
+ else if (!strcmp(num_room, "15.alg"))
+ update_15();
+ else if (!strcmp(num_room, "17.alg"))
+ update_17();
+ else if (!strcmp(num_room, "18.alg"))
+ update_18();
+ else if (!strcmp(num_room, "10.alg"))
+ mapa();
+ } else if (num_ejec == 3) {
+ if (!strcmp(num_room, "20.alg"))
+ update_20();
+ else if (!strcmp(num_room, "13.alg"))
+ update_13();
+ } else if (num_ejec == 4) {
+ if (!strcmp(num_room, "29.alg"))
+ update_29();
+ else if (!strcmp(num_room, "26.alg"))
+ update_26();
+ else if (!strcmp(num_room, "27.alg"))
+ update_27();
+ else if (!strcmp(num_room, "31.alg"))
+ update_31();
+ else if (!strcmp(num_room, "34.alg"))
+ update_34();
+ else if (!strcmp(num_room, "35.alg"))
+ update_35();
+ } else if (num_ejec == 5) {
+ if (!strcmp(num_room, "45.alg"))
+ mapa();
+ else if (!strcmp(num_room, "50.alg"))
+ update_50();
+ else if (!strcmp(num_room, "57.alg"))
+ update_57();
+ } else if (num_ejec == 6) {
+ if (!strcmp(num_room, "60.alg"))
+ update_60();
+ else if (!strcmp(num_room, "61.alg"))
+ update_61();
+ else if (!strcmp(num_room, "58.alg"))
+ update_58();
+ }
+}
+
+void DrasculaEngine::updateRefresh_pre() {
+ if (num_ejec == 1) {
+ if (!strcmp(num_room, "62.alg"))
+ update_62_pre();
+ else if (!strcmp(num_room, "16.alg"))
+ pon_bj();
+ } else if (num_ejec == 2) {
+ if (!strcmp(num_room, "1.alg"))
+ update_1_pre();
+ else if (!strcmp(num_room, "3.alg"))
+ update_3_pre();
+ else if (!strcmp(num_room, "5.alg"))
+ update_5_pre();
+ else if (!strcmp(num_room, "6.alg"))
+ update_6_pre();
+ else if (!strcmp(num_room, "7.alg"))
+ update_7_pre();
+ else if (!strcmp(num_room, "9.alg"))
+ update_9_pre();
+ else if (!strcmp(num_room, "12.alg"))
+ update_12_pre();
+ else if (!strcmp(num_room, "14.alg"))
+ update_14_pre();
+ else if (!strcmp(num_room, "16.alg"))
+ update_16_pre();
+ else if (!strcmp(num_room, "17.alg"))
+ update_17_pre();
+ else if (!strcmp(num_room, "18.alg"))
+ update_18_pre();
+ } else if (num_ejec == 3) {
+ // nothing
+ } else if (num_ejec == 4) {
+ if (!strcmp(num_room, "21.alg"))
+ update_21_pre();
+ else if (!strcmp(num_room, "22.alg"))
+ update_22_pre();
+ else if (!strcmp(num_room, "23.alg"))
+ update_23_pre();
+ else if (!strcmp(num_room, "24.alg"))
+ update_24_pre();
+ else if (!strcmp(num_room, "26.alg"))
+ update_26_pre();
+ else if (!strcmp(num_room, "27.alg"))
+ update_27_pre();
+ else if (!strcmp(num_room, "29.alg"))
+ update_29_pre();
+ else if (!strcmp(num_room, "30.alg"))
+ update_30_pre();
+ else if (!strcmp(num_room, "31.alg"))
+ update_31_pre();
+ else if (!strcmp(num_room, "34.alg"))
+ update_34_pre();
+ else if (!strcmp(num_room, "35.alg"))
+ update_35_pre();
+ } else if (num_ejec == 5) {
+ if (!strcmp(num_room,"49.alg"))
+ update_49_pre();
+ else if (!strcmp(num_room,"53.alg"))
+ update_53_pre();
+ else if (!strcmp(num_room,"54.alg"))
+ update_54_pre();
+ else if (!strcmp(num_room,"56.alg"))
+ update_56_pre();
+ } else if (num_ejec == 6) {
+ if (!strcmp(num_room, "102.alg"))
+ update_pendulo();
+ else if (!strcmp(num_room, "58.alg"))
+ update_58_pre();
+ else if (!strcmp(num_room, "59.alg"))
+ update_59_pre();
+ else if (!strcmp(num_room, "60.alg"))
+ update_60_pre();
+ }
+}
+
+void DrasculaEngine::update_1_pre() {
+ int cambio_col_antes = cambio_de_color;
+
+ if (hare_x > 98 && hare_x < 153)
+ cambio_de_color = 1;
+ else
+ cambio_de_color = 0;
+
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
+ hare_oscuro();
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
+ hare_claro();
+
+ if (flags[8] == 0)
+ copyBackground(2, 158, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_2(){
+ int pos_murci[6];
+ int diferencia;
+ int murci_x[] = {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,
+ 30, 88, 146, 204, 262,
+ 88, 146, 204, 262,
+ 88, 146, 204, 262};
+
+ int murci_y[] = {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,
+ 78, 78, 78, 78, 78,
+ 41, 41, 41, 41,
+ 4, 4, 4, 4};
+
+ if (frame_murcielago == 41)
+ frame_murcielago = 0;
+
+ pos_murci[0] = murci_x[frame_murcielago];
+ pos_murci[1] = murci_y[frame_murcielago];
+
+ if (frame_murcielago < 22) {
+ pos_murci[4] = 37;
+ pos_murci[5] = 21;
+ } else if (frame_murcielago > 27) {
+ pos_murci[4] = 57;
+ pos_murci[5] = 36;
+ } else {
+ pos_murci[4] = 47;
+ pos_murci[5] = 22;
+ }
+
+ pos_murci[2] = 239;
+ pos_murci[3] = 19;
+
+ copyRectClip(pos_murci, dir_dibujo3, dir_zona_pantalla);
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia >= 6) {
+ frame_murcielago++;
+ conta_ciego_vez = vez();
+ }
+
+ copyRect(29, 37, 58, 114, 57, 39, dir_dibujo3, dir_zona_pantalla);
+ mapa();
+}
+
+void DrasculaEngine::update_3_pre() {
+ if (flags[3] == 1)
+ copyBackground(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_3() {
+ if (hare_y + alto_hare < 118)
+ copyRect(129, 110, 194, 36, 126, 88, dir_dibujo3, dir_zona_pantalla);
+ copyRect(47, 57, 277, 143, 43, 50, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_4() {
+ int cambio_col_antes = cambio_de_color;
+ if (hare_x > 190)
+ cambio_de_color = 1;
+ else
+ cambio_de_color = 0;
+
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
+ hare_oscuro();
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
+ hare_claro();
+}
+
+void DrasculaEngine::update_5_pre(){
+ if (flags[8] == 0)
+ copyBackground(256, 152, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_5() {
+ copyRect(114, 130, 211, 87, 109, 69, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_6_pre() {
+ int cambio_col_antes = cambio_de_color;
+
+ 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))
+ cambio_de_color = 0;
+ else
+ cambio_de_color = 1;
+
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
+ hare_oscuro();
+ if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
+ hare_claro();
+
+ if (flags[1] == 0)
+ copyBackground(97, 117, 34, 148, 36, 31, dir_dibujo3, dir_zona_pantalla);
+ if (flags[0] == 0)
+ copyBackground(3, 103, 185, 69, 23, 76, dir_dibujo3, dir_zona_pantalla);
+ if (flags[2] == 0)
+ copyBackground(28, 100, 219, 72, 64, 97, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_7_pre() {
+ if (flags[35] == 0)
+ copyBackground(1, 72, 158, 162, 19, 12, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_9_pre() {
+ int ciego_x[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
+ int ciego_y[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
+ int diferencia;
+
+ copyRect(ciego_x[frame_ciego], ciego_y[frame_ciego], 122, 57, 41, 72, dir_dibujo3, dir_zona_pantalla);
+ if (flags[9] == 0) {
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia >= 11) {
+ frame_ciego++;
+ conta_ciego_vez = vez();
+ }
+ if (frame_ciego == 9)
+ frame_ciego = 0;
+ } else
+ frame_ciego = 3;
+}
+
+void DrasculaEngine::update_12_pre() {
+ if (flags[16] == 0)
+ copyBackground(1, 131, 106, 117, 55, 68, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_13() {
+ if (hare_x > 55 && flags[3] == 0)
+ animation_6_3();
+ if (flags[1] == 0)
+ copyRect(185, 110, 121, 65, 67, 88, dir_dibujo3, dir_zona_pantalla);
+ if (flags[2] == 0)
+ copyRect(185, 21, 121, 63, 67, 88, dir_dibujo3, dir_zona_pantalla);
+ copyRect(3, 127, 99, 102, 181, 71, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_14_pre() {
+ int velas_y[] = {158, 172, 186};
+ int cirio_x[] = {14, 19, 24};
+ int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
+ int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1};
+ int diferencia;
+
+ copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
+
+ if (parpadeo == 5)
+ copyBackground(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
+ if (hare_x > 101 && hare_x < 155)
+ copyBackground(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
+ if (flags[11] == 0)
+ copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
+ else if (flags[5] == 0)
+ copyBackground(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ else
+ copyBackground(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[12] == 1)
+ copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia > 6) {
+ if (flags[12] == 1) {
+ frame_borracho++;
+ if (frame_borracho == 8) {
+ frame_borracho = 0;
+ flags[12] = 0;
+ }
+ } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
+ flags[12] = 1;
+
+ frame_velas++;
+ if (frame_velas == 3)
+ frame_velas = 0;
+ frame_piano++;
+ if (frame_piano == 9)
+ frame_piano = 0;
+ parpadeo = _rnd->getRandomNumber(10);
+ conta_ciego_vez = vez();
+ }
+}
+
+void DrasculaEngine::update_15() {
+ copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_16_pre() {
+ if (flags[17] == 0)
+ copyBackground(1, 103, 24, 72, 33, 95, dir_dibujo3, dir_zona_pantalla);
+ if (flags[19] == 1)
+ copyBackground(37, 151, 224, 115, 56, 47, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_17_pre() {
+ if (flags[15] == 1)
+ copyBackground(1, 135, 108, 65, 44, 63, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_17() {
+ copyRect(48, 135, 78, 139, 80, 30, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_18_pre() {
+ int diferencia;
+ int ronquido_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95};
+ int ronquido_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18};
+
+ if (flags[21] == 0) {
+ copyBackground(1, 69, 120, 58, 56, 61, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(ronquido_x[frame_ronquido], ronquido_y[frame_ronquido], 124, 59, 40, 37, dir_dibujo3, dir_zona_pantalla);
+ } else
+ pon_vb();
+
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia > 9) {
+ frame_ronquido++;
+ if (frame_ronquido == 16)
+ frame_ronquido = 0;
+ conta_ciego_vez = vez();
+ }
+}
+
+void DrasculaEngine::update_18() {
+ if (flags[24] == 1)
+ copyRect(177, 1, 69, 29, 142, 130, dir_dibujo3, dir_zona_pantalla);
+ copyRect(105, 132, 109, 108, 196, 65, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_20() {
+ copyRect(1, 137, 106, 121, 213, 61, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_21_pre() {
+ if (flags[0] == 1)
+ copyBackground(2, 171, 84, 126, 17, 26, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[10] == 1)
+ copyBackground(20, 163, 257, 149, 14, 34, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_22_pre() {
+ if (flags[24] == 1)
+ copyBackground(2, 187, 107, 106, 62, 12, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[27] == 0)
+ copyBackground(32, 181, 203, 88, 13, 5, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[26] == 0)
+ copyBackground(2, 133, 137, 83, 29, 53, dir_dibujo3, dir_zona_pantalla);
+ else
+ copyBackground(65, 174, 109, 145, 55, 25, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_23_pre() {
+ if (flags[11] == 1 && flags[0] == 0)
+ copyBackground(87, 171, 237, 110, 20, 28, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[0] == 1)
+ copyBackground(29, 126, 239, 94, 57, 73, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[1] == 1)
+ copyRect(1, 135, 7, 94, 27, 64, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_24_pre() {
+ if (flags[1] == 1)
+ copyBackground(1, 163, 225, 124, 12, 36, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[2] == 1)
+ copyBackground(14, 153, 30, 107, 23, 46, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_26_pre() {
+ int diferencia;
+
+ if (flags[2] == 1)
+ copyBackground(1, 130, 87, 44, 50, 69, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[12] == 1)
+ copyBackground(52, 177, 272, 103, 27, 22, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[18] == 0)
+ copyBackground(80, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+
+ if (parpadeo == 5 && flags[18] == 0)
+ copyBackground(52, 172, 226, 106, 3, 4, dir_dibujo3, dir_zona_pantalla);
+
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia >= 10) {
+ parpadeo = _rnd->getRandomNumber(10);
+ conta_ciego_vez = vez();
+ }
+
+ if (flags[20] == 1)
+ copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_26() {
+ if (flags[29] == 1)
+ copyRect(93, 1, hare_x, hare_y, 45, 78, dir_hare_fondo, dir_zona_pantalla);
+
+ copyRect(233, 107, 17, 102, 66, 92, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_27_pre() {
+ if (flags[5] == 1)
+ copyRect(1, 175, 59, 109, 17, 24, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[6] == 1)
+ copyRect(19, 177, 161, 103, 18, 22, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_27() {
+ copyRect(38, 177, 103, 171, 21, 22, dir_dibujo3, dir_zona_pantalla);
+ copyRect(60, 162, 228, 156, 18, 37, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_29_pre() {
+ if (flags[4] == 1)
+ copyBackground(12, 113, 247, 49, 41, 84, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_29() {
+ copyRect(1, 180, 150, 126, 10, 17, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_30_pre() {
+ if (flags[4] == 1)
+ copyBackground(1, 148, 148, 66, 35, 51, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[16] == 1)
+ copyBackground(37, 173, 109, 84, 20, 26, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_31_pre() {
+ if (flags[13] == 1)
+ copyBackground(1, 163, 116, 41, 61, 36, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[5] == 1)
+ copyBackground(1, 78, 245, 63, 30, 84, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_31() {
+ copyRect(63, 190, 223, 157, 17, 9, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_34_pre() {
+ if (flags[7] == 1)
+ copyBackground(99, 127, 73, 41, 79, 72, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[8] == 1)
+ copyBackground(36, 129, 153, 41, 62, 65, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_34() {
+ copyRect(5, 171, 234, 126, 29, 23, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_35_pre() {
+ if (flags[14] == 1)
+ copyBackground(1, 86, 246, 65, 68, 87, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[17] == 0 && flags[15] == 1)
+ copyBackground(111, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[17] == 1)
+ copyBackground(70, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_35() {
+ copyRect(1, 174, 54, 152, 195, 25, dir_dibujo3, dir_zona_pantalla);
+}
+
+
+void DrasculaEngine::update_49_pre() {
+ if (flags[6] == 0)
+ copyBackground(2, 136, 176, 81, 49, 62, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_50() {
+ copyRect(4, 153, 118, 95, 67, 44, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_53_pre() {
+ if (flags[1] == 0)
+ copyRect(2, 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
+ if (flags[2] == 0)
+ copyBackground(41, 159, 27, 117, 25, 40, dir_dibujo3, dir_zona_pantalla);
+ if (flags[9] == 1)
+ copyBackground(67, 184, 56, 93, 32, 15, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_54_pre() {
+ if (flags[5] == 1)
+ copyBackground(168, 156, 187, 111, 7, 11, dir_dibujo3, dir_zona_pantalla);
+ if (flags[12] == 1)
+ copyBackground(16, 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_56_pre() {
+ if (flags[10] == 0)
+ copyBackground(2, 126, 42, 67, 57, 67, dir_dibujo3, dir_zona_pantalla);
+ if (flags[11] == 1)
+ copyBackground(60, 160, 128, 97, 103, 38, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_57() {
+ copyRect(7, 113, 166, 61, 62, 82, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_58_pre() {
+ if (flags[0] == 0)
+ copyBackground(1, 156, 143, 120, 120, 43, dir_dibujo3, dir_zona_pantalla);
+ if (flags[1] == 2)
+ copyRect(252, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
+ if (flags[1] == 0 && flags[0] == 0)
+ copyRect(278, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
+ if (flags[2] == 0) {
+ pon_igor();
+ pon_dr();
+ }
+ if (flags[3] == 1)
+ copyRect(1, 29, 204, 0, 18, 125, dir_dibujo3, dir_zona_pantalla);
+ if (flags[8] == 1)
+ copyBackground(20, 60, 30, 64, 46, 95, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_58() {
+ if (hare_se_ve == 1)
+ copyRect(67, 139, 140, 147, 12, 16, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_59_pre() {
+ if (flags[4] == 0)
+ copyRect(1, 146, 65, 106, 83, 40, dir_dibujo3, dir_zona_pantalla);
+ if (flags[9] == 1) {
+ copyBackground(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
+ copyRect(1, 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
+ }
+}
+
+void DrasculaEngine::update_60_pre() {
+ int velas_y[] = {158, 172, 186};
+ int diferencia;
+
+ if (flags[5] == 0)
+ pon_dr();
+
+ copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
+
+ if (flag_tv == 1)
+ copyBackground(114, 158, 8, 30, 8, 23, dir_dibujo3, dir_zona_pantalla);
+
+ diferencia = vez() - conta_ciego_vez;
+ parpadeo = _rnd->getRandomNumber(7);
+ if (parpadeo == 5 && flag_tv == 0)
+ flag_tv = 1;
+ else if (parpadeo == 5 && flag_tv == 1)
+ flag_tv = 0;
+ if (diferencia > 6) {
+ frame_velas++;
+ if (frame_velas == 3)
+ frame_velas = 0;
+ conta_ciego_vez = vez();
+ }
+}
+
+void DrasculaEngine::update_60() {
+ if (hare_y - 10 < y_dr && flags[5] == 0)
+ pon_dr();
+}
+
+void DrasculaEngine::update_61() {
+ copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_62_pre() {
+ int velas_y[] = { 158, 172, 186 };
+ int cirio_x[] = { 14, 19, 24 };
+ int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
+ int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 };
+ int diferencia;
+
+ copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
+
+ if (parpadeo == 5)
+ copyBackground(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
+
+ if (hare_x > 101 && hare_x < 155)
+ copyBackground(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[11] == 0)
+ copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
+ else if (flags[5] == 0)
+ copyBackground(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ else
+ copyBackground(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[12] == 1)
+ copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
+
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia > 6) {
+ if (flags[12] == 1) {
+ frame_borracho++;
+ if (frame_borracho == 8) {
+ frame_borracho = 0;
+ flags[12] = 0;
+ }
+ } else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
+ flags[12] = 1;
+
+ frame_velas++;
+ if (frame_velas == 3)
+ frame_velas = 0;
+ frame_piano++;
+ if (frame_piano == 9)
+ frame_piano = 0;
+ parpadeo = _rnd->getRandomNumber(10);
+ conta_ciego_vez = vez();
+ }
+}
+
+void DrasculaEngine::update_62() {
+ int borracho_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
+
+ copyRect(1, 1, 0, 0, 62, 142, dir_dibujo2, dir_zona_pantalla);
+
+ if (hare_y + alto_hare < 89) {
+ copyRect(205, 1, 180, 9, 82, 80, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
+ }
+}
+
+void DrasculaEngine::update_63() {
+ copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
+}
+
+void DrasculaEngine::update_pendulo() {
+ int pendulo_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
+ int diferencia;
+
+ if (frame_pen <= 4)
+ dir_pendulo = dir_dibujo3;
+ else if (frame_pen <= 11)
+ dir_pendulo = dir_hare_dch;
+ else
+ dir_pendulo = dir_hare_frente;
+
+ copyBackground(pendulo_x[frame_pen], 19, 152, 0, 55, 125, dir_pendulo, dir_zona_pantalla);
+
+ if (flags[1] == 2)
+ copyRect(18, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
+
+ if (flags[1] == 0)
+ copyRect(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
+
+ diferencia = vez() - conta_ciego_vez;
+ if (diferencia > 8) {
+ frame_pen++;
+ if (frame_pen == 17)
+ frame_pen = 0;
+ conta_ciego_vez = vez();
+ }
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
new file mode 100644
index 0000000000..3dea8c21a1
--- /dev/null
+++ b/engines/drascula/talk.cpp
@@ -0,0 +1,2053 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::talk_igor_dch(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 56, 82, 108, 134, 160, 186, 212, 238 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ pon_igor();
+ pon_dr();
+ copyBackground(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, dir_dibujo1, dir_zona_pantalla);
+
+ copyRect(x_talk[cara], 148, x_igor + 17, y_igor, 25, 24, dir_hare_frente, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, x_igor + 26, y_igor);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_dr_izq(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(ROJO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ pon_igor();
+ pon_dr();
+ if (num_ejec == 6)
+ pon_hare();
+
+ copyBackground(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla);
+ if (num_ejec == 6)
+ copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
+ else
+ copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, x_dr + 19, y_dr);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_dr_dch(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(ROJO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+
+ pon_igor();
+ pon_dr();
+ if (num_ejec == 6)
+ pon_hare();
+
+ copyBackground(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla);
+ if (num_ejec != 6)
+ copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
+ else
+ copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, x_dr + 19, y_dr);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ if (num_ejec == 6)
+ updateRoom();
+
+ pon_igor();
+ pon_dr();
+ if (num_ejec == 6)
+ pon_hare();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_solo(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ if (num_ejec == 1)
+ color_abc(color_solo);
+ else if (num_ejec == 4)
+ color_abc(ROJO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+ if (num_ejec == 6)
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+bucless:
+
+ if (con_voces == 0) {
+ if (num_ejec == 1)
+ centra_texto(dicho, 156, 90);
+ else if (num_ejec == 6)
+ centra_texto(dicho, 213, 72);
+ else if (num_ejec == 5)
+ centra_texto(dicho, 173, 92);
+ }
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+ if (num_ejec == 6) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+}
+
+void DrasculaEngine::talk_igor_frente(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 56, 86, 116, 146, 176, 206, 236, 266 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ if (num_ejec == 1 || num_ejec == 4)
+ pon_igor();
+ if (num_ejec == 1)
+ pon_dr();
+ if (num_ejec == 1 || num_ejec == 6)
+ copyBackground(x_igor, y_igor, x_igor, y_igor, 29, 25, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x_talk[cara], 173, x_igor, y_igor, 29, 25, dir_hare_frente, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, x_igor + 26, y_igor);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ if (num_ejec == 6) {
+ updateRoom();
+ }
+
+ if (num_ejec == 1) {
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pon_igor();
+ pon_dr();
+ }
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_tabernero(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(MARRON);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ if (num_ejec == 1) {
+ if (music_status() == 0)
+ playmusic(musica_room);
+ } else if (num_ejec == 2) {
+ if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
+ playmusic(musica_room);
+ }
+
+ cara = _rnd->getRandomNumber(8);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 132, 45);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete(sku);
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_bj(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[5] = { 64, 92, 120, 148, 176 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+ if (num_ejec != 5) {
+ cara = _rnd->getRandomNumber(4);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40,
+ dir_dibujo1, dir_zona_pantalla);
+
+ copyRect(x_talk[cara], 99, x_bj + 2, y_bj - 1, 27, 40,
+ dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, x_bj + 7, y_bj);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+ } else {
+ updateRoom();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 93, 80);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ }
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int suma_1_pixel = 0;
+ if (num_ejec != 2)
+ suma_1_pixel = 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 cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ if (num_ejec == 6) {
+ if (flags[0] == 0 && (!strcmp(num_room, "102.alg"))) {
+ talk_pen(dicho, filename);
+ return;
+ }
+ if (flags[0] == 0 && (!strcmp(num_room, "58.alg"))) {
+ talk_pen2(dicho, filename);
+ return;
+ }
+ }
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ if (num_ejec != 2) {
+ if (factor_red[hare_y + alto_hare] == 100)
+ suma_1_pixel = 0;
+ }
+
+ if (num_ejec == 2)
+ buffer_teclado();
+
+ if (num_ejec == 4) {
+ if (strcmp(num_room, "24.alg") || flags[29] == 0) {
+ color_abc(AMARILLO);
+ }
+ } else {
+ color_abc(AMARILLO);
+ }
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(5);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+ if (num_ejec == 2)
+ copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3);
+ else
+ copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
+ (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]),
+ dir_zona_pantalla, dir_dibujo3);
+
+ pon_hare();
+
+ if (num_ejec == 2) {
+ if (!strcmp(fondo_y_menu, "99.alg") || !strcmp(fondo_y_menu, "994.alg"))
+ copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla);
+ } else {
+ copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
+ (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]),
+ dir_dibujo3, dir_zona_pantalla);
+ }
+
+ if (sentido_hare == 0) {
+ if (num_ejec == 2)
+ copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk,
+ dir_hare_dch, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_izq[cara], y_mask_talk, hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare],
+ dir_hare_dch, dir_zona_pantalla);
+
+ updateRefresh();
+ } else if (sentido_hare == 1) {
+ if (num_ejec == 2)
+ copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk,
+ dir_hare_dch, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_dch[cara], y_mask_talk, hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
+ updateRefresh();
+ } else if (sentido_hare == 2) {
+ if (num_ejec == 2)
+ copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk,
+ dir_hare_frente, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_izq[cara], y_mask_talk,
+ suma_1_pixel + hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare],
+ dir_hare_frente, dir_zona_pantalla);
+ updateRefresh();
+ } else if (sentido_hare == 3) {
+ if (num_ejec == 2)
+ copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk,
+ dir_hare_frente, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_dch[cara], y_mask_talk,
+ suma_1_pixel + hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk,alto_talk, factor_red[hare_y + alto_hare],
+ dir_hare_frente, dir_zona_pantalla);
+ updateRefresh();
+ }
+
+ if (con_voces == 0)
+ centra_texto(dicho, hare_x, hare_y);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ if (num_ejec == 1) {
+ if (music_status() == 0 && flags[11] == 0 && corta_musica == 0)
+ playmusic(musica_room);
+ }
+}
+
+void DrasculaEngine::talk_pianista(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+ int x_talk[4] = { 97, 145, 193, 241 };
+ int cara;
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(3);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 139, 228, 112, 47, 60,
+ dir_hare_dch, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 221, 128);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_borracho(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 1, 21, 41, 61, 81, 101, 121, 141 };
+ int cara;
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ if (num_ejec == 1) {
+ loadPic("an11y13.alg");
+ decompressPic(dir_hare_frente, 1);
+ }
+
+ flags[13] = 1;
+
+bebiendo:
+
+ if (flags[12] == 1) {
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ goto bebiendo;
+ }
+
+ buffer_teclado();
+
+ color_abc(VERDE_OSCURO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz\n");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 181, 54);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ byte key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ flags[13] = 0;
+ if (num_ejec == 1) {
+ loadPic("96.alg");
+ decompressPic(dir_hare_frente, 1);
+ }
+
+ if (num_ejec == 1) {
+ if (music_status() == 0 && flags[11] == 0)
+ playmusic(musica_room);
+ } else if (num_ejec == 2) {
+ if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
+ playmusic(musica_room);
+ }
+}
+
+void DrasculaEngine::talk_vb(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[6] = {1, 27, 53, 79, 105, 131};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(VON_BRAUN);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+ copyBackground(vb_x + 5, 64, ANCHOBJ + 1, 0, 25, 27, dir_dibujo1, dir_dibujo3);
+
+bucless:
+
+ if (sentido_vb == 1) {
+ cara = _rnd->getRandomNumber(5);
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ pon_hare();
+ pon_vb();
+
+ copyBackground(ANCHOBJ + 1, 0, vb_x + 5, 64, 25, 27, dir_dibujo3, dir_zona_pantalla);
+ copyRect(x_talk[cara], 34, vb_x + 5, 64, 25, 27, dir_hare_frente, dir_zona_pantalla);
+ updateRefresh();
+ }
+
+ if (con_voces == 0)
+ centra_texto(dicho, vb_x, 66);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
+ playmusic(musica_room);
+}
+
+void DrasculaEngine::talk_vbpuerta(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(VON_BRAUN);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ updateRoom();
+ if (con_voces == 0)
+ centra_texto(dicho, 150, 80);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
+ playmusic(musica_room);
+}
+
+void DrasculaEngine::talk_ciego(const char *dicho, const char *filename, const char *sincronia) {
+ byte *num_cara;
+ int p = 0;
+ int pos_ciego[6];
+ int cara = 0;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ buffer_teclado();
+
+ color_abc(VON_BRAUN);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+ pos_ciego[1] = 2;
+ pos_ciego[2] = 73;
+ pos_ciego[3] = 1;
+ pos_ciego[4] = 126;
+ pos_ciego[5] = 149;
+
+bucless:
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ pos_ciego[5] = 149;
+ char c = toupper(sincronia[p]);
+ if (c == '0')
+ cara = 0;
+ if (c == '1')
+ cara = 1;
+ if (c == '2')
+ cara = 2;
+ if (c == '3')
+ cara = 3;
+ if (c == '4')
+ cara = 4;
+ if (c == '5')
+ cara = 5;
+ if (c == '6')
+ cara = 6;
+ if (c == '7')
+ cara = 7;
+
+ if (cara == 0 || cara == 2 || cara == 4 || cara == 6)
+ pos_ciego[0] = 1;
+ else
+ pos_ciego[0] = 132;
+
+ if (cara == 0)
+ num_cara = dir_dibujo3;
+ else if (cara == 1)
+ num_cara = dir_dibujo3;
+ else if (cara == 2)
+ num_cara = dir_hare_dch;
+ else if (cara == 3)
+ num_cara = dir_hare_dch;
+ else if (cara == 4)
+ num_cara = dir_hare_fondo;
+ else if (cara == 5)
+ num_cara = dir_hare_fondo;
+ else {
+ num_cara = dir_hare_frente;
+ pos_ciego[5] = 146;
+ }
+
+ copyRectClip( pos_ciego, num_cara, dir_zona_pantalla);
+
+ if (con_voces == 0)
+ centra_texto(dicho, 310, 71);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(2);
+ p++;
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+}
+
+void DrasculaEngine::talk_hacker(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ color_abc(AMARILLO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+ if (con_voces == 0)
+ centra_texto(dicho, 156, 170);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ key = 0;
+}
+
+void DrasculaEngine::talk_lobo(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[9] = {52, 79, 106, 133, 160, 187, 214, 241, 268};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ color_abc(ROJO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(8);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 136, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 203, 78);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_mus(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = { 16, 35, 54, 73, 92, 111, 130, 149};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 197, 64);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_pen(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[8] = {112, 138, 164, 190, 216, 242, 268, 294};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ flags[1] = 1;
+
+ updateRoom();
+ copyRect(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(AMARILLO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(7);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyRect(x_talk[cara], 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 160, 105);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ flags[1] = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_pen2(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[5]={122, 148, 174, 200, 226};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ flags[1] = 1;
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(AMARILLO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(4);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
+
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 195, 107);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ flags[1] = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateRefresh_pre();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_taber2(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[6] = {1, 23, 45, 67, 89, 111};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(MARRON);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(5);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 130, 151, 43, 21, 24, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 132, 45);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_bj_cama(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[5] = {51, 101, 151, 201, 251};
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(4);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x_talk[cara], 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 104, 102);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_htel(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+ char *num_cara;
+
+ int x_talk[3] = {1, 94, 187};
+ int cara, pantalla;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(AMARILLO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(2);
+ pantalla = _rnd->getRandomNumber(2);
+
+ if (cara == 0 && pantalla == 0)
+ num_cara = (char *)dir_dibujo3;
+ else if (pantalla == 1)
+ num_cara = (char *)dir_hare_frente;
+ else
+ num_cara = (char *)dir_hare_fondo;
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ copyBackground(x_talk[cara], 1, 45, 24, 92, 108, (byte *)num_cara, dir_zona_pantalla);
+
+ if (con_voces == 0)
+ centra_texto(dicho, 90, 50);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_sinc(const char *dicho, const char *filename, const char *sincronia) {
+ int suma_1_pixel = 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, cara = 0;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ buffer_teclado();
+
+ color_abc(AMARILLO);
+
+ if (num_ejec == 1) {
+ if (factor_red[hare_y + alto_hare] == 100)
+ suma_1_pixel = 0;
+ }
+
+ p = 0;
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ if (sincronia[p] == '0')
+ cara = 0;
+ if (sincronia[p] == '1')
+ cara = 1;
+ if (sincronia[p] == '2')
+ cara = 2;
+ if (sincronia[p] == '3')
+ cara = 3;
+ if (sincronia[p] == '4')
+ cara = 4;
+ if (sincronia[p] == '5')
+ cara = 5;
+ if (sincronia[p] == '6')
+ cara = 6;
+ if (sincronia[p] == '7')
+ cara = 7;
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+ if (num_ejec == 2)
+ copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3);
+ else
+ copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
+ (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_zona_pantalla, dir_dibujo3);
+ pon_hare();
+ if (num_ejec == 2) {
+ if (alto_hare != 56)
+ copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla);
+ } else
+ copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
+ (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_dibujo3, dir_zona_pantalla);
+
+ if (sentido_hare == 0) {
+ if (num_ejec == 2)
+ copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_izq[cara], y_mask_talk, (int)(hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
+ updateRefresh();
+ } else if (sentido_hare == 1) {
+ if (num_ejec == 2)
+ copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_dch[cara], y_mask_talk, (int)(hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]),
+ hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
+ updateRefresh();
+ } else if (sentido_hare == 2) {
+ if (num_ejec == 2)
+ copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_izq[cara], y_mask_talk,
+ (int)(suma_1_pixel + hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
+ ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
+ updateRefresh();
+ } else if (sentido_hare == 3) {
+ if (num_ejec == 2)
+ copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla);
+ else
+ reduce_hare_chico(x_talk_dch[cara], y_mask_talk,
+ (int)(suma_1_pixel + hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
+ ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
+ updateRefresh();
+ }
+
+ if (con_voces == 0)
+ centra_texto(dicho, hare_x, hare_y);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ p++;
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ if (num_ejec == 1 && music_status() == 0 && flags[11] == 0)
+ playmusic(musica_room);
+ if (num_ejec == 2 && music_status() == 0 && flags[11] == 0 && musica_room != 0)
+ playmusic(musica_room);
+}
+
+void DrasculaEngine::talk_baul(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+ int cara = 0, cara_antes;
+ int longitud;
+
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ cara_antes = flags[19];
+
+ color_abc(MARRON);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ if (cara == 1)
+ cara = 0;
+ else
+ cara = 1;
+
+ flags[19] = cara;
+ updateRoom();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 263, 69);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(4);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ flags[19] = cara_antes;
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_igorpuerta(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1){
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ updateRoom();
+ if (con_voces == 0)
+ centra_texto(dicho, 87, 66);
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_igor_sentado(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[4] = { 80, 102, 124, 146 };
+ int cara;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1) {
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ cara = _rnd->getRandomNumber(3);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 109, 207, 92, 21, 23, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 221, 102);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1) {
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+void DrasculaEngine::talk_igor_peluca(const char *dicho, const char *filename) {
+ int tiempou;
+ long tiempol;
+
+ int x_talk[4] = {119, 158, 197, 236};
+ int cara = 0;
+
+ int longitud;
+ longitud = strlen(dicho);
+
+ tiempol = _system->getMillis();
+ tiempou = (unsigned int)tiempol / 2;
+ _rnd->setSeed(tiempou);
+
+ buffer_teclado();
+
+ color_abc(BLANCO);
+
+ if (hay_sb == 1){
+ sku = new Common::File;
+ sku->open(filename);
+ if (!sku->isOpen()) {
+ error("no puedo abrir archivo de voz");
+ }
+ ctvd_init(2);
+ ctvd_speaker(1);
+ ctvd_output(sku);
+ }
+
+bucless:
+
+ _rnd->getRandomNumber(3);
+
+ copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+
+ updateRefresh_pre();
+
+ copyBackground(x_talk[cara], 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
+ pon_hare();
+ updateRefresh();
+
+ if (con_voces == 0)
+ centra_texto(dicho, 221, 102);
+
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+
+ pause(3);
+
+ int key = getscan();
+ if (key != 0)
+ ctvd_stop();
+ buffer_teclado();
+ if (hay_sb == 1){
+ if (LookForFree() != 0)
+ goto bucless;
+ delete sku;
+ sku = NULL;
+ ctvd_terminate();
+ } else {
+ longitud = longitud - 2;
+ if (longitud > 0)
+ goto bucless;
+ }
+
+ updateRoom();
+ updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/texts.cpp b/engines/drascula/texts.cpp
new file mode 100644
index 0000000000..d4cde5b5fa
--- /dev/null
+++ b/engines/drascula/texts.cpp
@@ -0,0 +1,4342 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+const char *_text[][501] = {
+{
+ "",
+ "ITS 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",
+ "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",
+ "I CAN'T",
+ "YES, THAT'S DONE",
+ "WHY?",
+ "HI WINDOW, ARE YOU DOING ANYTHING TONIGHT?",
+ "NOT WITHOUT PERMISSION FROM THE TOWN HALL",
+ "IF ONLY THIS WINDOW WASN'T BOARDED UP...",
+ "YOO-HOO WINDOW!",
+ "HI THERE",
+ "LIKE MICROCHOF'S",
+ "I CAN'T REACH",
+ "IT'S ALRIGHT WHERE IT IS",
+ "",
+ "ITS A COFFIN IN THE SHAPE OF A CROSS",
+ "NO THANKS",
+ "HI DEAD MAN. NO, DON'T GET UP FOR MY SAKE",
+ "YES, JUST LIKE IN POLTERGEIST",
+ "",
+ "",
+ "I'LL BE BACK IN FIFTEEN MINUTES",
+ "FORBIDDEN TO PUT UP POSTERS",
+ "IT'S UNCLE EVARISTO'S TOMB",
+ "ITS LOCKED",
+ "I'VE GOT ONE",
+ "YOO HOO, UNCLE EVERISTO!",
+ "THERE'S NO REPLY",
+ "IT'S NOT WELL PARKED",
+ "IT'S A DOOR",
+ "A DRAWER IN THE TABLE",
+ "A SUSPICIOUS WARDROBE",
+ "HI WARDROBE, HOW ARE YOU?",
+ "",
+ "",
+ "IT'S AN ANCIENT CANDELABRUM",
+ "IT MUST HAVE BEEN HERE EVER SINCE YULE BRINNER HAD HAIR ON HIS HEAD",
+ "NO, ITS A RELIC",
+ "ITS A NICE ALTARPIECE",
+ "",
+ "HA, HA, HA",
+ "",
+ "NO",
+ "",
+ "HA, HE, HI, HO, HU, GREAT!",
+ "",
+ "",
+ "",
+ "I CAN'T SEE ANYTHING IN PARTICULAR",
+ "IT'S FERNAN, THE PLANT",
+ "IT'S ONE OF THE FENCES SPIKES",
+ "HEY! THERE'S A PACKET OF MATCHES UNDER HERE",
+ "LOOK! A PACKET OF KLEENEX, AND ONE'S STILL UNUSED",
+ "THERE ISN'T ANYTHING ELSE IN THE BUCKET",
+ "IT'S A BLIND MAN WHO CAN'T SEE",
+ "",
+ "",
+ "",
+ "",
+ "THAT'S A GREAT DEAL OF MONEY",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "THERE IS NOTHING SPECIAL ABOUT IT",
+ "IT'S NOT UNUSUAL",
+ "HEY, WHAT'S UP MAN?",
+ "HI",
+ "NOTHING NEW?",
+ "HOW IS THE FAMILY?",
+ "THAT IS JUST LIKE YOU!",
+ "BUT HOW DO I GET THAT?",
+ "MY RELIGION DOES NOT ALLOW ME",
+ "IT'D BE BETTER NOT",
+ "YEAH, SURE MAN!",
+ "NO WAY",
+ "IMPOSSIBLE",
+ "THIS WILL NOT OPEN",
+ "I CAN'T DO IT BY MYSELF",
+ "I COULD DO IT, BUT I JUST FEEL A LITTLE LAZY",
+ "I DO NOT SEE THE REASON",
+ "IT'S A QUITE NICE BRAIN",
+ "AND SO BRAIN, WHAT ARE YOU UP TONIGHT?",
+ "NO, IT MUST BE KEPT SOMEWHERE AWAY FROM THE MUTANT ACTION OF THE ATMOSPHERE",
+ "HE IS VERY STIFF, JUST LIKE MY BOSS",
+ "A VERY SHARP STICK",
+ "YOU FAITHFUL SHARP-PAINTED STICK, NOBLE TRANSILVAAANIAN OAK TREE",
+ "DAMN, I HAVE TO CUT MY NAILS!",
+ "B.J. IS IN THERE... SHE IS A REALLY HOT CHICK!",
+ "IT IS FIRMLY LOCKED",
+ "\"SAVE AWAY LOCKS LTD.\"",
+ "IT IS THE TYPICAL SKELETON YOU FIND IN THE DUNGEONS OF ALL THE GAMES",
+ "IT IS COMMONLY USED TO COMMUNICATE ELECTRICITY TO THE MACHINES CONNECTED TO IT",
+ "IT IS ABSOLUTELY HAND MADE BECAUSE THE JAPANESE MAKE THEM POCKET SIZE",
+ "I HAVE ONLY SEEN IN MY LIFE ANOTHER THING AS UGLY AS THIS ONE",
+ "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",
+ "THAT'S A VERY CUTE DESK",
+ "IT IS A VAMPIRES HUNTER'S DIPLOMA OFFICIALLY APPROVED BY OXFORD UNIVERSITY",
+ "IT'S A DARK NIGHT WITH FULL MOON",
+ "IT SEEMS LIKE THESE SCREWS ARE NOT MUCH TWISTED",
+ "DON'T LOOK NOW, BUT I THINK THAT A HIDDEN CAMERA IS FOCUSING ON ME",
+ "THAT'S A VERY MODERN STICK 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",
+ "IF I WERE A RICH MAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ "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 GET ALL THE BEAUTY WITHIN IT",
+ "I ONLY PRAY BEFORE I GO TO BED",
+ "HEY, THIS PIKE SEEMS A LITTLE BIT LOOSE!",
+ "I HOPE YOU WON'T COMPLAIN ABOUT GETTING NO CLUES FROM ME",
+ "IT'S A QUITE CONVENTIONAL PIKE",
+ "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 CHAIKOSKY, OR CHOIFRUSKY, OR WHATEVER IT IS",
+ "VERY TEMPTING",
+ "NO, I'M NOT ONE OF THOSE WHO PUT USED BUBBLE GUMS IN THEIR MOUTH",
+ "THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER MAY BE",
+ "TOBACCO MANUFACTURERS WARN ABOUT HEALTH BEING SERIOUSLY DAMAGED BY SANITARY AUTHORITIES",
+ "AN ABSOLUTELY NORMAL CANDLE, INCLUDING WAX AND EVERYTHING",
+ "THESE TWO SHINY COINS DO REALLY GLITTER!",
+ "THIS SHINY COIN DOES REALLY GLITTER!",
+ "WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE'S BITES",
+ "NO, IT'S IS NOT THE RIGHT MOMENT YET",
+ "THERE IS A ONE THOUSAND BILL AND A COUPLE COINS",
+ "IT SAYS \"PLEASE, DO NOT THROW FOOD TO THE PIANIST\"",
+ "OMELET, 200. FRIED FISH, 150, MAYONNAISE POTATOES, 225",
+ "BEST BURGERS ON THIS SIDE OF THE DANUBE, ONLY FOR 325!",
+ "THAT'S A NICE SKULL WITH A VERY PENETRATING LOOK, HA, HA, HA, HA, THAT WAS GOOD!",
+ "HI SKULL, YOU REMIND ME OF UNCLE HAMLET",
+ "I HAVE THE HABIT OF NOT TOUCHING THINGS THAT HAVE BEEN ALIVE",
+ "IT'S A BIN",
+ "IT'S A BET FOR TONIGHT'S GAME",
+ "I WONDER WHAT THERE IS BEHIND THAT",
+ "HEY, THAT CURTAIN IS NOT MOVING!",
+ "MAN, THIS CASTLE IS REALLY GLOOMY",
+ "I CAN'T, HE IS TOO FAR AWAY TO HEAR ME",
+ "IT'S THE TYPICAL TRANSILVANIAN FOREST, WITH TREES",
+ "MAN YOU REALLY SAY STUPID THINGS, AND THIS IS TOO DARK!",
+ "GARCIA, CANDY STORE. SWEETS AND BUBBLE GUM",
+ "A VERY NICE DOOR",
+ "IT'S CLOSED",
+ "A COMPLETELY LOCKED BARREL",
+ "",
+ "AREN'T THESE BUGS REALLY CUTE?",
+ "BSSST, PUSSYCAT... LITTLE CAT",
+ "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 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?",
+ "YES, SO WHAT?",
+ "SO?",
+ "IS...THAT RIGHT?",
+ "GOOD QUESTION. NOW, LET ME TELL YOU MY STORY. LOOK...",
+ "IT'S JUST FIVE MINUTES",
+ "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 SELLING",
+ "I THINK I'M GOING BACK TO MY MUM'S TOMORROW FIRST THING IN THE MORNING",
+ "BEAUTIFUL NIGHT, HUH?",
+ "NO, NOTHING",
+ "YOU...PIANIST...!!!!",
+ "BEAUTIFUL NIGHT",
+ "AND IT'S NOT EVEN COLD OR ANYTHING",
+ "ALL RIGHT, I'LL JUST LET YOU GO ON PLAYING",
+ "WELL THEN",
+ "HI BOSS, HOW ARE YOU?",
+ "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!",
+ "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",
+ "AREN'T I JUST A FUNNY GUY, HUH?. BY THE WAY, WHERE AM I?",
+ "YES",
+ "SHOOT...!",
+ "OH, SURE...OF COURSE!",
+ "WELL, THANKS VERY MUCH FOR YOUR HELP. I WON'T BOTHER YOU ANYMORE IF YOU PLEASE TELL ME WHERE THE DOOR IS...",
+ "IT'S BECAUSE THE KNOCK MUST HAVE AFFECTED MY BRAIN...I CAN'T SEE A THING...",
+ "WELL...THAT DOESN'T MATTER. I ALWAYS CARRY AN SPARE ONE",
+ "WOW, WHAT A HOT CHICK!! I DIDN'T NOTICE!, BUT OF COURSE, I WASN'T WEARING MY GLASSES",
+ "HEY...",
+ "AND ALL THIIIISSS???",
+ "DON'T WORRY B.J. HONEY, I'LL SAVE YOU FROM FALLING INTO HIS CLUTCHES...",
+ "YOU REALLY GOT ME MAD MAN...",
+ "AHHH A WEREWOLF!! DIE YOU DAMNED EVIL!",
+ "YES, WELL...",
+ "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 WHU I SAID ANYTHING ABOUT IT",
+ "WHAT ARE YOU DONIG HERE PHILOSPOZING INSTEAD OF BEING EATING SOME PEOPLE",
+ "HOW COME?",
+ "HEY, COULD YOU SAY AGAIN ALL THAT ABOUT PRE-EVOLUTIONARY RELATIONSHIPS?",
+ "YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT NEFORE. I DIDN'D GET IT VERY WELL, YOU KNOW",
+ "NO, I'D RATHER NOT SAY ANYTHING, IN CASE HE GETS ANGRY OR SOMETHING...",
+ "HELLO?",
+ "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?",
+ "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END UP SOON WITH THE GAME?. 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",
+ "HER BRAIN?\?!!",
+ "TO TELL YOU THE TRUTH, I THINK I HAD JUST ENOUGH WITH YOUR OF YOUR LITTLE MONSTER",
+ "OH PLEASE, HOLLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!!",
+ "YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL CAME AND RESCUE ME!",
+ "WHAT A SHIT OF GAME IS THIS IN WHICH THE PROTAGONIST DIES!",
+ "HEY, WAIT A SECOND!, WHAT ABOUT MY LAST WISH?",
+ "HA. HA, I'M NOW IMMUNIZED AGAINST YOU DAMNED EVIL!. THIS CIGARETTE IS AN ANTI-VAMPIRE BREW THAT VON BRAUN GAVE TO ME",
+ "YES SURE, BUT YOU'LL NEVER GET ME TO GIVE YOU THE RECIPE",
+ "APART FROM CREATING TORTURE, I CAN ALSO STAND 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 AND LEAVE US ALONE!",
+ "WHAT ARE YOU DOING HERE B.J.?. WHERE IS DRASCULA?",
+ "WHAT A MEAN GUY!. JUST BECAUSE HE BELONGS TO THE NOBILITY HE THINKS HE IS ENTITLED TO SLEEP WITH ANYBODY HE FEELS LIKE",
+ "DOWN WITH ARISTOCRATIC DESPOTISM!!",
+ "POOR PEOPLE OF THE WORLD FOR EVER..!!",
+ "AND AS I CAN SEE HE HAS CHAINED YOU UP WITH LOCKS AND ALL THAT STUFF, HUH?",
+ "WELL, ALL RIGHT. DO YOU HAVE A HAIRPIN OVER THERE?",
+ "ALL RIGHT, OK, DON'T GET MAD. I'LL THINK ABOUT SOMETHING",
+ "YOU...BARTENDER!!",
+ "HOW IS THE GAME GOING?",
+ "WHO?",
+ "CAN'T YOU SEE DRASCULA IS HERE?",
+ "THEN, LET'S END UP WITH HIM, RIGHT?",
+ "GIVE ME A SCOTCH ON THE ROCKS",
+ "NOTHING, I JUST FORGOT WHAT I WAS GOING TO SAY...",
+ "EITHER YOU GET ME A SCOTCH ON THE ROCKS OR I'LL PLAY THE PIANO UNTIL THE GAME IS OVER",
+ "WHEN IS THE MATCH GOING TO BE OVER?",
+ "GOOD EVENING",
+ "AND SO IGOR, HOW ARE YOU FEELING...A LITTLE HUMPED...?. HA, HA, HA, THAT WAS FUNNY!",
+ "WHAT ARE YOU SUPPOSED TO BE DOING?",
+ "WELL, NO",
+ "THEN WEAR GLASSES",
+ "WHAT IS ALL THAT ABOUT THE SUPERNATURAL ORGY?",
+ "OK, OK, STOP IT. I THINK I CAN GET THE PICTURE",
+ "COULDN'T YOU TELL ME WHERE DRASCULA IS?",
+ "OH...PLEASE...COME ON...!",
+ "WHY NOT?",
+ "OH...BUT DIES HE SLEEP AT NIGHT?",
+ "WELL, I HOPE YOU GET LUCKY",
+ "I HAVE TO TALK TO HIM...",
+ "YOOUUU...SKELETOOOONN..!!!",
+ "GOOD HEAVENS!, IT'S A DEAD MAN TALKING!",
+ "TELL HOW DID YOU GET TO END UP HERE",
+ "AND WHY WOULD DRASCULA WANT TO CREATE A MONSTER?",
+ "WHAT'S YOUR NAME, MY SKELETON FRIEND?",
+ "HEY, DON'T YOU WANT ANYTHING TO EAT?",
+ "I BET YOUR STOMACH IS PRETTY EMPTY...HA, HA,HA!",
+ "THE THING IS THAT I DON'T FEEL LIKE TALKING RIGHT NOW",
+ "I HOPE SOMEONE F...(WHISTLE) YOU...,AND YOUR F...(WHISTLE) SON OF (WHISTLE TWICE)",
+ "I REALLY LOVED HER. I KNOW SHE WASN'T MUCH OF A WONDER, BUT NOBODY'S PERFECT, RIGHT?",
+ "BESIDES. SHE REALLY HAD ONE OF THOSE GREAT BODIES THAT YOU NEVER FORGET...",
+ "I'LL NEVER BE THE SAME AGAIN. I WILL SHUT MYSELF AWAY IN A MONASTERY, AND WILL LET MY LIFE JUST FLOW...",
+ "NOTHING WILL GET ME OUT OF THIS MYSTERY BECAUSE...",
+ "WHOSE?. WHOSE?",
+ "I WANT TO BECOME A PIRATE",
+ "I WANT TO BECOME A PROGRAMMER",
+ "TELL ME SOMETHING ABOUT PELAYO",
+ "I'LL JUST GO ON PLAYING, AND I'LL FORGET I SAW YOU",
+ "WHOSE STUPID IDEA COULD THIS BE?",
+ "IT'S LIKE MY GRANDMOTHER'S HANDBAG ",
+ "JESUS, AREN'T I JUST REALLY COOL MAN...!",
+ "THE MORE I SEE MYSELF, THE MORE I LOVE ME",
+ "HOW DO I LOCK MYSELF THEN?",
+ "I'LL HAVE TO OPEN ME FIRST, RIGHT?",
+ "I'M ALL RIGHT WHERE I AM",
+ "I GOT ME",
+ "HI, MYSELF!",
+ "I'LL WEAR THEM WHEN THE RIGHT TIME COMES",
+ "I CAN'T SEE ANYTHING SPECIAL ABOUT IT",
+ "IT'S ALL RIGHT WHERE IT IS",
+ "AND WHAT FOR?",
+ "I CAN'T",
+ "HI, YOU!",
+ "IT'S UNCLE DESIDERIO'S PANTHEON!",
+ "YOOUU...UNCLE DESIDERIOOOO!!",
+ "NO, I DON'T WANT TO CUT MYSELF AGAIN",
+ "AHHH,,,EXCUS....",
+ "JAMM. AHH...",
+ "YES...WOF, WOF",
+ "LOOK, THERE'S A PIECE OF BUBBLE GUM STUCK HERE",
+ "THIS IS THE PORTABLILINE I GOT LAST CHRISTMAS",
+ "IT'S VERY HIGH!",
+ "COME OUT TO THE BALCONY MY JULIET!!",
+ "YOU ARE THE LIGHT THAT ILLUMINATES MY WAY!",
+ "HEY, DOOR!, WHAT'S THE MATTER?",
+ "YOOOUU, CIGARETTE SPENDING MACHINEEE!",
+ "IT'S A CIGARETTE SPENDING MACHINE",
+ "I HAVE ANOTHER COIN INSIDE",
+ "NO, I JUST DECIDED TO QUIT SMOKING AND DRINKING ALCOHOL",
+ "I WILL DEVOTE MYSELF TO WOMEN FROM NO ON",
+ "THIS IS A TRICK! NOTHING CAME OUT!",
+ "AT LAST!",
+ "JUST A TRUNK",
+ "HELLO TRUNK, YOUR NAME IS JUST LIKE MY COUSIN FRANK...",
+ "I'VE FOUND B.J.'S HANDBAG!",
+ "OH MY GOD! DON'T GET MY IMAGE REFLECTED! I'M A VAMPIRE!",
+ "OH...JESUS, IT'S JUST A DRAWING!",
+ "LITTLE MIRROR, TELL ME, WHO IS THE MOST BEAUTIFUL IN THE WHOLE KINGDOM?",
+ "HE WON'T OPEN",
+ "ALL RIGHT. I GOT THE EAR-PLUGS ON",
+ "IT'S A VAMPIRE'S HUNTER DIPLOMA, OFFICIALLY APPROVED BY OXFORD UNIVERSITY",
+ "NOT YET. THERE ARE STILL SOME INGREDIENTS MISSING. IT'S NOT WORTH WAKING HIM UP",
+ "BUT I DON'T HAVE MONEY",
+ "IT'S A BRITISH LAMP",
+ "HELP ME OUT HERE BARTENDER!!",
+ "A VAMPIRE CAME IN AND TOOK MY GIRLFRIEND AWAY!!",
+ "BUT, AREN'T YOU GOING TO HELP ME!!??",
+ "DEAD?, WHAT DO YOU MEAN DEAD?",
+ "AAHH....",
+ "A VAMPIRE HAS KIDNAPPED THE GIRL IN ROOM 501",
+ "BUT YOU HAVE TO HELP ME OUT!",
+ "CAN'T YOU PLAY ONE FROM BLUR?",
+ "HOW CAN YOU STAY HERE ALL DAY PLAYING THE SAME SONG ALL THE TIME?",
+ "AND THEN, HOW CAN YOU HEAR ME?",
+ "PLEASE, LEND ME THE ERA-PLUGS",
+ "COME ON, I'LL GIVE THEM BACK TO YOU RIGHT AWAY",
+ "COOOMEE OONNN...",
+ "WELL GOODBYE, I HAVE TO KILL A VAMPIRE",
+ "",
+ "WHAT'S YOUR LANGUAGE, TRASILVANIAN?",
+ "WHO IS UNCLE DESIDERIO?",
+ "BUT, WHAT'S THE MATTER WITH THAT DRASCULA?",
+ "WHO IS THAT GUY NAMED VON BRAUN?",
+ "AND WHY DOESN'T HE DO IT?",
+ "AND WHERE CAN I FIND VON BRAUN?",
+ "WELL, THANKS AND GOODBYE. HOPE YOU SLEEP IT OFF JUST FINE",
+ "WE'D BETTER CALL FIRST",
+ "ARE YOU PROFESSOR BRAUN?",
+ "AND COULD YOU TELL ME WHERE I CA...?",
+ "I DON'T BELIEVE HE IS GANIMEDES THE DWARF",
+ "PROFESSOR!!",
+ "PLEASE HELP ME!. THE LIFE OF MY GIRLFRIEND DEPENDS ON YOU!!",
+ "WELL, ALL RIGHT. I DON'T NEED YOUR HELP",
+ "ALL RIGHT. I'M LEAVING",
+ "DON'T DE AFRAID. WE WILL BEAT DRASCULA TOGETHER",
+ "THEN WHY DON'T YOU HELP ME?",
+ "I GOT THEM",
+ "YES, I GOT THEM!!",
+ "ALL RIGHT",
+ "AHH....YES",
+ "I HAVE COME TO GET INTO THAT CABIN AGAIN",
+ "I AM READY TO FACE YOUR TEST",
+ "ALL RIGHT OLD MAN. I CAME FOR MY MONEY",
+ "NO, NOTHING. I WAS JUST LEAVING",
+ "SORRY...",
+ "DO YOU LIKE THIS BOOK?. IT HAS SOME SCORES FROM TCHAIKOWSKY",
+ "HOW CAN I KILL A VAMPIRE?",
+ "HAS ANYBODY TOLD YOU THAT SLEEPING IN A BAD POSITION IS NOT GOOD FOR YOU?",
+ "THAT'S WHAT MY MUM ALWAYS TELL ME",
+ "WHY WOULDN'T DRASCULA KILL YOU?",
+ "AND WHAT WAS IT?",
+ "GREAT! YOU HAVE AN IMMUNIZING BREW",
+ "SO?",
+ "ALL RIGHT",
+ "CAN YOU REPEAT WHAT I NEED FOR THAT BREW",
+ "WELL, I'LL RUSH OUT TO GET IT",
+ "HEY, WHAT HAPPENED WITH THE PIANIST?",
+ "I HAVE ALL THE INGREDIENTS OF THAT BREW",
+ "JUST A QUESTION. WHAT IS ALL THAT ABOUT THE ALUCSARD ETEREUM?",
+ "HELLO, HELLO...",
+ "AND WHERE IS THAT CAVERN?",
+ "WHAT HAPPENS? DIDN'T YOU HAVE TO GO TO THE COURT?",
+ "...BUT... IF I MEET MORE VAMPIRES?",
+ "IT'S A VAMPIRE THAT DOESN'T LET ME COME THROUGH",
+ "HE LOOKS LIKE YODA, BUT A LITTLE TALLER",
+ "HEY YODA, IF YOU JUST LET ME GO ON MY WAY, I'LL GIVE YOU A PENNY",
+ "OK, OK, YOU GET MAD ABOUT NOTHING MAN",
+ "HAS ANYBODY TOLD YOU THAT YOU LOOK LIKE YODA?",
+ "HI VAMPIRE, IT'S A BEAUTIFUL NIGHT, HUH?",
+ "ARE YOU A VAMPIRE OR AN OIL PAINTING?",
+ "I'D BETTER NOT SAY ANYTHING, IN CASE YOU GET MAD",
+ "IT'S LOCKED",
+ "THE MAGPIE WOULD STICK 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",
+ "THAT TOOK AWAY THE RUST",
+ "I HAVE FOUND A PINE STICK",
+ "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 MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\"",
+ "...HE IS PALE, HE HAS FANGS AND WEARS A TOUPE\220 AND HE SURE IS DRASCULA!",
+ "IT'S B.J.! ARE YOU ALL RIGHT B.J.?",
+ "YES, I KNOW SHE IS STUPID, BUT I'M SO LONELY",
+ "YOU DON'T HAVE A KEY AROUND THERE, DO YOU?",
+ "I BET YOU DON'T HAVE A PICKLOCK AROUND!",
+ "GIVE ME A HAIRPIN, I'M GOING TO PLAY MCGYVER HERE!",
+ "DON'T GO ANYWHERE. I'LL BE RIGHT BACK",
+ "SHOOT! IT'S BROKEN!",
+ "OLEEEE! I EVEN SHAVED DUDE!",
+ "YES, DARLING?",
+ "HE'S NOT ARRIVED YET",
+ "THE PIANIST IS NOT HERE",
+ "A TRANSYLVANIAN SCOTCH ON THE ROCKS",
+ "I DON'T HAVE A ROOM YET",
+ "IT LOOKS LIKE HE GOT STUCK IN THE BATH AND DECIDED TO RUN A BAR",
+ "HE WAS DRUNK AS A SAILOR",
+ "THAT HAIR...REMINDS ME OF SOMEBODY",
+ "IT'S A RAW-BONED SKELETON",
+ "LOOK! THERE'S MIGUEL BOSE!",
+ "HE'S ASLEEP. IT'D BE A SHAME WAKING HIM UP",
+ "HE'S UGLIER THAN EMILIO DE PAZ",
+ "A PINE-WOODEN COFFIN",
+ "HE IS GOING TO CUT ME IN LITTLE SLICES. JUST LIKE A SAUSAGE",
+ "I DON'T LIKE PENDULAE. I'D RATHER PREFER ARTICHOKES",
+ "I CAN'T MAKE IT. I'M HANDCUFFED",
+ "IT'S OBVIOUSLY A SECRET DOOR",
+ "THEY IGNORE ME",
+ "COME ON..!",
+ "WHEN I READ THE SCRIPT IT WAS SUPPOSED TO MOVE, BUT THE BUDGET GOT CRAZY AND THEY COULDN'T AFFORD TO PAY THE GYM, SO THAT I NEVER GOT TOUGH. END OF STORY",
+ "IT SEEMS A LITTLE LOOSE FROM THE WALL",
+ "I DON'T THINK IS GOING TO HELP ME ANYWAY. IT'S TOO WET TO LIGHT IT",
+ "TO WEST WING? NO WAY! NOBODY KNOWS WHAT YOU CAN FIND THERE!!",
+ "SHE'S GOT NICE TRANSILVANIAN REASONS",
+ "",
+ "IT'S A SHAME THERE ISN'T A ROASTED LAMB IN THERE",
+ "LAST TIME I OPENED AN OVEN I BLEW UP THE HOUSE",
+ "THAT'S THE TRANSILVANIAN FOOTBALL BADGE",
+ "WHAT FOR? TO PUT IT ON MY HEAD",
+ "I DON'T THINK THESE TOWERS ARE THE OPENING KIND",
+ "I DON'T WANT TO KNOW WHAT KIND OF FOOD IS IN THERE!",
+ "IT LOOKS IMPRESSIONIST TO ME...",
+ "THE NIGHT IS FALLING OVER ALL OF US...THAT'S SCARY, ISN'T IT?",
+ "IT'S STUCK!",
+ "IT'S THE KING. YOU DIDN'T IMAGINE THAT, DID YOU!",
+ "NO, I ALREADY HAVE ONE AT HOME TO FEED",
+ "A SHELF WITH BOOKS AND SOME OTHER THINGS",
+ "BUT WHO CAN I CALL AT THIS TIME?",
+ "\"HOW TO MAKE THE TAX RETURN FORMS\". HOW INTERESTING!",
+ "I ALREADY HAVE ONE AT HOME. I THINK IT'S A WORLDWIDE BEST SELLER",
+ "A COMPLETELY NORMAL KEY",
+ "I THINK SHE IS NOT FROM AROUND HERE",
+ "HEY, THEY'RE FANG-LIKE FRENCH FRIES! I LOVE IT!",
+ "I DON'T THINK THIS IS THE RIGHT TIME TO EAT THAT CRAP KNOWING THAT MY GIRLFRIEND HAS BEEN KIDNAPPED BY THE MOST EVIL PERSON EVER ON EARTH",
+ "I'M HAVING A GREAT TIME KILLING VAMPIRES WITH THIS THING!",
+ "LET'S SEE IF ANOTHER ONE COMES SOON!",
+ "NO, IT HAS TO BE WITH A DIRTY AND STINKY VAMPIRE, JUST LIKE THE ONE I KILLED BEFORE",
+ "THIS IS THE ONE AND ONLY WIG ELVIS USED WHEN HE GOT BALD",
+ "IT'S FLOUR, BUT DON'T ASK ME ANY COMMERCIAL NAMES",
+ "MAYBE ANOTHER TIME, OK?",
+ "THAT'S A GREAT AXE, IT'S A SHAME THERE IS NO VAMPIRE'S HEAD AROUND HERE, HUH?",
+ "NO. I'M REALLY A GOOD PERSON",
+ "IT'S MARGARET'S THATCHER DEODORANT...HA, HA, HA...!!",
+ "THAT'S A PRETTY CUTE CLOAK",
+ "",
+ "JUST LIKE ALL BRANCHES FROM ANY TREE IN THE WORLD, THERE IS NOTHING SPECIAL.",
+ "HEY, THAT'S AMAZING! A ROPE WITHIN THIS TYPE OF ADVENTURE!",
+ "I WONDER WHAT WE COULD USE IT FOR...",
+ "A ROPE TIED TO A BRANCH OR THE OTHER WAY AROUND, HOWEVER YOU WANT TO PUT IT...",
+ "IT LOOKS LIKE THIS MAGPIE IS EVIL-MINDED",
+ "FORGET IT, I'M NOT SAYING ANYTHING IN CASE HE GETS MAD",
+ "SHE LOOKS DEAD, BUT SHE REALLY ISN'T, HUH?",
+ "NO ANIMAL WAS HARMED DURING THE PRODUCTION OF THIS GAME",
+},
+{
+ "",
+ "Es la segunda puerta mas grande que he visto en mi vida",
+ "Bueno, no",
+ "Esta sellada con tablones. La iglesia debe llevar abandonada varios a\244os",
+ "Si no la he abierto",
+ "\250Que hago? \250La arranco?",
+ "Hola puerta. Te voy a hacer un marco.",
+ "Demasiado para mi.",
+ "una ventana sellada con tablones.",
+ "No puedo.",
+ "Ya lo esta.",
+ "\250Y pa que?",
+ "Hola ventana. \250Tienes algo que hacer esta noche?",
+ "No sin el permiso de obras publicas",
+ "\255eh! esa ventana tiene solo un tablon...",
+ "\255Eoooooo! \255Ventana!",
+ "Hola tu.",
+ "",
+ "No alcanzo.",
+ "Esta bien donde esta.",
+ "",
+ "Es una tumba en forma de cruz.",
+ "No gracias.",
+ "Hola muerto. \250quieres gusanitos?",
+ "Si hombre. Como en Poltergueist.",
+ "",
+ "",
+ "Vuelvo en quince minutos.",
+ "Prohibido pegar carteles.",
+ "",
+ "Esta cerrado con llave.",
+ "Ya tengo uno.",
+ "",
+ "No contesta.",
+ "No, esta bien aparcado.",
+ "Es una puerta.",
+ "Un cajon de la mesa.",
+ "Un sospechoso armario.",
+ "Hola armario. \250Que tal?",
+ "",
+ "",
+ "Es un candelabro muy viejo.",
+ "Debe de llevar aqui desde que Mazinguer-z era un tornillo.",
+ "No. Es una reliquia.",
+ "Es un bonito retablo.",
+ "",
+ "Ji, ji, ji.",
+ "",
+ "No.",
+ "",
+ "Ja, ja, ja. \255que bueno!",
+ "",
+ "",
+ "",
+ "No veo nada en especial.",
+ "Es Fernan, la planta.",
+ "Es una de las picas de la verja.",
+ "\255Eh! Aqui debajo hay una caja de cerillas.",
+ "\255Mira! un paquete de clinex. \255Y hay uno sin usar!",
+ "No hay nada mas en el cubo.",
+ "Es un ciego que no ve.",
+ "",
+ "",
+ "",
+ "",
+ "Es una cuantiosa cantidad de dinero.",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "NO TIENE NADA DE ESPECIAL",
+ "NO ES NADA FUERA DE LO NORMAL",
+ "\250QUE PASA TU?",
+ "HOLA",
+ "\250NADA NUEVO?",
+ "\250QUE TAL LA FAMILIA?",
+ "\255QUE COSAS TIENES!",
+ "\255PERO COMO VOY A COGER ESO!",
+ "MI RELIGION ME LO PROHIBE",
+ "MEJOR NO",
+ "\255SI HOMBRE!",
+ "NI HABLAR DE ESO",
+ "IMPOSIBLE",
+ "ESTO NO SE ABRE",
+ "YO SOLO NO PUEDO",
+ "SI QUISIERA PODRIA, PERO ES QUE ME DA PEREZA",
+ "NO LE VEO MOTIVO APARENTE",
+ "ES UN CEREBRO BASTANTE MAJO",
+ "Y BIEN, CEREBRO \250QUE PIENSAS HACER ESTA NOCHE?",
+ "NO, DEBE CONSERVARSE EN LUGAR CERRADO A LA ACCION MUTANTE DE LA ATMOSFERA",
+ "ES UN HUESO, COMO MI JEFE",
+ "UNA ESTACA MUY AFILADA",
+ "FIEL ESTACA PUNTIAGUDAAA, NOBLE ROBLE TRANSILVAAANOO",
+ "\255VAYA, ME TENGO QUE CORTAR LAS U\245AS!",
+ "\255AHI DENTRO ESTA B.J., Y HAY QUE VER COMO ESTA LA TIA!",
+ "ESTA CERRADA A CAL Y CANTO",
+ "\"CANDADOS CAL Y CANTO S.A.\"",
+ "ES EL TIPICO ESQUELETO QUE ESTA EN TODAS LAS MAZMORRAS DE TODOS LOS JUEGOS",
+ "SE SUELE USAR PARA COMUNICAR CORRIENTE ELECTRICA A LOS APARATOS A EL ENCHUFADOS",
+ "ES TOTALMENTE ARTESANAL, PORQUE LOS JAPONESES LOS HACEN DE BOLSILLO",
+ "SOLO HE VISTO EN MI VIDA OTRA COSA TAN FEA",
+ "QUITA. NO LE DIGO NADA A VER SI SE VA A ENFADAR",
+ "PARECE BASTANTE RACIONAL",
+ "ES UNA FOTO DE PLATON ESCRIBIENDO SU DIALOGO PERDIDO",
+ "NO SOY DE LOS QUE HABLAN CON POSTERS",
+ "UN ESCRITORIO MUY MONO",
+ "ES UN DIPLOMA DE CAZA-CAZA-VAMPIROS HOMOLOGADO POR LA UNIVERSIDAD DE OXFORD",
+ "ES NOCHE CERRADA CON LUNA LLENA",
+ "PARECE QUE ESTOS TORNILLOS NO ESTAN MUY ENROSCADOS",
+ "NO MIRES, PERO CREO QUE UNA CAMARA OCULTA ME ESTA ENFOCANDO",
+ "UN DETECTOR DE ESTACAS MUY MODERNO",
+ "NO, EL LABORATORIO ESTA EN EL SEGUNDO PISO",
+ "UNA BONITA MESILLA DE NOCHE",
+ "ES UN MONTON DE DINERO QUE NO PUEDE FALTAR EN UNA AVENTURA QUE SE PRECIE",
+ "SI YO FUERA RICO, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ "SON UNAS EXTRA\245AS HOJAS. DEBEN DE HABERLAS TRAIDO DE SUDAMERICA, O POR AHI",
+ "NO CREO QUE ME CONTESTARAN",
+ "ES UN BONITO CRUCIFIJO DE MADERA. EL ICONO NO CAPTA TODA LA EXTENSION DE SU BELLEZA",
+ "YO SOLO REZO ANTES DE ACOSTARME",
+ "\255EH, PARECE QUE ESTA PICA ESTA UN POQUITO SUELTA!",
+ "PARA QUE LUEGO TE QUEJES DE QUE NO DOY PISTAS",
+ "ES UNA PICA BASTANTE CONVENCIONAL",
+ "SON MONOS, AUNQUE TIENEN UN POCO DE MIERDECILLA",
+ "NO, NO ME OIRIAN. JI,JI,JI \255QUE BUENO!",
+ "\"LA BELLA DURMIENTE DEL BOSQUE\" DE CHAIKOSKY, O CHOIFRUSKY, O COMO SE DIGA",
+ "MUY APETITOSO",
+ "NO, YO NO SOY DE ESOS QUE SE METEN EN LA BOCA CHICLES USADOS",
+ "UNA HOZ MUY MONA. ME PREGUNTO DONDE ESTARA EL MARTILLO",
+ "\"LOS FABRICANTES DE TABACO ADVIERTEN QUE LAS AUTORIDADES SANITARIAS PERJUDICAN SERIAMENTE LA SALUD\"",
+ "UNA VELA NORMAL Y CORRIENTE, CON CERA Y TODO",
+ "\255HAY QUE VER COMO BRILLAN ESTAS DOS BRILLANTES MONEDAS!",
+ "\255HAY QUE VER COMO BRILLA ESTA BRILLANTE MONEDA!",
+ "CON ESTO SERE INMUNE A LAS MORDEDURAS DE LOS VAMPIROS",
+ "NO, TODAVIA NO ES EL MOMENTO",
+ "HAY UN BILLETE DE MIL Y UN PAR DE MONEDAS",
+ "DICE \"SE RUEGA NO ECHAR COMIDA AL PIANISTA\"",
+ "TORTILLA, 200. PESCAITOS FRITOS, 150, PATATAS ALIOLI, 225",
+ "LAS MEJORES HAMBUERGUESAS A ESTE LADO DEL DANUBIO, POR SOLO 325",
+ "ES UNA BONITA CALAVERA, CON UNA MIRADA MUY PENETRANTE. \255JI, JI, JI, QUE BUENO!",
+ "HOLA CALAVERA, ME RECUERDAS AL TIO DE HAMLET",
+ "TENGO POR COSTUMBRE NO TOCAR COSAS QUE HAYAN ESTADO VIVAS",
+ "ES UNA PAPELERA",
+ "ES UNA PORRA PARA EL PARTIDO DE ESTA NOCHE",
+ "ME PREGUNTO QUE HABRA DETRAS",
+ "\255EH, ESTA CORTINA NO SE MUEVE!",
+ "HAY QUE VER, QUE TETRICO ES ESE CASTILLO, \250EH? ",
+ "NO PUEDO, ESTA DEMASIADO LEJOS PARA OIRME",
+ "ES UN TIPICO BOSQUE TRANSILVANO, CON ARBOLES ",
+ "\255PERO QUE TONTERIAS DICES, CON LO OSCURO QUE ESTA!",
+ "CONFITERIA GARCIA. PASTELES Y CHICLES.",
+ "UNA PUERTA MUY BONITA",
+ "ESTA CERRADA",
+ "UN BARRIL COMPLETAMENTE CERRADO",
+ "",
+ "\255QUE BICHOS MAS MONOS!",
+ "BSSST, BSSST, GATITO...",
+ "NO CONTESTA",
+ "LA LUNA ES UN SATELITE QUE GIRA ALREDEDOR DE LA TIERRA CON UN PERIODO DE REVOLUCION DE 28 DIAS",
+ "HOLA, LUNA LUNERA CASCABELERA ",
+ "ESTA TOTALMENTE TAPIADA CON TABLONES",
+ "IMPOSIBLE. ESTO NO LO ABRE NI EL MAYORDOMO DE LA TELE",
+ "\255EH, PARECE QUE LA SOMBRA DE ESE CIPRES ES ALARGADA!",
+ "\255EOOO, TABERNEROOO!",
+ "QUISIERA UNA HABITACION ",
+ "\250SABE DONDE PUEDO ENCONTRAR A UN TAL CONDE DRASCULA?",
+ "SI, \250QUE PASA? ",
+ "\250Y ESO?",
+ "\250DE... DE VERDAD?",
+ "BUENA PREGUNTA, LE VOY A CONTAR MI HISTORIA, MIRE...",
+ "SON SOLO CINCO MINUTOS",
+ "ME LLAMO JOHN HACKER, Y SOY REPRESENTANTE DE UNA INMOBILIARIA BRITANICA",
+ "AL PARECER, EL CONDE DRASCULA QUIERE COMPRAR UNOS TERRENOS EN GIBRALTAR, Y ME HAN MANDADO A MI PARA NEGOCIAR LA VENTA",
+ "PERO ME PARECE A MI QUE MA\245ANA TEMPRANITO ME VUELVO CON MI MAMA",
+ "BONITA NOCHE \250VERDAD?",
+ "NO, NADA",
+ "EOOOO, PIANISTA",
+ "BONITA NOCHE",
+ "Y ADEMAS NO HACE FRIO",
+ "PUES NADA, TE DEJO QUE SIGAS TOCANDO",
+ "PUES ESO",
+ "HOLA JEFE, \250QUE TAL?",
+ "\250Y LA FAMILIA?",
+ "HAY AMBIENTE AQUI \250EH?",
+ "MEJOR NO DIGO NADA",
+ "SE ESTA MEJOR EN CASA QUE EN NINGUN SITIO... SE ESTA MEJOR EN... \250EH? PERO SI USTED NO ES LA TIA ENMA. ES MAS. \255SI YO NO TENGO NINGUNA TIA ENMA!",
+ "SI, EL MIO TAMBIEN. USTED PUEDE LLAMARME COMO LE APETEZCA, AUNQUE SI ME LLAMA JOHNY, ACUDO COMO LOS PERROS",
+ "SI, QUE GOLPES TENGO \250VERDAD? POR CIERTO, \250DONDE ESTOY?",
+ "SI.",
+ "CACHIS... ",
+ "OH, SI. POR SUPUESTO",
+ "PUES MUCHAS GRACIAS POR PRESTARME TU AYUDA. NO TE MOLESTO MAS. SI ME DICES DONDE ESTA LA PUERTA, POR FAVOR... ",
+ "PORQUE EL GOLPE ME HA DEBIDO AFECTAR AL CEREBRO Y NO VEO TRES EN UN BURRO ",
+ "BAH, NO IMPORTA. SIEMPRE LLEVO DE REPUESTO",
+ "\255GUAU, QUE TIA MAS BUENA! \255NO ME HABIA DADO CUENTA YO! CLARO, SIN LAS GAFAS",
+ "OYE... ",
+ "\255\250 Y ESTOOOOOO?!",
+ "\255NO TE PREOCUPES B.J., AMOR MIO! TE SALVARE DE LAS GARRAS DE ESE ",
+ "ME HA TOCADO LAS NARICES, VAMOS.",
+ "\255AHHH, UN HOMBRE LOBO! \255MUERE MALDITO!",
+ "SI, ESTO...",
+ "SI, ESTO... CREO QUE SEGUIRE MI CAMINO. CON PERMISO... ",
+ "\250QUE?",
+ "PUES LA VERDAD, PENSANDOLO BIEN... CREO QUE NO",
+ "DIME, OH ERUDITO FILOSOFO, \250EXISTE ALGUNA RELACION CAUSA-EFECTO ENTRE LA VELOCIDAD Y EL TOCINO?",
+ "VALE, VALE, DEJALO. DE TODAS FORMAS, NO SE POR QUE HE DICHO ESO.",
+ "\250QUE HACES AQUI FILOSOFANDO, QUE NO TE ESTAS COMIENDO GENTE?",
+ "\250Y ESO?",
+ "OYE, PUEDES REPETIR ESO DE \"INCLINACIONES PRE-EVOLUTIVAS\"?",
+ "SI HOMBRE. ESE ROLLO QUE ME HAS SOLTADO ANTES. ES QUE NO ME HE ENTERADO MUY BIEN...",
+ "NO, MEJOR NO DIGO NADA, QUE COMO LE TOQUE LA VENA...",
+ "\250SI, DIGA?",
+ "SI, \250QUE PASA? ",
+ "AH, PUES AHORA QUE SACA EL TEMA LE DIRE QUE...",
+ "",
+ "POR CIERTO, \250QUE PASARIA SI UN VAMPIRO SE HICIERA CIRCUNSTANCIALMENTE CON LA RECETA... ",
+ "PUES NADA. OYE, \250A QUE ESTO PARECE UN PEGOTE PUESTO EN EL GUION PARA ACABAR PRONTO EL JUEGO? BUENO, A LO MEJOR NO",
+ "\255ESTA VACIO!",
+ "PORQUE ME ROBASTE MI AMOR, B.J. SIN ELLA LA VIDA PARA MI NO TIENE SENTIDO",
+ "\255\250SU CEREBRO?!",
+ "PUES NO ES POR NADA, PERO ME PARECE QUE ME HA CARGADO TU MONSTRUITO",
+ "\255VIRGENCITA, QUE ME QUEDE COMO ESTOY!",
+ "\255NO TE SALDRAS CON LA TUYA. SEGURO QUE APARECE SUPERLOPEZ Y ME RESCATA!",
+ "VAYA UNA MIERDA DE JUEGO EN EL QUE MUERE EL PROTAGONISTA ",
+ "UN MOMENTO, \250QUE HAY DE MI ULTIMO DESEO?",
+ "\255JA, JA! AHORA ESTOY INMUNIZADO CONTRA TI MALDITO DEMONIO. ESTE CIGARRILLO ES UNA POCION ANTIVAMPIRICA QUE ME DIO VON BRAUN ",
+ "SI, CLARO. PERO NUNCA CONSEGUIRAS QUE TE DIGA LA RECETA",
+ "PUEDO SOPORTAR LA TORTURA, ADEMAS DE CREARLA ",
+ "\255NO, POR FAVOR! \255HABLARE, PERO NO ME HAGA ESO!",
+ "BUENO. YA TE HE DICHO LO QUE QUERIAS SABER. AHORA LIBERANOS A B.J. Y A MI Y DEJANOS EN PAZ",
+ "\255B.J.! \250QUE HACES AQUI? \250DONDE ESTA DRASCULA?",
+ "\255QUE DESALMADO! SOLO PORQUE PERTENECE A LA NOBLEZA SE CREE QUE TIENE EL DERECHO DE PERNADA CON CUALQUIERA QUE SE LE ANTOJE ",
+ "\255ABAJO LA ARISTOCRACIA CACIQUIL!",
+ "\255ARRIBA LOS POBRES DEL MUUNDOOO....",
+ "Y POR LO QUE VEO TE HA ENCADENADO CON CANDADO Y TODO",
+ "BUENO, VALE. \250NO TENDRAS UNA HORQUILLA?",
+ "BUENO, BUENO. NO TE PONGAS ASI, YA SE ME OCURRIRA ALGO.",
+ "EH, TABERNERO",
+ "\250COMO VA EL PARTIDO?",
+ "\250QUIEN?",
+ "\250ES QUE NO VES QUE ESTA AQUI DRASCULA?",
+ "PUES VAMOS A ACABAR CON EL \250NO?",
+ "PONME UN CUBATA...",
+ "NADA. SE ME HA OLVIDADO LO QUE TE IBA A DECIR",
+ "O\247ME\247PONES\247UN\247CUBATA\247O\247ME\247PONGO\247A\247TOCAR\247EL\247PIANO",
+ "\250CUANTO QUEDA PARA QUE ACABE EL PARTIDO?",
+ "BUENAS NOCHES",
+ "\250Y QUE TAL ANDAS IGOR? \250JOROBAO? \255JI,JI,JI, QUE BUENO! ",
+ "\250QUE SE SUPONE QUE HACES?",
+ "PUES NO",
+ "PUES PONTE GAFAS",
+ "\250QUE ES ESO DE LA ORGIA SOBRENATURAL?",
+ "VALE, VALE, NO SIGAS. YA ME HAGO UNA IDEA",
+ "\250NO PODRIAS DECIRME DONDE ESTA DRASCULA? ",
+ "ANDA, PORFAAA",
+ "\250POR QUE NO?",
+ "AH, PERO \250DUERME POR LA NOCHE?",
+ "BUENO, PUES QUE SE DE BIEN LA RENTA",
+ "ES QUE TENGO QUE HABLAR CON EL",
+ "\255EOOO, ESQUELETOOO! ",
+ "\255CANASTOS! \255UN MUERTO QUE HABLA!",
+ "CUENTAME, \250COMO HAS VENIDO A PARAR AQUI?",
+ "\250Y PARA QUE VA A QUERER DRASCULA CREAR UN MONSTRUO? ",
+ "\250CUAL ES TU NOMBRE, AMIGO ESQUELETO?",
+ "OYE, \250NO QUIERES QUE TE TRAIGA NADA DE COMER?",
+ "DEBES TENER EL ESTOMAGO VACIO. \255JI, JI, JI!",
+ "LA VERDAD ES QUE NO ME APETECE HABLAR AHORA",
+ "\255LA MADRE QUE...(PITIDO) ESPERO QUE TE...(PITIDO) Y QUE TE...(PITIDO) DOS VECES!",
+ "YO LA QUERIA, DE VERDAD. VALE, DE ACUERDO QUE NO ERA UNA LUMBRERA, PERO NADIE ES PERFECTO \250NO? ",
+ "ADEMAS, TENIA UN CUERPAZO QUE PARA QUE QUEREMOS MAS",
+ "YA NO VOLVERE A SER EL MISMO. ME RECLUIRE EN UN MONASTERIO A DEJAR QUE MI VIDA SE ME ESCAPE POCO A POCO",
+ "NADA PODRA YA SACARME DE ESTA MISERIA PORQUE...",
+ "\250DE QUIEN? \250DE QUIEN?",
+ "QUIERO SER PIRATA",
+ "QUIERO SER PROGRAMADOR ",
+ "CONTADME ALGO SOBRE PELAYO",
+ "SEGUIRE JUGANDO Y OLVIDARE QUE OS HE VISTO ",
+ "\255A QUIEN SE LE HABRA OCURRIDO ESTA IDIOTEZ!",
+ "ES UN BOLSO COMO EL DE MI ABUELITA ",
+ "\255PERO QUE BUENO QUE ESTOY!",
+ "CUANTO MAS ME MIRO MAS ME GUSTO",
+ "\250Y LUEGO COMO ME CIERRO?",
+ "TENDRE QUE ABRIRME PRIMERO \250NO?",
+ "ESTOY BIEN DONDE ESTOY",
+ "YA ME TENGO",
+ "HOLA YO",
+ "ME LOS PONDRE CUANDO LA OCASION SEA OPORTUNA",
+ "NO VEO NADA EN ESPECIAL",
+ "ESTA BIEN DONDE ESTA",
+ "\250Y PA QUE?",
+ "NO PUEDO",
+ "HOLA TU",
+ "ES EL PANTEON DEL TIO DESIDERIO",
+ "\255EOOOO, TIO DESIDERIOOOO!",
+ "NO. NO QUIERO CORTARME OTRA VEZ",
+ "\255EJEM,JEM...!",
+ "\255YAMM, EMMM, JH!",
+ "\255SI, COF,COF!",
+ "ANDA, SI HAY UN CHICLE AQUI PEGADO",
+ "ES EL MOVILANI QUE ME REGALARON EN NAVIDAD",
+ "\255QUE ALTO ESTA!",
+ "\255SAL AL BALCON JULIETA!",
+ "\255TU ERES LA LUZ QUE ILUMINA MI CAMINO!",
+ "EH,PUERTA \250QUE PASSA?",
+ "EOOO, MAQUINA DE TABACO DE TRANSILVANIAAA",
+ "ES UNA MAQUINA EXPENDEDORA DE TABACO",
+ "TENGO OTRA MONEDA DENTRO",
+ "NO. HE DECIDIDO DEJAR EL TABACO Y EL ALCOHOL ",
+ "A PARTIR DE AHORA ME DEDICARE SOLO A LAS MUJERES ",
+ "\255ESTO ES UN TIMO! NO HA SALIDO NADA",
+ "\255POR FIN! ",
+ "PUES ESO, UN BAUL",
+ "HOLA BAUL, TE LLAMAS COMO MI PRIMO QUE SE LLAMA RAUL.",
+ "HE ENCONTRADO EL BOLSO DE B.J.",
+ "DIOS MIO, NO ME REFLEJO \255SOY UN VAMPIRO!",
+ "...AH, NO. ES QUE ES UN DIBUJO",
+ "ESPEJITO: \250QUIEN ES EL MAS BELLO DEL REINO?",
+ "NO ME QUIERE ABRIR",
+ "MUY BIEN. ME HE PUESTO LOS TAPONES",
+ "ES UN DIPLOMA DE CAZA-VAMPIROS HOMOLOGADO POR LA UNIVERSIDAD DE CAMBRIDGE",
+ "NO, AUN ME FALTAN INGREDIENTES, NO VALE LA PENA DESPERTARLE",
+ "ES QUE NO TENGO DINERO",
+ "ES UNA LAMPARA BRITANICA",
+ "\255TABERNERO! \255AYUDEME!",
+ "HA APARECIDO UN VAMPIRO Y SE HA LLEVADO A MI NOVIA",
+ "\255\250PERO NO VA USTED A AYUDARME?!",
+ "\250MUERTA? \250QUE ES LO QUE QUIERE DECIR?",
+ "\255EJEM!",
+ "\255UN VAMPIRO HA SECUESTRADO A LA CHICA DE LA 506!",
+ "\255TIENES QUE AYUDARME!",
+ "\250NO SABES TOCAR NINGUNA DE LOS INHUMANOS?",
+ "\250COMO TE AGUANTAS, TODO EL DIA TOCANDO LO MISMO?",
+ "\250Y ENTONCES COMO ME OYES?",
+ "DEJAME LOS TAPONES",
+ "ANDA. SI TE LOS DEVUELVO ENSEGUIDA",
+ "VENGAAAA...",
+ "ADIOS. TENGO QUE MATAR A UN VAMPIRO",
+ "",
+ "\250QUE HABLAS? \250EN TRANSILVANO?",
+ "\250QUIEN ES EL TIO DESIDERIO?",
+ "\250PERO QUE PASA CON ESE TAL DRASCULA?",
+ "\250QUIEN ES ESE TAL VON BRAUN?",
+ "\250Y POR QUE NO LO HACE?",
+ "\250Y DONDE PUEDO ENCONTRAR A VON BRAUN?",
+ "PUES GRACIAS Y ADIOS, QUE LA DUERMAS BIEN",
+ "SERA MEJOR LLAMAR PRIMERO",
+ "\250ES USTED EL PROFESOR VON BRAUN?",
+ "\250Y NO ME PODRIA DECIR DONDE PUEDO...?",
+ "NO ME CREO QUE SEA EL ENANO GANIMEDES",
+ "\255PROFESOR!",
+ "\255AYUDEME! \255LA VIDA DE MI AMADA DEPENDE DE USTED!",
+ "ESTA BIEN, NO NECESITO SU AYUDA",
+ "DE ACUERDO. ME VOY",
+ "NO TENGA MIEDO. JUNTOS VENCEREMOS A DRASCULA",
+ "ENTONCES \250POR QUE NO ME AYUDA?",
+ "YO LAS TENGO",
+ "\255SI LAS TENGO!",
+ "DE ACUERDO",
+ "...ER ...SI",
+ "VENGO A METERME EN ESA CABINA DE NUEVO",
+ "ESTOY PREPARADO PARA ENFRENTARME A SU PRUEBA",
+ "ESTA BIEN, VEJETE. HE VENIDO A POR MI DINERO",
+ "NO, NADA. YA ME IBA",
+ "PERDONA",
+ "\250TE INTERESA ESTE LIBRO? TIENE PARTITURAS DE TCHAIKOWSKY",
+ "\250COMO PUEDO MATAR A UN VAMPIRO?",
+ "\250NO TE HAN DICHO QUE ES MALO DORMIR EN MALA POSTURA?",
+ "PUES ES LO QUE SIEMPRE ME DICE A MI MI MADRE",
+ "\250POR QUE NO TE PUDO MATAR DRASCULA?",
+ "\250Y QUE FUE?",
+ "\255ESTUPENDO! \255TIENE USTED UNA POCION DE INMUNID...!",
+ "\250ENTONCES?",
+ "MUY BIEN",
+ "\250ME PUEDE REPETIR LO QUE NECESITO PARA ESA POCION?",
+ "PUES PARTO RAUDO A BUSCARLO",
+ "OIGA, \250QUE HA PASADO CON EL PIANISTA?",
+ "YA\247TENGO\247TODOS\247LOS\247INGREDIENTES\247DE\247ESA\247POCION",
+ "UNA PREGUNTA: \250QUE ES ESO DE ALUCSARD ETEREUM?",
+ "DIGA, DIGA... ",
+ "\250Y DONDE ESTA ESA GRUTA?",
+ "\250QUE PASA? \250NO TENIAIS JUZGADO?",
+ "...PERO ...\250Y SI ME ENCUENTRO A MAS VAMPIROS?",
+ "ES UN VAMPIRO QUE NO ME DEJA PASAR",
+ "SE PARECE A YODA, PERO MAS ALTO ",
+ "EH, YODA. SI ME DEJAS PASAR TE DOY UN DURO",
+ "BUENO VALE, QUE NO SE TE PUEDE DECIR NADA",
+ "HOLA VAMPIRO, BONITA NOCHE \250VERDAD?",
+ "\250TE HAN DICHO ALGUNA VEZ QUE TE PARECES A YODA?",
+ "\250ERES UN VAMPIRO O UNA PINTURA AL OLEO?",
+ "MEJOR NO TE DIGO NADA, NO TE VAYAS A ENFADAR",
+ "ESTA CERRADA CON LLAVE",
+ "\255LA URRACA ME PODRIA SACAR UN OJO SI LO INTENTO!",
+ "\255ESTA CERRADA! \255DIOS MIO, QUE MIEDO!",
+ "LAS BISAGRAS ESTAN OXIDADAS",
+ "AQUI DENTRO SOLO HAY UN BOTE CON HARINA",
+ "ESO HA QUITADO EL OXIDO",
+ "HE ENCONTRADO UNA ESTACA DE PINO",
+ "COGERE ESTE QUE ES MAS GORDO",
+ "BUENO, CREO QUE YA PUEDO DESHACERME DE ESTE ESTUPIDO DISFRAZ",
+ "\"PASADIZO A LOS TORREONES CERRADO POR OBRAS. POR FAVOR, UTILICEN ENTRADA PRINCIPAL. DISCULPEN LAS MOLESTIAS\"",
+ "...ES PALIDO, TIENE COLMILLOS, TIENE TUPE Y USA CAPA... \255SEGURO QUE ES DRASCULA!",
+ "\255ES B.J.! B.J. \250ESTAS BIEN?",
+ "SI, YA LO SE QUE ES TONTA, PERO ES QUE ESTOY DE SOLO",
+ "NO TENDRAS UNA LLAVE POR AHI, \250VERDAD? ",
+ "\250A QUE NO TIENES UNA GANZUA?",
+ "DAME UNA HORQUILLA. VOY A HACER COMO MCGYVER",
+ "NO TE MUEVAS QUE AHORA VUELVO",
+ "\255CACHIS! \255SE ME HA ROTO!",
+ "\255OLEEEE! \255Y ADEMAS ME HE AFEITADO, COLEGA!",
+ "\250SI, CARI\245O?",
+ "NO LLEGA",
+ "EL PIANISTA NO ESTA",
+ "UN CUBATA TRANSILVANO",
+ "AUN NO TENGO HABITACION",
+ "PARECE QUE SE QUEDO ATASCADO EN LA BA\245ERA Y DECIDIO PONER UN BAR",
+ "ESTA COMO UNA CUBA DE CUBA",
+ "ESE PELO... EL CASO ES QUE ME RECUERDA A ALGUIEN",
+ "ES UN ESQUELETO HUESUDO",
+ "\255MIRA! \255MIGUEL BOSE!",
+ "ESTA DURMIENDO. SERIA UNA PENA DESPERTARLE",
+ "ES MAS FEO QUE EMILIO DE PAZ ",
+ "UN ATAUD DE MADERA DE PINO",
+ "ME VA A CORTAR EN RODAJITAS, COMO A UN SALCHICHON",
+ "NO ME GUSTAN LOS PENDULOS. PREFIERO LAS ALCACHOFAS",
+ "MIS MANOS ESTAN ESPOSADAS. NO VOY A PODER",
+ "SALTA A LA VISTA QUE ES UNA PUERTA SECRETA",
+ "ME IGNORAN",
+ "\255ANDA YA!",
+ "EN EL GUION SE MOVIA, PERO EL JUEGO SE SALIO DE PRESUPUESTO Y NO PUDIERON PAGARME UN GIMNASIO PARA PONERME CACHAS, ASI QUE NADA",
+ "PARECE QUE ESTA UN POCO SUELTA DE LA PARED",
+ "NO CREO QUE ME VAYA A SERVIR DE NADA. ESTA DEMASIADO HUMEDA PARA ENCENDERLA",
+ "\250AL ALA OESTE? \255NI LOCO! \255A SABER QUE HABRA ALLI!",
+ "TIENE BONITOS MOTIVOS TRANSILVANOS ",
+ "",
+ "QUE PENA QUE AHI DENTRO NO HAYA UN CORDERITO ASANDOSE ",
+ "LA ULTIMA VEZ QUE ABRI UN HORNO LA CASA SALTO POR LOS AIRES",
+ "ES EL ESCUDO DEL EQUIPO DE FUTBOL DE TRANSILVANIA",
+ "\250Y PARA QUE? \250PARA PONERMELA EN LA CABEZA?",
+ "NO CREO QUE ESTOS CAJONES SEAN DE LOS QUE SE ABREN",
+ "\255NO QUIERO SABER LA COMIDA QUE HABRA AHI DENTRO!",
+ "ME DA LA IMPRESION DE QUE ES IMPRESIONISTA",
+ "LA NOCHE SE APODERA DE TODOS... QUE MIEDO \250NO?",
+ "ESTA ATRANCADA",
+ "ES EL REY \250ES QUE NO TE LO HABIAS IMAGINADO?",
+ "NO, YA TENGO UNO EN MI CASA, AL QUE LE DOY DE COMER Y TODO",
+ "UNA ESTANTERIA CON LIBROS Y OTRAS COSAS ",
+ "\250Y A QUIEN LLAMO A ESTAS HORAS?",
+ "\"COMO HACER LA DECLARACION DE LA RENTA\" \255QUE INTERESANTE!",
+ "YA TENGO UNO EN MI CASA. CREO QUE ES UN BEST-SELLER MUNDIAL ",
+ "UNA LLAVE COMPLETAMENTE NORMAL",
+ "ME PARECE A MI QUE ESTA NO ES DE AQUI",
+ "\255EH, SON PATATAS FRITAS CON FORMA DE COLMILLO! ME ENCANTA",
+ "NO CREO QUE SEA EL MEJOR MOMENTO DE PONERSE A COMER CHUCHERIAS, CON MI NOVIA EN MANOS DEL SER MAS MALVADO QUE HA PARIDO MADRE",
+ "\255QUE BIEN ME LO ESTOY PASANDO CARGANDOME VAMPIROS CON ESTO!",
+ "A VER SI APARECE OTRO PRONTO",
+ "NO, TIENE QUE SER CON UN VAMPIRO SUCIO Y MALOLIENTE COMO EL QUE ME CARGUE ANTES",
+ "ES LA AUTENTICA PELUCA QUE USO ELVIS CUANDO SE QUEDO CALVO",
+ "ES HARINA, PERO NO PUEDO DECIR MARCAS",
+ "QUIZA EN OTRO MOMENTO \250VALE?",
+ "ES UN HACHA MAGNIFICA, QUE PENA QUE NO HAYA POR AQUI CERCA NINGUNA CABEZA DE VAMPIRO",
+ "NO. EN EL FONDO SOY BUENA PERSONA",
+ "ES EL DESODORANTE DE LA TACHER \255JI,JI,JI!",
+ "ES UNA CAPA BASTANTE MONA",
+ "",
+ "COMO TODAS LAS RAMAS DE TODOS LOS ARBOLES DE TODO EL MUNDO, O SEA, SIN NADA DE PARTICULAR",
+ "\255OH, INCREIBLE! \255UNA CUERDA EN UNA AVENTURA GRAFICA!",
+ "ME PREGUNTO PARA QUE SERVIRA...",
+ "UNA CUERDA ATADA A UNA RAMA O UNA RAMA ATADA A UNA CUERDA, SEGUN SE MIRE",
+ "PARECE QUE ESTA URRACA TIENE MUY MALAS INTENCIONES",
+ "QUITA, YO NO LA DIGO NADA, A VER SI SE VA A ENFADAR",
+ "PARECE QUE ESTA MUERTA, PERO ES MENTIRA \250EH?",
+ "NINGUN ANIMAL DA\245ADO EN LA PRODUCCION DE ESTE JUEGO",
+},
+{
+ "",
+ "Das ist die zweitgroesste Tuer, die ich je gesehen habe !",
+ "Ok, stimmt nicht ganz....",
+ "Sie haben Bretter davorgenagelt. Die Kirche scheint seit Jahren leer zu stehen",
+ "Aber ich habe sie doch nicht aufgemacht!",
+ "Soll ich sie aufbrechen ?",
+ "Hallo Tuer! Ich verpasse Dir jetzt mal einen Rahmen!",
+ "Zuviel fuer mich !",
+ "ein zugenageltes Fenster",
+ "Ich schaff\357es nicht!",
+ "Schon geschafft!",
+ "Und wozu?",
+ "Hallo Fenster. Hast Du heute abend schon was vor?",
+ "Nicht ohne Genehmigung der Staedtischen Baubehoerde",
+ "hey! Das Fenster da hat nur EIN Brett...",
+ "Heyhooo! Fenster!",
+ "Hallo Du",
+ "",
+ "Ich komme nicht dran!",
+ "Gut so ! ",
+ "",
+ "Es ist ein Grabstein in Form eines Kreuzes.",
+ "Nein, danke",
+ "Hallo Toter. Willst Du ein paar Wuermchen?",
+ "Klar Mann ! Wie in Poltergeist.",
+ "",
+ "",
+ "Bin in einer Viertelstunde zurueck!",
+ "Plakate ankleben verboten",
+ "",
+ "Sie ist abgeschlossen.",
+ "Ich habe schon eins.",
+ "",
+ "Keine Reaktion !",
+ "Nein, da steht es gut !",
+ "Es ist eine Tuer",
+ "Eine Schublade vom Tisch",
+ "Ein verdaechtiger Schrank",
+ "Hallo Schrank. Alles klar?",
+ "",
+ "",
+ "Ein uralter Kerzenstaender",
+ "Der stammt wohl noch aus der Zeit als meine Ururururoma in den Kindergarten ging ",
+ "Nein, eine Reliquie aus vergangenen Zeiten",
+ "Es ist ein huebsches Altarbild",
+ "",
+ "Hi,hi,hi",
+ "",
+ "Nein.",
+ "",
+ "Ha,ha,ha! klasse!",
+ "",
+ "",
+ "",
+ "Ich sehe nichts besonderes",
+ "Freddy, die Topfblume",
+ "Eine Spitze aus dem Jaegerzaun",
+ "Ej! Hier unten liegt eine Streichholzschachtel!",
+ "Guck mal! Eine Packung Tempos! Und eins sogar ungebraucht!",
+ "Sonst ist nichts mehr im Eimer",
+ "Ein Blinder der nichts sieht",
+ "",
+ "",
+ "",
+ "",
+ "Ein Wahnsinnsbatzen Geld.",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "SIEHT NICHT UNGEWoeHNLICH AUS",
+ "SIEHT NICHT AUSSERGEWoeHNLICH AUS",
+ "EJ DU, WAS IST LOS?",
+ "HALLO",
+ "NICHTS NEUES?",
+ "WIE GEHTS DER FAMILIE?",
+ "WAS DU FueR SACHEN HAST !",
+ "ABER WIE SOLLTE ICH DAS AUFHEBEN ?",
+ "MEINE RELIGION VERBIETET MIR DAS",
+ "BESSER NICHT",
+ "KLAR MANN!",
+ "DU SPINNST WOHL !",
+ "UNMoeGLICH",
+ "GEHT NICHT AUF !",
+ "ALLEINE SCHAFFE ICH DAS NICHT",
+ "WENN ICH WOLLTE, KoeNNTE ICH, ABER ICH HABE KEINE LUST",
+ "ICH WueSSTE NICHT WARUM",
+ "EIN SCHaeDEL, DER GUT DRAUF IST",
+ "UND? SCHON WAS VOR HEUTE ABEND, SCHaeDEL?",
+ "NEIN, ER MUSS AN EINEM KueHLEN ORT GELAGERT WERDEN, FERN DER ZERSToeRERISCHEN KRAFT DER ATMOSPHaeRE",
+ "KNOCHENTROCKEN, WIE MEIN CHEF!",
+ "EIN SEHR SPITZER PFLOCK",
+ "GUTER SPITZER PFLOHOCK, HOLZ SO EDEL, TRANSILVAAANISCH!!!",
+ "OH VERDAMMT, ICH MUSS MIR DIE NaeGEL SCHNEIDEN !",
+ "DA DRINNEN LIEGT B.J., UND GUCK MAL WIE DIE TANTE AUSSIEHT !",
+ "NIET UND NAGELFEST",
+ " \"NIET & NAGEL GmbH & Co. KG\"",
+ "DAS TYPISCHE SKELETT IM TYPISCHEN VERLIESS EINES TYPISCHEN SPIELS",
+ "WIRD NORMALERWEISE ZUR STROMVERSORGUNG ALLER EINGESToePSELTEN GERaeTE VERWENDET",
+ "TOTALES KUNSTHANDWERK, WEIL SIE DANK DEN JAPANERN KLEINE MINIATUREN SIND",
+ "ES GIBT NUR EINS, WAS GENAUSO HaeSSLICH IST",
+ "HAU AB. ICH SAG IHM GAR NICHTS. MAL GUCKEN OB ER AUSFLIPPT",
+ "SCHEINT ZIEMLICH VERNueNFTIG ZU SEIN",
+ "EIN FOTO VON PLATON WIE ER SEINEN VERLORENEN DIALOG SCHREIBT",
+ "SEH ICH SO AUS ALS OB ICH MIT POSTERN REDE ? !",
+ "EIN HueBSCHER SCHREIBTISCH",
+ "EIN VON DER UNIVERSITaeT ZU OXFORD AUSGESTELLTES VAMPIR-JaeGER-JaeGER-DIPLOM",
+ "VOLLMOND IN FINSTERSTER NACHT",
+ "DIESE SCHRAUBEN SCHEINEN ZIEMLICH FEST ZU SITZEN",
+ "GUCK JETZT NICHT HIN, ABER ICH GLAUBE HIER GIBT ES EINE VERSTECKTE KAMERA",
+ "EIN ULTRAMODERNER PFLOCK-DETEKTOR",
+ "NEIN, DAS LABOR IST IM ZWEITEN STOCK",
+ "EIN HueBSCHES NACHTTISCHCHEN ",
+ "EIN BATZEN GELD DER BEI EINEM WIRKLICH GUTEN ABENTEUER NICHT FEHLEN DARF",
+ "WENN ICH REICH WaeRE, SCHUBIDUBISCHUBIDUBUDU ",
+ "KOMISCHE BLaeTTER, DIE WERDEN SIE WOHL AUS SueDAMERIKA ODER SO MITGEBRACHT HABEN .",
+ "ICH GLAUBE NICHT, DASS SIE ANTWORTEN WERDEN",
+ "EIN SCHoeNES HOLZKRUZIFIX. DEM HELDEN SIND DIE AUSMASSE SEI-NER SCHoeNHEIT NICHT GANZ KLAR.",
+ "ICH BETE NUR VOR DEM ZU-BETT-GEHEN",
+ "EJ, ICH GLAUBE, DIE SPITZE HIER IST EIN BISSCHEN LOSE !",
+ "UND NACHHER BESCHWERST DU DICH, ICH HaeTTE DIR KEINEN WINK GEGEBEN !",
+ "EINE STINKNORMALE ZAUNSPITZE",
+ "NIEDLICH, OBWOHL SIE EIN BISSCHEN VERDRECKT SIND",
+ "SIE WERDEN MICH NICHT HoeREN, HI,HI,HI, SUPERGUT !",
+ "DIE SCHoeNE SCHLAFENDE AUS DEM WALDE VON TSCHAIKOWSKY ODER TSCHESLOFSKY ODER WIE DER HEISST.",
+ "SEHR APPETITLICH",
+ "NEIN, SEHE ICH SO AUS, ALS WueRDE ICH BENUTZTE KAUGUMMIS KAUEN ?",
+ "EINE NIEDLICHE SICHEL. ICH WueSSTE NUR GERNE WO DER HAMMER IST.",
+ "DER GESUNDHEITSMINISTER WARNT : RAUCHEN GEFaeHRDET IHRE GESUNDHEIT",
+ "EINE GANZ NORMALE KERZE, MIT WACHS UND ALLEM DRUM UND DRAN",
+ "MAN MUSS ECHT MAL GESEHEN HABEN WIE DIESE 2 GLaeNZENDEN MueNZEN GLaeNZEN",
+ "MAN MUSS ECHT GESEHEN HABEN WIE DIESE GLaeNZENDE MueNZE GLaeNZT !",
+ "DAMIT WERDE ICH GEGEN VAMPIRBISSE IMMUN SEIN.",
+ "NEIN,ES IST NOCH NICHT SO WEIT",
+ "EIN TAUSENDER UND EIN BISSCHEN KLEINGELD",
+ "DA STEHT\"DEN KLAVIERSPIELER BITTE NICHT MIT LEBENSMITTELN BEWERFEN",
+ "CURRYWURST 3.80. POMMES FRITES 2.30., FRIKADELLEN 1.50",
+ "DIE BESTEN HAMBURGER DIESSEITS DER DONAU FueR NUR 3.80 DM",
+ "EIN SCHoeNER TOTENKOPF MIT EINEM ZIEMLICH DURCHDRINGENDEN BLICK, HI, HI, SUPERGUT !",
+ "HALLO TOTENKOPF, DU ERINNERST MICH AN HAMLETS ONKEL !",
+ "ICH HABE DIE ANGEWOHNHEIT, NICHTS ANZUFASSEN, WAS MAL LEBENDIG GEWESEN IST",
+ "EIN PAPIERKORB",
+ "SIE WETTEN, WIE DAS SPIEL HEUTE ABEND AUSGEHT",
+ "WAS SICH WOHL DAHINTER VERBERGEN MAG",
+ "EJ, DIESER VORHANG BEWEGT SICH NICHT !",
+ "GANZ SCHoeN GRUSELIG, DAS SCHLOSS DA, WAS ?",
+ "ICH SCHAFFS NICHT, ER IST ZU WEIT WEG, UM MICH ZU HoeREN",
+ "EIN TYPISCH TRANSSYLVANISCHER WALD, MIT BaeUMEN UND SO",
+ "RED KEINEN BLoeDSINN, ES IST DOCH STOCKDUNKEL!",
+ "KONDITOREI MueLLER. GEBaeCK UND KAUGUMMIS",
+ "EINE SEHR SCHoeNE TueR",
+ "GESCHLOSSEN",
+ "EINE TOTAL GESCHLOSSENE TONNE",
+ "",
+ "WAS FueR SueSSE VIECHER !",
+ "PSSS,PSSS,PSSS,MIETZCHEN...",
+ "KEINE REAKTION",
+ "DER MOND IST EIN SATELLIT DER DIE ERDE IN EINER UMLAUFGESCHWINDIGKEIT VON 28 TAGEN UMKREIST.",
+ "HALLO MOND DU KREISRUNDES MONDGESICHT",
+ "TOTAL MIT BRETTERN ZUGENAGELT",
+ "NICHTS ZU MACHEN. HIER KOMMT NOCH NICHT MAL ARNOLD S. MIT DER KREISSaeGE DURCH",
+ "SCHEINT SO, ALS HaeTTE DIE TANNE DA EINEN ueBERDIMENSIONALEN SCHATTEN !",
+ "HEHOO, WIRT !",
+ "SIND NOCH ZIMMER FREI ?",
+ "KoeNNEN SIE MIR SAGEN WO ICH EINEN GEWISSEN GRAF DRASCULA FINDE ?",
+ "JA, WAS GIBTS ?",
+ "UND WIESO ?",
+ "WW...WIRKLICH ?",
+ "GUTE FRAGE, ICH WERDE IHNEN MAL MEINE STORY ERZaeHLEN, ALSO...",
+ "NUR FueNF MINUTEN !",
+ "ICH HEISSE HEINZ HACKER UND BIN VERTRETER EINER NORDDEUTSCHEN IMMOBILIENFIRMA",
+ "SO WIES AUSSIEHT WILL GRAF DRASCULA EINIGE HEKTAR LAND AUF HELGOLAND KAUFEN UND ICH BIN HIER UM ueBER DIE PREISE ZU VERHANDELN",
+ "MMMMH, ICH GLAUBE DASS ICH MORGEN FRueH MIT MEINER MAMI ZURueCKKOMME",
+ "WAS FueR EINE NACHT, NICHT WAHR ?",
+ "NICHTS, SCHON GUT",
+ "HEEHOOO, KLAVIERSPIELER",
+ "WAS FueR EINE NACHT",
+ "UND ES IST AUCH GAR NICHT SO KALT",
+ "NUN GUT, ICH LASS DICH JETZT MAL IN RUHE WEITERSPIELEN",
+ "GENAU",
+ "HALLO CHEF, ALLES KLAR ?",
+ "UND DIE FAMILIE ?",
+ "HIER IST MaeCHTIG WAS LOS, WAS ?",
+ "ICH HALTE BESSER MEINEN MUND",
+ "ZU HAUSE IST ES IMMER NOCH AM SCHoeNSTEN...ZU HAUSE IST ES IMMER....Hae ? ABER SIE SIND DOCH NICHT TANTA ENMA. WO ICH DOCH GAR KEINE TANTE EMMA HABE !",
+ "JA, MEINER AUCH. SIE KoeNNEN MICH NENNEN WIE SIE WOLLEN, ICH HoeRE SELBST AUF HEINZCHEN WIE AUF KOMMANDO.",
+ "JA, ICH HAB GANZ SCHoeNE BEULEN, WAS ? ueBRIGENS, WO BIN ICH ?",
+ "JA",
+ "VERDAMMT.....",
+ "JA, KLAR, SELBSTVERSTaeNDLICH !",
+ "DANN ALSO VIELEN DANk FueR DEINE HILFE. ICH WERDE DICH NICHT WEITER BELaeSTIGEN. WENN DU MIR BITTE NOCH SAGEN WueRDEST, WO DIE TueR IST.... ",
+ "WEIL DIE BEULE WOHL MEIN GEHIRN ANGEGRIFFEN HAT UND ICH EINFACH ueBERHAUPT NICHTS SEHE",
+ "PAH, MACHT NICHTS. ICH HABE IMMER ERSATZ DABEI",
+ "WOW, WAS FueR EIN SCHARFES WEIB ! OHNE BRILLE HABE ICH DAS GAR NICHT BEMERKT !",
+ "EJ, DU....",
+ "UND WAS IST DAAAAAS ? !",
+ "MACH DIR KEINE SORGEN, BJ, MEINE GELIEBTE !ICH WERDE DICH AUS SEINEN KLAUEN BEFREIEN",
+ "ACH KOMM, ER HAT MICH AUF DIE PALME GEBRACHT",
+ "UUAAA, EIN WERWOLF ! KREPIER, DU MONSTER !",
+ "JA, DAS.... ",
+ "JA, DAS.... ICH GLAUB, ICH GEH DANN MAL WEITER, MIT VERLAUB...",
+ "WAS?",
+ "WENN ICHS MIR RECHT ueBERLEGE, UM EHRLICH ZU SEIN, ICH GLAUBE NEIN ",
+ "SAG MIR OH GEBILDETER PHILOSOPH, GIBT ES IRGENDEINEN KAUSALZUSAMMENHANG ZWISCHEN DER LICHTGESCHWINDIGKEIT und SCHINKENSPECK",
+ "OKAY,OKAY,VERGISS ES. ICH WEISS JEDENFALLS NICHT, WARUM ICH DAS GESAGT HABE",
+ "WAS PHILOSOPHIERST DU HIER HERUM, WO DU DOCH MENSCHEN FRESSEN MueSSTEST!",
+ "HaeH",
+ "EJ, KANNST DU DAS MIT DEN PRaeHISTORISCHEN NEIGUNGEN NOCHMAL ERKLaeREN ?",
+ "JA, MANN. DER KRAM MIT DEM DU MIR EBEN GEKOMMEN BIST. ICH HAB DAS NaeMLICH NICHT GANZ KAPIERT....",
+ "ICH HALTE BESSER MEINEN MUND, WEIL SOBALD ER BLUT RIECHT...",
+ "JA, BITTE ?",
+ "JA, WAS GIBTS ?",
+ "ACH, WO SIES GERADE ERWaeHNEN,....",
+ "",
+ "ueBRIGENS, WAS WueRDE EIGENTLICH PASSIEREN, WENN DAS REZEPT ZUFaeLLIG IN DIE HaeNDE EINES VAMPIRS GERATEN WueRDE...",
+ "NA WAS SOLLS. HoeR MAL, KOMMT DIR DAS NICHT AUCH WIE EIN DaeMLICHER KLEINER TRICK VOR, UM DAS SPIEL SCHNELL ZU BEENDEN ? NAJA, VIELLEICHT AUCH NICHT",
+ "LEER !",
+ "WEIL DU MIR B.J., MEINE GELIEBTE, GERAUBT HAST. OHNE SIE HAT MEIN LEBEN KEINEN SINN.",
+ "SEIN GEHIRN ?",
+ "OCH, NUR SO! ICH GLAUBE DASS ICH GENUG VON DEM KLEINEN MONSTERCHEN HABE",
+ "SueSSE KLEINE JUNGFRAU, ICH BLEIB SO WIE ICH BIN !",
+ "DAMIT KOMMST DU NICHT DURCH.. GLEICH KOMMT POPEYE UND HOLT MICH HIER RAUS !",
+ "WAS FueR EIN SCHEISS-SPIEL, BEI DEM DEM DER HELD STERBEN MUSS",
+ "HALT ! WAS IST MIT MEINEM LETZTEN WUNSCH ?",
+ "HAR,HAR ! JETZT BIN ICH IMMUN GEGEN DEIN VERFLUCHTES UNGEHEUER. DAS HIER IST EINE ANTI-VAMPIR-ZIGARETTE,DIE MIR VON BRAUN GEGEBEN HAT.",
+ "JA, KLAR. ABER ICH WERDE DIR BESTIMMT NICHT DAS REZEPT VERRATEN",
+ "MIT FOLTER KOMM ICH GUT KLAR, ICH DENK MIR SOGAR WELCHE AUS",
+ "NEIN, BITTE NICHT ! ICH SAG ALLES, ABER TUN SIE MIR DAS NICHT AN !",
+ "O.K. ICH HAB DIR ALLES ERZaeHLT. JETZT HOL B.J. UND MICH ENDLICH HIER RAUS UND LASS UNS IN RUHE",
+ "B.J. !WAS MACHST DU HIER ?WO IST DRASCULA ?",
+ "WAS FueR EIN MIESER TYP ! NUR WEIL ER BLAUES BLUT HAT, MueSSEN IHM NOCH LANGE NICHT ALLE JUNGFRAUEN DIESER ERDE ZU FueSSEN LIEGEN",
+ "NIEDER MIT DEM BONZEN-ADEL !",
+ "SOLIDARITaeT MIT ALLEN ARMEN DIESER WELT... !",
+ "UND WIES AUSSIEHT HAT ER DICH NACH ALLEN REGELN DER KUNST ANGEKETTET",
+ "O.K. DU HAST NICHT ZUFaeLLIG EINE HAARSPANGE ?",
+ "NANANA. STELL DICH NICHT SO AN . MIR FaeLLT SCHON WAS EIN.",
+ "HE, WIRT",
+ "WER GEWINNT ?",
+ "WER ?",
+ "SIEHST DU DENN NICHT, DASS HIER DRASCULA IST ?",
+ "NA, DANN LASS IHN UNS ALLE MACHEN, ODER ?",
+ "GIB MIR EINEN GIN-TONIC",
+ "SCHON GUT. ICH HAB VERGESSEN, WAS ICH DIR SAGEN WOLLTE",
+ "GIB\247MIR\247SOFORT\247EINEN\247GIN\247TONIC\247ODER\247ICH\247SPIEL\247KLAVIER",
+ "WIELANGE DAUERT DAS SPIEL NOCH ?",
+ "GUTE NACHT",
+ "UND WIE KOMMST DU VORAN, IGOR ? SCHLEPPEND ? HI,HI,HI, KLASSE !",
+ "WAS SOLL DAS SEIN, WAS DU DA MACHST?",
+ "NEIN",
+ "DANN ZIEH DIE BRILLE AUF",
+ "WAS SOLL DAS MIT DER ueBERNATueRLICHEN ORGIE ?",
+ "O.K. ES REICHT. ICH KANN ES MIR SCHON VORSTELLEN",
+ "KoeNNTEST DU MIR NICHT ZUFaeLLIG SAGEN, WO DRASCULA IST ?",
+ "ACH KOMM, BITTE, BITTE!",
+ "WARUM NICHT ?",
+ "ACH :NACHTS SCHLaeFT ER ?",
+ "NA, HOFFENTLICH KLAPPT DAS MIT DER EINKOMMENSERKLaeRUNG",
+ "ICH MUSS NaeMLICH MIT IHM REDEN",
+ "HEYHOO, GERIPPE !",
+ "VERDAMMT ! EIN SPRECHENDER TOTER !",
+ "ERaeHL MAL WIESO HAST DU HIER ANGEHALTEN ?",
+ "UND WOZU SOLLTE DRASCULA EIN MONSTER SCHAFFEN WOLLEN ?",
+ "WIE HEISST DU, LIEBES GERIPPE ?",
+ "EJ, SOLL ICH DIR NICHT VIELLEICHT WAS ZU ESSEN BRINGEN ?",
+ "DU HAST DOCH BESTIMMT EINEN LEEREN MAGEN, HI,HI,HI !",
+ "ICH HABE GERADE EINFACH KEINEN BOCK, ZU REDEN",
+ "FI........(BIEP) DICH DOCH IN DEIN BEFI.......(BIEP) KNIE, DU ALTER WI......(BIEP) !",
+ "ICH HABE SIE WIRKLICH GELIEBT, NAJA, GUT, SIe WAR WIRKLICH NICHT DIE HELLSTE VON OSRAM, ABER NOBODY IS PERFECT, STIMMTS ?",
+ "HEY SIE HATTE EINE WAHNSINNSFIGUR, UND WAS WILLST DU MEHR",
+ "NICHTS WIRD MEHR WIE VORHER SEIN. ICH WERDE INS KLOSTER GEHEN UND ELENDIGLICH DAHINSIECHEN.",
+ "HIER KANN MICH NICHTS UND NIEMAND MEHR RAUSHOLEN, WEIL...",
+ "VON WEM ? VON WEM ?",
+ "ICH MoeCHTE PIRAT WERDEN !",
+ "ICH MoeCHTE PROGRAMMIERER WERDEN !",
+ "ERZaeHL MIR ETWAS ueBER SIEGFRIED UND DIE NIBELUNGEN",
+ "ICH HAB EUCH NIE GESEHEN UND SPIEL JETZT EINFACH WEITER",
+ "WER HAT SICH DENN DIESEN SCHWACHSINN EINFALLEN LASSEN ?",
+ "EINE HANDTASCHE, WIE SIE MEINE OMI HAT",
+ "OH MANN, WIE GUT ICH AUSSEHE ! ",
+ "ICH KoeNNTE MICH GLATT IN MICH VERLIEBEN !",
+ "UND WIE SOLL ICH MICH ABSCHLIESSEN ?",
+ "ICH WERDE MICH WOHL ERSTMAL AUFSCHLIESSEN MueSSEN, WAS ?",
+ "HIER STEH ICH GUT",
+ "HAB MICH SCHON",
+ "HALLO ICH",
+ "BEI PASSENDER GELEGENHEIT WERDE ICH SIE MIR MAL REINTUN",
+ "ICH SEHE NICHTS BESONDERES",
+ "GUT SO",
+ "UND WIESOOO ?",
+ "ICH KANN NICHT",
+ "HALLO DU DA",
+ "DIE GRUFT VON ONKEL DESIDERIUS",
+ "HAAALLO, ONKEL DESIDEERIUUS !",
+ "NEIN, ICH WILL MICH NICHT SCHON WIEDER SCHNEIDEN",
+ "aeHEM,MMM... !",
+ "MMMM, LECKER,UaeaeHH !",
+ "JA, HUST,HUST !",
+ "HEY, GUCK MAL, HIER KLEBT EIN KAUGUMMI",
+ "DAS SUPERHANDILY DAS ICH ZU WEIHNACHTEN BEKOMMEN HABE",
+ "GANZ SCHoeN HOCH",
+ "TRITT AUF DEN BALKON, JULIA !",
+ "DU BIST DER STERN AN MEINEM FIRMAMENT !",
+ "EJ, TueR, WAS ISS LOSS ?",
+ "HEYHOO, TRANSSYLVANISCHES ZIGARRETTENAUTOMaeTCHEN !",
+ "EIN ZIGARRETTENSPENDERMASCHINCHEN",
+ "ICH HAB DA NOCHNE MueNZE DRIN",
+ "NEIN, ICH RAUCHE UND TRINKE NICHT MEHR",
+ "VON JETZT AN WERDE ICH MICH NUR NOCH DEN FRAUEN WIDMEN",
+ "BETRUG ! ES IST GAR NICHTS RAUSGEKOMMEN !",
+ "ENDLICH !",
+ "EINE TRUHE, WEITER NICHTS",
+ "HALLO TRUHE, DU HEISST WIE MEINE TANTE TRUDE",
+ "ICH HABE DIE TASCHE VON B.J. GEFUNDEN",
+ "MEIN GOTT, ICH SEH MICH NICHT IM SPIEGEL, ICH BIN EIN VAMPIR !",
+ "....ACH, NEE. ES IST NUR EIN GEMaeLDE",
+ "SPIEGLEIN, SPIEGLEIN AN DER WAND, WER IST DER SCHoeNSTE Im GANZEN LAND ?",
+ "ER MACHT MIR NICHT AUF",
+ "GUT. ICH HABE DIE OHRENSToePSEL DRIN",
+ "EIN VON DER UNIVERSITaeT ZU CAMBRIDGE AUSGESTELLTES VAMPIR-JaeGER DIPLOM.",
+ "NEIN, MIR FEHLEN NOCH EINIGE ZUTATEN, ES LOHNT SICH NICHT, IHN ZU WECKEN !",
+ "ICH HABE NaeMLICH KEIN GELD",
+ "EINE NORDDEUTSCHE LAMPE",
+ "WIRT! HELFEN SIE MIR !",
+ "DA STAND PLoeTZLICH EIN VAMPIR UND HAT MEINE FREUNDIN MITGENOMMEN.",
+ "ABER WOLLEN SIE MIR DENN NICHT HELFEN ?",
+ "TOT? WAS WOLLEN SIE DAMIT SAGEN ?",
+ "aeHEM !",
+ "EIN VAMPIR HAT DAS MaeDEL VON 506 ENTFueHRT !",
+ "DU MUSST MIR HELFEN !",
+ "KANNST DU KEIN BEERDIGUNGSLIED SPIELEN ?",
+ "WIE HaeLST DU DAS BLOSS AUS : JEDEN TAG DIE GLEICHEN LIEDER",
+ "AHA, UND WIE HoeRST DU MICH DANN ?",
+ "GIB MIR DIE OHRENSToePSEL",
+ "ACH KOMM, ICH GEB SIE DIR AUCH SOFORT WIEDER",
+ "ACH KOOOOMMM !",
+ "AUF WIEDERSEHEN. ICH MUSS EINEN VAMPIR ToeTEN",
+ "",
+ "REDEST DU AUF TRANSSYLVANISCH ODER WAS ?",
+ "WER IST ONKEL DESIDERIUS ?",
+ "WAS SOLL LOS SEIN MIT DIESEM GRAF DRASCULA ?",
+ "WER IST DIESER VON BRAUN ?",
+ "UND WARUM MACHT ER ES NICHT ?",
+ " UND WO KANN ICH VON BRAUN FINDEN ?",
+ "ALSO DANKE UND AUF WIEDERSEHEN, SCHLAF SCHoeN",
+ "WIR SOLLTeN BESSER VORHER KLINGELN",
+ "SIND SIE PROFESSOR VON BRAUN ?",
+ "UND SIE KoeNNTEN MIR NICHT VERRATEN, WO..... ?",
+ "ICH NEHM IHM NICHT AB, DASS ER HELGE SCHNEIDER IST",
+ "PROFESSOR!",
+ "HELFEN SIE MIR !ES GEHT UM DAS LEBEN MEINER GELIEBTEN !",
+ "SCHON GUT, ICH BRAUCHE IHRE HILFE NICHT",
+ "OK. ICH GEHE !",
+ "KEINE ANGST. GEMEINSAM BESIEGEN WIR DRASCULA",
+ "UND WARUM HELFEN SIE MIR DANN NICHT ?",
+ "ICH HABE SIE",
+ "ABER ICH HABE SIE DOCH !",
+ "EINVERSTANDEN",
+ "...aeHM,...JA",
+ "ICH GEHE DIREKT NOCHMAL INS AQUARIUM",
+ "ICH BIN SO WEIT, MICH IHREM TEST ZU STELLEN",
+ "SCHON GUT, ALTERCHEN. ZAHLTAG !",
+ "SCHON GUT. ICH WOLLTE SOWIESO GERADE GEHEN",
+ "TSCHULDIGE",
+ "WIE FINDEST DU DIESES BUCH? KLAVIERSTueCKE VON TSCHAIKOWSKY",
+ "WIE BRINGT MAN EINEN VAMPIR UM ?",
+ "HAT MAN DIR NICHT GESAGT WIE MAN SICH BETTET SO LIEGT MAN ?",
+ "GENAU DAS SAGT MEINE MUTTER IMMER ZU MIR",
+ "WARUM KONNTE DICH DRASCULA NICHT ERLEDIGEN ?",
+ "UND WAS DANN ?",
+ "SUPER ! DA HABEN SIE EIN IMMUNITaeTSMISCH.... !",
+ "ALSO ?",
+ "SEHR GUT",
+ "KoeNNEN SIE NOCHMAL WIEDERHOLEN WAS ICH FueR DIESE MISCHUNG BRAUCHE ?",
+ "DANN SATTEL ICH MAL DIE HueHNER UND BESORG ES",
+ "ENTSCHULDIGUNG, WO IST DER KLAVIERSPIELER ?",
+ "ICH\247HAB\247SCHON\247ALLE\247ZUTATEN\247FueR\247DIE\247MISCHUNG",
+ "EINE FRAGE : WAS SOLL DAS HEISSEN : REIPERK ALUCSARD?",
+ "SAGEN SIE SCHON...",
+ "UND WO SOLL DIESE GROTTE SEIN ?",
+ "WAS IST ? GABS BEI EUCH KEINE HEXENPROZESSE ?",
+ "...ABER WENN ICH NOCH MEHR VAMPIREN BEGEGNE ?",
+ "EIN VAMPIR, DER MICH NICHT DURCHLaeSST",
+ "ER SIEHT WIE AUS WIE JODA, NUR VIEL GRoeSSER",
+ "EJ, JODA. WENN DU MICH DURCHLaeSST, GEB ICH DIR ne mark",
+ "NA GUT, DIR KANN MAL WOHL NICHTS ERZaeHLEN",
+ "HALLO, VAMPIR, WAS FueR EINE NACHT, WAS ?",
+ "HAT MAN DIR SCHON MAL GESAGT, DASS DU AUSSIEHST WIE JODA ?",
+ "BIST DU EIN VAMPIR ODER EIN oeLGEMaeLDE ?",
+ "ICH HALT BESSER MEINEN MUND, SONST REGST DU DICH NOCH AUF",
+ "ABGESCHLOSSEN",
+ "DIE ELSTER KoeNNTE MIR EIN AUGE RAUSREISSEN, WENN ICHS VERSUCHE !",
+ "ZU !MEIN GOTT, WIE UNHEIMLICH !",
+ "DIE SCHARNIERE SIND ZUGEROSTET",
+ "HIER IST NUR EIN PaeCKCHEN MEHL",
+ "DAS HAT DEN ROST ENTFERNT",
+ "ICH HABE EINEN PFLOCK AUS FICHTENHOLZ GEFUNDEN",
+ "ICH NEHM DAS HIER, DAS IST SCHoeN DICK !",
+ "NA, ICH GLAUBE ICH KANN MICH JETZT MAL AUS DIESER DaeMLICHEN VERKLEIDUNG SCHaeLEN",
+ "EINGaeNGE ZU DEN SEITENFLueGELN WEGEN BAUARBEITEN GESPERRT. BENUTZEN SIE BITTE DEN HAUPTEINGANG",
+ "...ER IST BLASS, HAT KOMISCHE ZaeHNE, TRaeGT EIN TOUPET UND EINEN UMHANG...DAS MUSS DRASCULA SEIN !",
+ " ES IST B.J. ! B.J. ALLES O.K ?",
+ "ICH WEISS SCHON DASS SIE DUMM IST, ABER ICH BIN SO EINSAM",
+ "DU HAST BESTIMMT KEINEN SCHLueSSEL, STIMMTS ?",
+ "ICH WETTE, DU HAST KEINEN DIETRICH",
+ "GIB MIR DIE HAARSPANGE. ICH MACHS WIE MCGYVER",
+ "BEWEG DICH NICHT, ICH BIN SOFORT ZURueCK",
+ "VERDAMMT! ER IST MIR ABGEBROCHEN !",
+ "HEYJEYJEY !UND ICH HAB MICH AUCH RASIERT, ALTER !",
+ "JA, SCHATZ ?",
+ "ES REICHT NICHT",
+ "DER KLAVIERSPIELER IST NICHT DA",
+ "EIN TRANSSYLVANISCHER GIN-TONIC",
+ "ICH HABE IMMER NOCH KEIN ZIMMER",
+ "ES SCHEINT DASS ER IN DER BADEWANNE HaeNGENGEBLIEBEN IST UND DANN EINE KNEIPE AUFGEMACHT HAT",
+ "ER IST VOLL WIE EIN RUSSE",
+ "DIESES HAAR.... TJA,ES ERINNERT MICH AN JEMANDEN",
+ "ES IST EIN KNoeCHRIGES GERIPPE",
+ "GUCK MAL ! BRAD PITT!",
+ "ER SCHLaeFT. ES WaeRE WIRKLICH SCHADE, IHN ZU WECKEN",
+ "ER IST HaeSSLICHER ALS DIDI HALLERVORDEN",
+ "EIN SARG AUS FICHTENHOLZ",
+ "ER WIRD MICH IN LECKERE KLEINE SCHEIBCHEN SCHNEIDEN",
+ "ICH STEH NICHT SO AUF PENDEL. ICH FIND OHRFEIGEN BESSER",
+ "ICH KANN NICHT. ICH HAB HANDSCHELLEN AN",
+ "DAS SIEHT DOCH JEDER, DASS DAS EINE GEHEIMTueR IST",
+ "SIE IGNORIEREN MICH",
+ "ACH KOMM !",
+ "LAUT DREHBUCH BEWEGE ich mich, ABER das Spiel war so teuer, dass nichts mehr FueR EIN FITNESS-STUDIO ueBRIG war, also habe ich auch keinen strammen arsch.",
+ "SCHEINT SO, ALS OB ER EIN BISSCHEN LOSE AN DER WAND HaeNGT",
+ "ICH GLAUBE KAUM, DASS SIE MIR NueTZEN WIRD. SIE IST VIEL ZU FEUCHT, UM SIE ANZUZueNDEN",
+ "ZUM WESTFLueGEL ?ICH BIN DOCH NICHT BLoeD !WER WEISS WAS MICH DA ERWARTET !",
+ "MIT HueBSCHEN TRANSSYLVANISCHEN MOTIVEN",
+ "",
+ "WIE SCHADE, DASS DAS DA KEIN LECKERER LAMMBRATEN DRIN IST.",
+ "ALS ICH BEIM LETZTEN MAL IN EINEN OFEN GEGUCKT HABE, IST DAS HAUS IN DIE LUFT GEFLOGEN",
+ "DAS IST DAS WAPPEN DER TRANSSYLVANISCHEN FUSSBALLMANNSCHAFT",
+ "UND WOZU? SOLL ICH MIR DAS ANS KNIE BINDEN ?",
+ "DIESE SORTE SCHUBLADE LaeSST SICH NICHT oeFFNEN",
+ "ICH MoeCHTE ECHT NICHT WISSEN, WAS ES DA DRIN ZU ESSEN GIBT!",
+ "DAS WIRKT ZIEMLICH IMPRESSIONISTISCH AUF MICH",
+ "DIE NACHT VERSCHLUCKT ALLES... WIE UNHEIMLICH, WAS?",
+ "SIE KLEMMT",
+ "DER KoeNIG HAST DU DIR DAS NICHT DENKEN KoeNNEN?",
+ "NEIN, ICH HAB SCHON EINEN ZU HAUSE, DEN ICH FueTTERE UND SO",
+ "EIN REGAL MIT BueCHERN UND ANDEREN SACHEN",
+ "UND WEN SOLL ICH UM DIESE UHRZEIT NOCH ANRUFEN?",
+ "\"EINKOMMENSERKLaeRUNG LEICHT GEMACHT\" WIE INTERESSANT!",
+ "ICH HAB SCHON EINS ZU HAUSE.ICH GLAUBE DAS IST WELTWEIT EIN BESTSELLER",
+ "EIN TOTAL NORMALER SCHLueSSEL",
+ "ICH GLAUBE, DER GEHoeRT HIER NICHT HIN",
+ "HEY, DIE FRITTEN SEHEN AUS WIE ECKZaeHNE! ICH BIN HIN UND WEG",
+ "das ist wohl echt nicht DER moment, RUMZUNASCHEN, WENN MEINE FREUNDIN IN DEN KLAUEN DER fiesesten ausgeburt der Welt ist.",
+ "WAS FueR EINE RIESENGAUDI DAS MACHT, DAMIT VAMPIRE FERTIGZUMACHEN!",
+ "MAL GUCKEN, OB NOCH EINER AUFTAUCHT",
+ "NEIN, ES MUSS MIT NOCH SO EINEM DRECKIGEN, STINKENDEN UND NERVIGEN VAMPIR WIE VORHIN SEIN",
+ "DAS IST DIE ORIGINALPERueCKE VON ELIVS ALS ER SCHON EINE GLATZE HATTE",
+ "MEHL, ABER ICH KANN JETZT KEINE MARKEN NENNEN",
+ "VIELLEICHT EIN ANDERES MAL, OK?",
+ "EINE WUNDERSCHoeNE AXT. ZU SCHADE, DASS GERADE KEIN VAMPIRKOPF IN DER NaeHE IST",
+ "NEIN, IM GRUNDE BIN ICH EIN NETTER MENSCH",
+ "DAS IST DAS DEO VON MAGGIE THATCHER, HIHIHI!",
+ "EIN ZIEMLICH HueBSCHER UMHANG",
+ "",
+ "WIE JEDER BELIEBIGE AST EINES BELIEBIGEN BAUMES AN JEDEM BELIEBIGEN ORT IN DER WELT, NICHTS BESONDERES ALSO",
+ "\"UNGLAUBLICH\" EIN SEIL IN EINEM VIDEOSPIEL!",
+ "WOZU DAS WOHL NOCH GUT SEIN WIRD...",
+ "EIN SEIL AN EINEM AST ODER EIN AST AN EINEM SEIL, JE NACHDEM WIE MAN DAS SO BETRACHTET",
+ "ES SCHEINT, DAS DIESE ELSTER WAS ueBLES IM SCHILDE FueHRT",
+ "ZISCH AB, ICH SAG IHR NICHTS, MAL SEHEN OB SIE AUSFLIPPT",
+ "SIEHT SO AUS ALS WaeRE SIE TOT, ABER STIMMT NICHT,NE?",
+ "FueR DIESES SPIEL WURDEN KEINE TIERE MISSHANDELT ODER GEToeTET",
+},
+{
+ "",
+ "C'EST LA DEUXI\212ME PORTE PLUS GRANDE QUE J'AI VUE DANS MA VIE.",
+ "ENFIN, PAS AUTANT QUE \207A.",
+ "ELLE EST BOUCH\202E AVEC DES GROSSES PLANCHES. L'\202GLISE EST PEUT-\210TRE ABANDONN\202E DEPUIS QUELQUES ANN\202ES.",
+ "MAIS JE NE L'AI PAS OUVERTE.",
+ "QU'EST-CE QUE JE FAIS? JE L'ARRACHE?",
+ "BONJOUR, PORTE. JE VAIS T'ENCADRER.",
+ "C'EST TROP POUR MOI.",
+ "UNE FEN\210TRE BOUCH\202E AUX GROSSES PLANCHES.",
+ "JE N'ARRIVE PAS.",
+ "\200A Y EST.",
+ "ET POURQUOI?",
+ "SALUT, FEN\210TRE! AS-TU QUELQUE CHOSE \205 FAIRE CE SOIR?",
+ "PAS SANS LE PERMIS DE TRAVAUX PUBLIQUES.",
+ "H\202! CETTE FEN\210TRE A SEULEMENT UNE GROSSE PLANCHE...",
+ "OH\202! OH\202!-FEN\210TRE!",
+ "BONJOUR, TOI.",
+ "",
+ "JE N'ARRIVE PAS.",
+ "C'EST BIEN O\227 ELLE EST.",
+ "",
+ "C'EST UNE TOMBE EN FORME DE CROIX.",
+ "NON, MERCI.",
+ "BONJOUR, LE D\202FUNT: VEUX-TU DES VERMISSEAUX?",
+ "MAIS OUI. COMME EN POLTERGUEIST.",
+ "",
+ "",
+ "JE REVIENS EN QUINZE MINUTES.",
+ "D\202FENSE D'AFFICHER.",
+ "",
+ "C'EST FERM\202 \205 CL\202.",
+ "J'EN AI D\202J\205 UN.",
+ "",
+ "IL NE R\202POND PAS.",
+ "MAIS NON, C'EST BIEN GAR\202.",
+ "C'EST UNE PORTE.",
+ "UN TIROIR DE LA TABLE.",
+ "UNE ARMOIRE SUSPECTE.",
+ "BONJOUR, L'ARMOIRE. \200A VA?",
+ "",
+ "",
+ "C'EST UN CAND\202LABRE TR\212S VIEUX.",
+ "IL DOIT \210TRE L\205 D\212S QUE MAZINGUER-Z \202TAIT UNE VIS.",
+ "NON, C'EST UNE RELIQUE.",
+ "C'EST UN JOLI R\202TABLE.",
+ "",
+ "HI! HI! HI!",
+ "",
+ "NON.",
+ "",
+ "HA! HA! HA! -QUE C'EST BON!",
+ "",
+ "",
+ "",
+ "JE NE VOIS RIEN DE SP\202CIAL.",
+ "C'EST FERNAN, LA PLANTE.",
+ "C'EST UNE DES PIQUES DE LA GRILLE.",
+ "H\202! L\205-DESSOUS IL Y A UNE BO\214TE D'ALLUMETTES.",
+ "REGARDE! UN PAQUET DE CLINEX. -ET IL Y A UN TOUT NEUF!",
+ "IL N'Y A RIEN DE PLUS DANS LE SEAU.",
+ "C'EST UN AVEUGLE QUI VE VOIT PAS.",
+ "",
+ "",
+ "",
+ "",
+ "C'EST UNE GROSSE SOMME D'ARGENT.",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "ELLE N'A RIEN DE SP\220CIAL",
+ "CELA N'A RIEN D'EXTRAORDINAIRE",
+ "QU'EST-CE QU'IL Y A?",
+ "BONJOUR!",
+ "RIEN DE NOUVEAU?",
+ "LA FAMILLE, \200A VA?",
+ "-QUELLES CHOSES TU AS!",
+ "MAIS, COMME JE VAIS PRENDRE CELA!",
+ "MA RELIGION ME L'INTERDIT",
+ "CE N'EST PAS MIEUX",
+ "BIEN S\352R, MON VIEUX!",
+ "ON NE PARLE PLUS DE CELA",
+ "IMPOSSIBLE",
+ "CELA NE S'OUVRE PAS",
+ "JE NE PEUX PAS TOUT SEUL",
+ "SI JE VOULAIS, J' ARRIVERAIS, MAIS \200A ME DONNE DE LA PARESSE",
+ "JE N'Y VOIT PAS UNE RAISON APPARENTE",
+ "C'EST UN CERVEAU ASSEZ BIEN",
+ "ET BIEN CERVEAU, QUE PENSES-TU FAIRE CE SOIR?",
+ "NON, ON DOIT LE GARDER DANS UN ENDROIT \267 L'ABRI DES MUTATIONS DE L'ATMOSPH\324RE",
+ "C'EST UN DUR, COMME MON CHEF",
+ "C'EST UN PIEU TR\324S AIGUIS\220",
+ "FID\324LE PIEU POINTUUU, NOBLE CH\322NE TRANSYLVAAAN",
+ "TIENS! JE DOIS COUPER MES ONGLES!",
+ "B.J. EST L\267-DEDANS. ET QUELLE EST MIGNONE CETTE NANA!",
+ "ELLE EST FERM\220E TR\324S SOLIDEMENT",
+ "\"CADENAS SOLIDES S.A.\"",
+ "C'EST LE TYPIQUE SQUELETTE QU'ON TROUVE DANS LES GE\342LES DE TOUS LES JEUX",
+ "ON L' EMPLOIE NORMALEMENT POUR INDUIR DU COURANT \220LECTRIQUE AUX APPAREILS QU'Y SONT RACCORD\220S",
+ "C'EST ABSOLUMENT ARTISANAL, CAR LES JAPONAIS LES FONT MAINTENANT DE POCHE",
+ "J'AI SEULEMENT VU DANS MA VIE UNE CHOSE SI MOCHE",
+ "LAISSE. JE NE LUI DIS RIEN POUR S'IL SE F\266CHE",
+ "IL SEMBLE ASSEZ RATIONNEL",
+ "C'EST UNE PHOTO DE PLATON EN TRAIN D'\220CRIRE SON DIALOGUE PERDU",
+ "JE NE SUIS PAS DE CEUX QUI PARLENT AUX POSTERS",
+ "UN BUREAU ASSEZ MIGNON",
+ "C'EST UN DIPL\342ME DE CHASSE-CHASSE-VAMPIRES HOMOLOGU\220 PAR L'UNIVERSIT\220 D'OXFORD",
+ "C'EST UNE NUIT NOIRE AU PLEINE LUNE",
+ "IL PARA\327T QUE CES VIS NE SONT PAS TR\324S ENFONC\220ES",
+ "N'Y REGARDES PAS, MAIS JE CROIS QU'UNE CAM\220RA OCCULTE ME VISE",
+ "UN D\220TECTEUR DE PIEUX ASSEZ MODERNE",
+ "NON, LE LABORATOIRE EST AU DEUXI\324ME \220TAGE",
+ "UNE JOLIE TABLE DE NUIT",
+ "C'EST UN TAS D'ARGENT QUI NE PEUT PAS MANQUER DANS UNE AVENTURE DIGNE DE TEL NOM",
+ "SI J'\220TAIS RICHE. DUBIDOUDUBIDOUDUBIDOUDUBIDOU",
+ "CE SONT DES FEUILLES BIZARRES. ON A D\352 LES AMENER DE L'AM\220RIQUE DU SUD OU PAR L\267",
+ "JE NE PENSE PAS QU'ILS VONT ME R\220PONDRE",
+ "C'EST UN JOLI CRUCIFIX EN BOIS. L'IC\342NE N'ARRIVE PAS \267 SAISIR TOUT LA SPLENDEUR DE SA BEAUT\220",
+ "JE PRIE SEULEMENT AVANT DE ME COUCHER",
+ "H\220!, IL PARA\327T QUE CETTE PIQUE S'EST UN PETIT PEU D\220CROCH\220E",
+ "TU NE POURRAS TE PLAIGNER APR\324S DU PEU DE PISTES QUE JE TE DONNE",
+ "C'EST UNE PIQUE ASSEZ CONVENTIONNELLE",
+ "ILS SONT MIGNONS, MAIS UN PEU SALES",
+ "NON, NON, ILS NE ME \220COUTERAIENT PAS. HI, HI, HI -QUE C'EST BON!",
+ "\"LA BELLE DORMANTE DU BOIS\" DE TCHA\330KOVSKI, OU TCHA\330FROSKI, OU N'IMPORTE COMMENT DIT-ON ",
+ "TR\324S APP\220TISSANT",
+ "JE NE SUIS PAS DE CEUX QUI SUCCENT DES CHEWING-GUMS D\220J\267 M\266CH\220S",
+ "UNE FAUCILLE TR\324S MIGNONE. jE ME DEMANDE O\353 SERA LE MARTEAU?",
+ "\"LES FABRICANTS DE TABAC AVERTISSENT QUE LES AUTORIT\220S SANITAIRES SONT S\220RIEUSEMENT NUISIBLES POUR LA SANT\220 \"",
+ "UNE BOUGIE COURANTE ET NORMALE ET AVEC DE LA CIRE M\322ME",
+ "IL FAUT VOIR COMME ELLES LUISENT CES DEUX RUTILANTES MONNAIES!",
+ "IL FAUT VOIR COMME ELLE LUIT CETTE RUTILANTE MONNAIE!",
+ "AVEC \200A JE SERAI IMMUNIS\220 CONTRE LES MORSURES DES VAMPIRES",
+ "NON, CE N'EST PAS ENCORE LE MOMENT",
+ "IL Y A UN BILLET DE MILLE ET DEUX SOUS",
+ "ON DIT\"VOUS \322TES PRI\220S DE NE PAS DONNER \267 MANGER AU PIANISTE\"",
+ "L'OMELETTE, 200. DES PETITS POISSONS FRITS, 150, DES POMMES A\330OLI, 225",
+ "LES MEILLEURES HAMBURGERS DE CE C\342T\220 DU DANUBE, SEULEMENT 325",
+ "C'EST UNE JOLIE T\322TE DE MORT AU REGARD TR\324S PER\200ANT -HI, HI, HI, QUE C'EST BON!",
+ "BONJOUR T\322TE DE MORT, TU ME RAPPELLES L'ONCLE HAMLET",
+ "J'AI LA HABITUDE DE NE PAS TOUCHER AUX CHOSES QUI ONT V\220CU AUTREFOIS",
+ "C'EST UNE POUBELLE",
+ "C'EST UNE MASSUE POUR LE MATCH DE CE SOIR",
+ "JE ME DEMANDE CE QU'IL AURA DERRI\324RE",
+ "H\220, CE RIDEAU NE BOUGE PAS!",
+ "TIENS, QUEL CH\266TEAU SI SOMBRE, H\220? ",
+ "JE NE PEUX PAS, IL EST TROP LOIN POUR M'ENTENDRE",
+ "C'EST UNE TYPIQUE FOR\322T TRANSYLVANE, AVEC DES ARBRES",
+ "MAIS TU NE DIS QUE DES B\322TISES, C'EST UN LIEU OBSCUR!",
+ "CONFISERIE GARCIA, G\266TEAUX ET CHEWING-GUMS.",
+ "UNE PORTE TR\324S JOLIE",
+ "ELLE EST FERM\220E",
+ "UN TONNEAU COMPL\324TEMENT FERM\220",
+ "",
+ "QUELLES BESTIOLES SI MIGNONES!",
+ "BSSST, BSSST, PETIT CHAT...",
+ "IL NE R\220POND PAS",
+ "LA LUNE EST UN SATELLITE TOURNANT AUTOUR DE LA TERRE AVEC UNE P\220RIODE DE ROTATION DE 28 JOURS",
+ "SALUT, LUNE!, LUN\220E ET \220TOURDIE ",
+ "ELLE EST COMPL\324TEMENT BOUCH\220E AVEC DES GROSSES PLANCHES",
+ "C'EST IMPOSSIBLE, CECI NE L'OUVRE PAS NI LE MAJORDOME DE LA T\220L\220",
+ "H\220, IL PARA\327T QUE L'OMBRE DE CE CYPR\324S-LA EST ALLONG\220E",
+ "OH\220! H\342TELIEEER!",
+ "JE VOUDRAIS UNE CHAMBRE",
+ "SAVEZ-VOUS O\353 EST QUE JE PEUX TROUVER UN TEL COMTE DRASCULA?",
+ "OUI, QU'EST-CE QU'IL Y A? ",
+ "ET \200A?",
+ "EN... EN V\220RIT\220?",
+ "UNE BONNE QUESTION, JE VAIS VOUS RACONTER MON HISTOIRE, TIENS...",
+ "JE N'AI QUE POUR CINQ MINUTES",
+ "JE M'APPELLE JOHN HACKER ET SUIS LE REPR\220SENTANT D'UNE INMOBILI\324RE BRITANNIQUE",
+ "IL PARA\327T QUE LE COMTE DRASCULA VEUT ACHETER DES TERRAINS \267 GIBRALTAR ET ON M'A ENVOY\220 POUR N\220GOCIER L'AFFAIRE",
+ "MAIS JE PENSE QUE DEMAIN DE BONNE HEURE JE RETOURNE AVEC MA MAMAN",
+ "UNE BELLE NUIT, N'EST-CE PAS?",
+ "NON, RIEN",
+ "OH\220! PIANISTE!",
+ "UNE BELLE NUIT",
+ "ET EN PLUS, IL NE FAIT PAS FROID",
+ "EH BIEN, RIEN. CONTINUE \267 JOUER",
+ "C'EST \200A",
+ "BONJOUR CHEF, \200A VA?",
+ "ET LA FAMILLE?",
+ "IL Y A DE L'AMBIANCE ICI, H\220?",
+ "TANT MIEUX SI JE NE DIS RIEN",
+ "ON EST MIEUX CHEZ-SOI QU'AILLEURS... ON EST MIEUX DANS... H\220? MAIS VOUS N'\322TES PAS TANTE EMMA. MIEUX ENCORE. -SI JE N'AI PAS AUCUNE TANTE EMMA!",
+ "OUI, LE MIEN AUSSI. VOUS POUVEZ M'APPELLER COMME VOUS VOULEZ, MAIS SI VOUS M'APPELLEZ JOHNY, JE VIENS COMME LES CHIENS",
+ "OUI, QUELS COUPS QUE J'AI, N'EST-CE PAS? EN FAIT, O\353 SUIS-JE?",
+ "OUI",
+ "A\330E!, A\330E!...",
+ "OH, OUI! BIEN S\352R",
+ "EH BIEN! MERCI BEAUCOUP POUR TON AIDE. JE NE TE D\220RANGE PLUS SI TU ME DIS O\353 SE TROUVE LA PORTE, S'IL TE PLA\327T...",
+ "CAR LE COUP A D\352 ME TOUCHER LA CERVELLE ET JE N'Y VOIS GOUTTE",
+ "BAH!, \200A FAIT RIEN. J'AI TOUJOURS UNE DE R\220CHANGE",
+ "OUAH, QUELLE BELLE FEMME! -JE NE M'AVAIS PAS RENDU COMPTE! BIEN S\352R, SANS LES LUNETTES...",
+ "\220COUTE...",
+ "ET \200AAAAAA?!",
+ "NE T'EN FAIS PAS B. J., MON AMOUR! JE VAIS TE SAUVER DES GRIFFES DE CELUI-L\267 ",
+ "IL ME CASSE LE NEZ, TIENS!",
+ "AHHH, UN HOMME-LOUP! MEURS MAUDIT!",
+ "OUI, C'EST CELA...",
+ "OUI, C'EST CELA... JE CROIS QUE JE VAIS SUIVRE MON CHEMIN. PARDON.. ",
+ "QUOI?",
+ "EH BIEN, EN V\220RIT\220, BIEN PENS\220... JE NE CROIS PAS",
+ "DIS -MOI, OH! \220RUDITE PHILOSOPHE! Y A-T-IL UNE R\220LATION CAUSE-EFFET ENTRE LA VITESSE ET LE LARD?",
+ "\200A VA, \200A VA, ABANDONNE. EN TOUT CAS, JE NE SAIS PAS POURQUOI JE L'AI DIT.",
+ "QU'EST-CE QUE TU FAIS ICI EN TRAIN DE PHILOSOPHER AU LIEU DE MANGER DU MONDE?",
+ "QU'EST-CE QUE C'EST QUE \200A?",
+ "\220COUTE, PEX-TU R\220P\220TER CETTE PHRASE DES \"INCLINATIONS PR\220-\220VOLUTIVES\"?",
+ "BIEN S\352R, MON VIEUX. CETTE HISTOITE QUE TU M'AS LACH\220E AVANT. CE QUE JE N'AI PAS BIEN COMPRIS...",
+ "NON, LE MIEUX SERA DE NE RIEN DIRE. CAR SI JE LE TOUCHE LA VEINE.....",
+ "OUI, QUE SE PASSE-T-IL?",
+ "OUI, QU'EST-CE QU'IL Y A? ",
+ "EH BIEN, MAINTENANT QU'IL ABORDE LE SUJET JE LUI DIRAI QUE...",
+ "",
+ "EN FAIT, QU'ARRIVERAIT-IL SI UN VAMPIRE SE POURVOYAIT DE LA FORMULE PAR HASARD... ",
+ "EH BIEN, RIEN. \220COUTE, CECI NE TE SEMBLE PAS UN RAVAUDAGE QU'ON A MIS EN SC\324NE POUR EN FINIR T\342T AVEC LE JEU? BON, PEUT-\322TRE PAS",
+ "C'EST VIDE!",
+ "POURQUOI TU M'AS VOL\220 MON AMOUR. B.J. SI ELLE N'EST PAS L\267, LA VIE N'AS PAS DE SENS POUR MOI",
+ "SON CERVEAU?!",
+ "CE N'EST POUR RIEN, MAIS JE CROIS QUE TON PETIT MONSTRE M'A F\266CH\220",
+ "MA VIERGE, QUE JE RESTE TEL QUE JE SUIS!",
+ "TU N'AURAS PAS LE DERNIER MOT. C'EST S\352R QUE MAINTENANT APPARA\327T SUPER-LOPEZ ET ME LIB\324RE!",
+ "QUELLE MERDE DE JEU DONT MEURT LE PROTAGONISTE!",
+ "UN INSTANT, QU'Y A-T-IL DE MON DERNIER D\220SIR?",
+ "HA! HA! MAINTENANT JE SUIS IMMUNIS\220 CONTRE TOI, D\220MON MAUDIT. CETTE CIGARETTE EST UNE POTION ANTI-VAMPIRES QUI M'A DONN\220 VON BRAUN ",
+ "OUI, C'EST S\352R, MAIS TU N'OBTIENDRAS JAMAIS DE MOI LA FORMULE",
+ "JE PEUX SUPPORTER LA TORTURE, ET ENCORE LA CR\220ER ",
+ "NON, S'IL VOUS PLA\327T, JE PARLERAI, MAIS NE ME FAITES PAS \200A!",
+ "EH BIEN. JE T'AI D\220J\267 DIT CE QUE TU VOULAIS SAVOIR. MAINTENANT D\220LIVRE-NOUS, B.J. ET MOI, ET FICHEZ-NOUS LA PAIX",
+ "B.J.! QU'EST-CE QUE TU FAIS L\267? DRASCULA, O\353 EST-IL?",
+ "QU'IL EST M\220CHANT! C'EST SEULEMENT PAR-CE QU'IL APPARTIENT \267 LA NOBLESSE QU'IL CROIT POUVOIR EXERCER LE DROIT DE GAMBADE AVEC N'IMPORTE QUI",
+ "\267 BAS L'ARISTOCRATIE ARBITRAIRE!",
+ "DEBOUT LES PAUVRES DU MOOONDE....!",
+ "ET D'APR\324S CE QUE JE VOIS ON T'A ENCHA\327N\220 AVEC CADENAS ET TOUT",
+ "BON, \200A VA. N'AURAS-TU PAS UNE \220PINGLE?",
+ "BON, BON, NE T'EN FAIS PAS COMME \200A. JE PENSERAI \267 QUELQUE CHOSE.",
+ "H\220! TAVERNIER!",
+ "COMMENT VA LE MATCH?",
+ "QUI EST-CE?",
+ "NE VOIS-TU PAS QUE DRASCULA EST ICI?",
+ "ALORS, ON VA FINIR AVEC LUI, NON?",
+ "SERS -MOI UN COUP...",
+ "RIEN. J'AI OUBLI\220 CE QUE J'ALLAIS TE DIRE",
+ "OU\207BIEN\207TU\207ME\207SERS\207UN\207COUP\207OU\207JE\207ME\207METS\207\267\207JOUER\207DU\207PIANO",
+ "COMBIEN IL RESTE POUR QUE LE MATCH FINISSE?",
+ "BON SOIR",
+ "COMME VAS-TU, IGOR? BOSSU? -HI! HI! HI! QUE C'EST BON! ",
+ "QU'EST-CE QU'ON SUPPOSE QUE TU FAIS?",
+ "EH BIEN, NON!",
+ "ALORS, METS-TOI DES LUNETTES",
+ "QU'EST QUE C'EST QU'UNE ORGIE SURNATURELLE?",
+ "\200A VA, \200A VA, ARR\322TE-TOI. JE ME FAIS D\220J\267 UNE ID\220E",
+ "NE POURRAIS-TU PAS ME DIRE O\353 SE TROUVE DRASCULA? ",
+ "ALLONS, S'IL TE PLA\327T",
+ "POURQUOI PAS?",
+ "AH! MAIS IL DORME PENDANT LA NUIT?",
+ "EH BIEN! QUE LA RENTE SE DONNE BIEN",
+ "CE QUE JE DOIS LUI PARLER",
+ "OH\220! SQUELEEETTE! ",
+ "SAPRISTI! -UN SQUELETTE QUI PARLE!",
+ "RACONTE-MOI, COMMENT EST-TU VENU JUSQU'ICI?",
+ "ET POUR QUELLE RAISON VOUDRAIT DRASCULA CR\220ER UN MONSTRE? ",
+ "COMMENT T'APPELLES-TU, AMI SQUELETTE?",
+ "\220COUTE, VEUX-TU QUE JE T'APPORTE QUELQUE CHOSE \267 MANGER?",
+ "TU DOIS AVOIR L'ESTOMAC VIDE. -HI! HI! HI!",
+ "VRAIMENT JE N'AI PAS ENVIE DE PARLER MAINTENANT",
+ "MON DIEU! (SIFFLEMENT) J'ESP\324RE QUE...(SIFFLEMENT) ET QUE...(SIFFLEMENT) DEUX FOIS!",
+ "J'AI L'AIM\220E VRAIMENT. \200A VA, JE SUIS D'ACCORD, IL N'\220TAIT PAS UN G\220NIE, MAIS PERSONNE EST PARFAIT, N'EST-CE PAS? ",
+ "DE PLUS, ELLE AVAIT UNE FIGURE \220POUSTOUFLANTE ",
+ "JE NE SERAI PLUS LE M\322ME. JE VAIS M'ENFERMER DANS UN MONAST\324RE POUR VOIR FUIR MA VIE LENTEMENT",
+ "RIEN NE POURRA M'EN SORTIR D\220J\267 DE CETTE MIS\324RE PARCE QUE...",
+ "DE QUI? DE QUI?",
+ "JE VEUX \322TRE UN PIRATE",
+ "JE VEUX \322TRE PROGRAMMEUR",
+ "RACONTEZ-MOI QUELQUE CHOSE SUR PELAYO",
+ "JE CONTINUERAI \267 JOUER ET J'OUBLIERAI QUE VOUS AI VU ",
+ "QUI AURA PENS\220 \267 CETTE B\322TISE?",
+ "C'EST UN SAC COMME CELUI DE MA GRANDE-M\324RE",
+ "MAIS QUE JE SUIS BEAU!",
+ "PLUS JE ME REGARDE PLUS JE ME PLAIS",
+ "ET APR\324S COMMENT JE ME FERME?",
+ "IL FAUDRA QUE M'OUVRE D'ABORD, NON?",
+ "JE SUIS BIEN O\353 JE SUIS",
+ "JE M'AI D\220J\267",
+ "SALUT, MOI!",
+ "JE VAIS ME LES METTRE \267 TEMPS",
+ "JE NE VOIS RIEN DE SP\220CIAL",
+ "C'EST BIEN O\353 IL EST",
+ "ET POURQUOI FAIRE?",
+ "JE NE PEUX PAS",
+ "SALUT, TOI!",
+ "C'EST LE PANTH\220ON DE L'ONCLE D\220SIR\220",
+ "OH\220! ONCLE D\220SIR\220\220\220\220!",
+ "NON, JE NE VEUX PAS ME COUPER ENCORE UNE FOIS",
+ "HEM! HEM!...!",
+ "YAMM, HEMMM, JH!",
+ "OUI, COF,COF!",
+ "TIENS, IL Y A ICI UN CHEWING-GUM COLL\220",
+ "C'EST LE MOVILANI, LE CADEAU QUI M'ONT DONN\220 POUR NO\323L",
+ "QUE C'EST HAUT!",
+ "SORS DANS LE BALCON JULIETTE!",
+ "TU EST LA LUMI\324RE QUI \220CLAIRE MON CHEMIN!",
+ "H\220, PORTE! QU'EST-CE QU'IL Y A?",
+ "OH\220! MACHINE \267 TABAC DE TRANSYLVANIIIE",
+ "C'EST UNE MACHINE \267 D\220BIT DE TABAC",
+ "J'AI UNE AUTRE MONNAIE L\267 -DEDANS",
+ "NON, J'AI D\220CID\220 ABANDONNER LE TABAC ET L'ALCOOL",
+ "D\324S MAINTENANT JE VAIS ME CONSACRER SEULEMENT AUX FEMMES",
+ "C'EST UN VOL! RIEN EST SORTI!",
+ "ENFIN! ",
+ "C'EST \200A, UN BAHUT",
+ "SALUT, BAHUT! TU T'APPELLES COMME MON COUSIN, QUI S'APPELLE RAUL",
+ "J'AI TROUV\220 LE SAC DE B.J..",
+ "MON DIEU! JE N'Y ME VOIS PAS -SUIS UN VAMPIRE!",
+ "...AH, NON! CE N'EST QU'UN DESSIN!",
+ "PETIT MIROIR: \"C'EST QUI LE PLUS BEAU DU ROYAUME?\"",
+ "IL NE VEUT PAS M'OUVRIR",
+ "TR\324S BIEN. J'AI MIS LES TAMPONS",
+ "C'EST UN DIPL\342ME DE CHASSE-VAMPIRES HOMOLOGU\220 PAR L'UNIVERSIT\220 DE CAMBRIDGE",
+ "NON, IL ME FAUT ENCORE D'INGR\220DIENTS, PAS LA PEINE DE LUI REVEILLER",
+ "C'EST QUE JE SUIS FAUCH\220",
+ "C'EST UNE LAMPE BRITANNIQUE",
+ "TAVERNIER! -AIDEZ-MOI!",
+ "UN VAMPIRE EST APPARU ET IL A ENLEV\220 MA FIANC\220E",
+ "MAIS, N'ALLEZ VOUS PAS M'AIDER?!",
+ "MORTE? QUE VOULEZ-VOUS DIRE?",
+ "HEM!",
+ "UN VAMPIRE A S\220QUESTR\220E LA FILLE DE LA 506!",
+ "IL FAUT QUE TU M'AIDES!",
+ "TU NE SAIS PAS JOUER AUCUNE PI\324CE DES INHUMAINS?",
+ "COMMENT TU TE SUPPORTES TOUT LE JOUR EN JOUANT LA M\322ME CHOSE?",
+ "ET ALORS, POURQUOI TU M'\220COUTES?",
+ "PR\322TE-MOI LES TAMPONS",
+ "ALLONS! JE VAIS TE LES REDONNER TOUT DE SUITE",
+ "ALLOOONSSS..."
+ "AU REVOIR. JE DOIS TUER UN VAMPIRE",
+ "",
+ "EN QUOI TU PARLES! EN TRANSYLVAN?",
+ "C'EST QUI L'ONCLE D\220SIR\220?",
+ "MAIS QU'EST-CE QU'IL Y A AVEC CE DRASCULA-L\267?",
+ "QUI EST-CE CE VON BRAUN-L\267?",
+ "ET POURQUOI IL NE LE FAIT PAS?",
+ "ET O\353 PEUX-JE TROUVER VON BRAUN?",
+ "EH BIEN, MERCI ET AU REVOIR. QUE TU LA DORMES BIEN",
+ "IL VAUDRA MIEUX SONNER D'ABORD",
+ "LE PROFESSEUR VON BRAUN, C'EST VOUS?",
+ "ET NE POUVEZ-VOUS PAS M'INDIQUER O\353 JE PEUX...?",
+ "JE NE CROIS PAS QU'IL SOIT LE NAIN GANYM\324DE",
+ "PROFESSEUR!",
+ "AIDEZ-MOI! -LA VIE DE MA BIEN AIM\220E DEPENDE DE VOUS!",
+ "\200A VA, JE N'AI PAS BESOIN DE VOTRE AIDE",
+ "D'ACCORD. JE M'EN VAIS",
+ "N'AIES PAS PEUR. NOUS ALLONS VAINCRE DRASCULA ENSEMBLE",
+ "ALORS, POURQUOI NE M'AIDEZ VOUS PAS?",
+ "JE LES AI",
+ "OUI, JE LES AI!",
+ "D'ACCORD",
+ "...ER ...OUI",
+ "JE VIENS POUR RENTRER DANS CETTE CABINE",
+ "SUIS PR\322T \267 CONFRONTER VOTRE \220PREUVE",
+ "\200A VA, VIEUX RIDICULE. JE SUIS VENU CHERCHER MON ARGENT",
+ "NON, RIEN. JE M'EN ALLAIS D\220J\267",
+ "PARDONNE-MOI",
+ "CE LIVRE T'INT\220RESSE? AVEZ-VOUS DES PARTITIONS DE TCHA\330KOVSKY?",
+ "COMMENT PEUX-JE TUER UN VAMPIRE?",
+ "ON NE T'A JAMAIS DIT QUE C'EST MAUVAIS DORMIR DANS UNE MAUVAISE POSTURE?",
+ "EH BIEN, C'EST \200A QUE MA M\324RE ME DIT TOUJOURS",
+ "POURQUOI DRASCULA N'A PU JAMAIS TE TUER?",
+ "ET QU'EST-CE QUE S'EST PASS\220?",
+ "C'EST SUPER! -AVEZ-VOUS UNE POTION D'IMMUNIT...!",
+ "ALORS?",
+ "TR\324S BIEN",
+ "POUVEZ-VOUS ME R\220P\220TER CE DONT J'AI BESOIN POUR CETTE POTION?",
+ "EH BIEN! JE PARS RAPIDE LE CHERCHER",
+ "\220COUTEZ, QU'EST-CE QUE C'EST PASSE\220 AVEC LE PIANISTE?",
+ "J'AI\207D\220J\267\207TOUS\207LES\207INGR\220DIENTS\207DE\207CETTE\207POTION",
+ "UNE QUESTION: QU'EST.CE QUE C'EST CELA D' ALUCSARD ETEREUM?",
+ "PARLEZ, PARLEZ... ",
+ "ET C'EST O\353 CETTE GROTTE?",
+ "QU'EST-CE QU'IL Y A? N'AVIEZ VOUS PAS UN TRIBUNAL?",
+ "...MAIS ...ET SI JE TROUVE ENCORE DES VAMPIRES?",
+ "C'EST UN VAMPIRE QUI M'EMP\322CHE L'ENTR\220E",
+ "IL RESSEMBLE \267 YODA, MAIS C'EST UN PEU PLUS GRAND",
+ "H\220, YODA! SI TU ME LAISSES PASSER JE TE DONNE UNE MONNAIE",
+ "BON, \200A VA. ON NE PEUT RIEN TE DIRE",
+ "H\220, VAMPIRE! BELLE NUIT, N'EST-CE PAS?",
+ "ON T'A D\220J\267 DIT QUE TU RESSEMBLES \267 YODA?",
+ "ES-TU UN VAMPIRE OU UNE PEINTURE \267 L'HUILE?",
+ "IL VAUX MIEUX NE RIEN TE DIRE, POUR SI TU TE F\266CHES",
+ "C'EST FERM\220E \267 CL\220",
+ "LA PIE POURRAIT M'ARRACHER UN OEIL SI J'EN ESSAIE!",
+ "C'EST FERM\220E! -MON DIEU, QUELLE PEUR!",
+ "LES GONDS SONT OXYD\220S",
+ "L\267-DEDANS IL Y A SEULEMENT UN POT AVEC DE LA FARINE",
+ "CECI A ENLEV\220 L'OXYDE",
+ "J'AI TROUV\220 UN PIEU DE PIN",
+ "JE PRENDRAI CELUI-CI QUI EST PLUS GROS",
+ "BON, JE CROIS QUE JE PEUX ME D\220BARRASSER MAINTENANT DE CE STUPIDE D\220GUISSEMENT",
+ "LE PASSAGE AUX DONJONS EST FERM\220 \267 CAUSE DES TRAVAUX. VOUS \322TES PRI\220S D'UTILISER L'ENTR\220E PRINCIPALE. EXCUSEZ LES ENNUIES",
+ "...IL EST P\266LE. AVEC DE GROSSES DENTS. IL A UN TOUPET ET UTILISE UNE CAPE... -C'EST S\352REMENT DRASCULA!",
+ "C'EST B.J.! B.J. TU EST BIEN?",
+ "OUI, JE SAIS QU'ELLE EST B\322TE, MAIS JE SUIS SEUL",
+ "N'AURAS-TU PAS UNE CL\220 PAR L\267, N'EST-CE PAS?",
+ "N'AURAS-TU PAS UN ROSSIGNOL, PAR HASARD?",
+ "DONNE-MOI UNE \220PINGLE. JE VAIS FAIRE COMME MCGYVER",
+ "NE BOUGES PAS, JE REVIENS TOUT DE SUITE",
+ "ZUT! -S'EST CASS\220E!",
+ "OL\220\220\220! ET EN PLUS JE ME SUIS RAS\220, COLL\324GUE!",
+ "OUI, MON AMOUR?",
+ "IL N'ARRIVE PAS",
+ "LE PIANISTE N'EST PAS L\267",
+ "UN COKTAIL TRANSYLVAN",
+ "JE N'AI PAS UNE CHAMBRE",
+ "SELON PARA\327T, IL EST REST\220 COINC\220 DANS LA BAIGNOIRE ET D\220CIDA ALORS D'OUVRIR UN BAR ",
+ "IL EST SO\352L COME UNE CUVE DE CUBA",
+ "CE CHEVEU... LE CAS CE QU'IL ME RAPPELLE QUELQU'UN",
+ "C'EST UN SQUELETTE OSSEUX",
+ "REGARDE! MIGUEL BOS\220!",
+ "IL DORME. CE SERAIT DOMMAGE LE R\220VEILLER",
+ "IL EST PLUS MOCHE QU'\220MILE DE PAZ",
+ "UN CERCUEIL EN BOIS DE PIN",
+ "IL VA ME COUPER EN PETITES TRANCHES, COMME UN SAUCISSON",
+ "JE N'AIME PAS LES PENDULES. JE PR\220F\324RE LES ARTICHAUTS",
+ "MES MAINS SONT EMMENOTT\220ES. JE N'ARRIVERAI PAS",
+ "IL SAUTE AUX YEUX QUE C'EST UNE PORTE SECR\324TE",
+ "ILS M'IGNORENT",
+ "C'EST BIEN!",
+ "DANS LE SCRIPT IL BOUGEAIT, MAIS LE JEU A SURPASS\220 LE BUDGET ET ON N'A PAS PU ME PAYER UN GYMNASE POUR ME METTRE EN FORME. DONC, POINT DU TOUT",
+ "ELLE PARA\327T UN PEU D\220TACH\220E DU MUR",
+ "JE NE CROIS PAS POUVOIR M'EN SERVIR. ELLE TROP HUMIDE POUR L'ALLUMER",
+ "\267 L'AILE OUEST? -M\322ME PAS EN FOU ACHEV\220! -VA SAVOIR QU'AURAIT-IL L\267-BASI!",
+ "IL Y A DE JOLIS MOTIFS TRANSYLVANS",
+ "",
+ "QUEL DOMMAGE NE PAS AVOIR TROUV\220 L\267-DEDANS UN PETIT AGNEAU EN TRAIN DE SE R\342TIR!",
+ "LA DERNI\324RE FOIS QUE J'AI OUVERT UN FOURNEAU LA MAISON A VOL\220 EN \220CLATS",
+ "C'EST L'ENSEIGNE DE L'\220QUIPE DE FOOT-BALL DE LA TRANSYLVANIE",
+ "ET POURQUOI FAIRE? POUR ME LA METTRE \267 LA T\322TE?",
+ "JE NE CROIS PAS QUE CES TIROIRS SOIENT DE CEUX QUI S'OUVRENT",
+ "JE NE VEUX PAS SAVOIR LA NOURRITURE QU'IL Y AURA L\267-DEDANS!",
+ "J'AI L'IMPRESSION QUE C'EST DE L'IMPRESSIONNISME",
+ "LA NUIT S'EMPARE DE NOUS TOUS... QUELLE PEUR, N'EST-CE PAS?",
+ "ELLE EST BOUCH\220E",
+ "C'EST LE ROI. NE L'AVAIT-TU PAS IMAGIN\220?",
+ "NON, J'EN AI D\220J\267 UN CHEZ MOI ET JE LUI DONNE \267 MANGER EN PLUS",
+ "UN PLACARD AVEC DES LIVRES ET D'AUTRES CHOSES",
+ "ET QUI J'APPELLE \267 CES HEURES-L\267?",
+ "\"COMMENT FAIRE LA D\220CLARATION D'IMP\342TS\" COMME C'EST INT\220RESSANT!",
+ "J'AI D\324J\267 UN CHEZ MOI. JE CROIS QUE C'EST UN BEST-SELLER MONDIAL",
+ "UNE CL\220 COMPL\324TEMENT NORMALE",
+ "IL ME SEMBLE QUE CELLE-CI N'EST PAS D'ICI",
+ "H\220! CE SONT DES FRITES SOUS FORME DE DENT CANINE! \200A ME PLA\327T",
+ "JE NE CROIS PAS QU'IL SOIT LE MEILLEUR MOMENT POUR MANGER DES GOURMANDISES, AVEC MA FIANC\220E AUX MAINS DE L'\322TRE LE PLUS MAUVAIS QU'UNE M\324RE A PU ACCOUCH\220",
+ "COMME JE SUIS BIEN EN TUANT DES VAMPIRES AVEC CELA!",
+ "VOYONS SI APPARA\327T T\342T UN AUTRE",
+ "NON, IL FAUT QU'IL SOIT AVEC UN SALE ET PUANT VAMPIRE, COMME CELUI QUI J'AI TU\220 AVANT",
+ "C'EST L'AUTHENTIQUE PERRUQUE QU'ELVIS AVAIT UTILIS\220E QUAND IL EST DEVENU CHAUVE",
+ "C'EST DE LA FARINE, MAIS JE NE PEUX PAS DIRE DES MARQUES",
+ "PEUT-\322TRE DANS UN AUTRE MOMENT, D'ACCORD?",
+ "C'EST UNE HACHE MAGNIFIQUE, DOMMAGE DE NE PAS POUVOIR SE PAYER AUCUNE T\322TE DE VAMPIRE PAR L\267",
+ "NON. JE SUIS UNE BONNE PERSONNE AU FOND",
+ "C'EST LE D\220ODORANT DE LA THACHER-HI!HI!HI!",
+ "C'EST UNE CAPE ASSEZ MIGNONE",
+ "",
+ "TOUT COMME LES BRANCHES DE TOUS LES ARBRES DU MONDE, C'EST-\267-DIRE SANS RIEN DE PARTICULIER",
+ "OH! C'EST INCROYABLE! -UNE CORDE DANS UNE AVENTURE DESSIN\220E!",
+ "JE ME DEMANDE \267 QUOI SERVIRA-T-ELLE...?",
+ "UNE CORDE ATTACH\220E \267 UNE BRANCE OU UNE BRANCHE ACROCH\220E \267 UNE CORDE, \200A D\220PEND DU POINT DE VUE",
+ "IL PARA\327T QUE CETTE PIE \267 DE TR\324S MAUVAISES INTENTIONS",
+ "TAIS-TOI! JE NE LA DIS RIEN, POUR SI ELLE SE F\266CHE",
+ "ELLE SEMBLE MORTE, MAIS C'EST UNE MENSONGE",
+ "IL N'Y A AUCUN ANIMAL ABiM\220 DANS LA PRODUCTION DE CE JEU",
+},
+{
+ "",
+ "\220 la seconda porta pi\243 grande che ho vista nella mia vita",
+ "Forse.., no",
+ "\202 chiusa con tabelle. La chiesa deve essere abbandonata da tanti anni fa.",
+ "Ma se non la ho aperta",
+ "Che faccio? La tolgo?",
+ "Ciao porta. Vado a farti una cornice",
+ "Troppo per me",
+ "una finestra chiusa con tabelle",
+ "Non ce la faccio",
+ "Eccolo",
+ "E per che?",
+ "Ciao finestra. Hai qualcosa da fare stasera?",
+ "No senza il permesso del Ministero dei Lavori Pubblici",
+ "-eh! quella finestra ha soltanto una tabella..",
+ "-Eooooo! -Finestra!",
+ "Tu, ciao",
+ "",
+ "Non ce la faccio",
+ "Va bene dov'\202 ",
+ "",
+ "\220 una tomba in forma di croce",
+ "Non grazie",
+ "Ciao morto. Vuoi delle patatine a forma di vermi?",
+ "Si. Come in Poltergueist.",
+ "",
+ "",
+ "Torno in quindici minuti",
+ "Vietato affigere manifesti",
+ "",
+ "\220 chiuso con la chiave",
+ "Ne ho gi\240 uno.",
+ "",
+ "Non risponde.",
+ "No, \202 ben parcheggiato.",
+ "\220 una porta.",
+ "Un casseto del tavolino.",
+ "Un sospettoso armadio.",
+ "Ciao armadio. Come va?.",
+ "",
+ "",
+ "\220 un candelabro molto vecchio.",
+ "Deve essere qu\241 da che Mazinguer-Z era una vite.",
+ "No.\220 una reliquia.",
+ "\220 una bella pala.",
+ "",
+ "Hi, hi, hi",
+ "",
+ "No.",
+ "",
+ "Ha,ha,ha . - che buono!",
+ "",
+ "",
+ "",
+ "Non vedo niente di speciale.",
+ "Ferdinan, la pianta.",
+ "\220 una degli spunzoni della cancellata.",
+ "-Eh! Qu\241 sotto c'\202 una scatola di cerini",
+ "-Guarda! un pacco di fazzoletti. -E c'\202 ne uno senza utilizzare!.",
+ "Non c'\202 niente di pi\243 nel secchio.",
+ "\220 un cieco che non vede",
+ "",
+ "",
+ "",
+ "",
+ "\220 una abbondante quantit\240 di soldi",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "NON HA NULLA DI SPECIALE",
+ "NON \324 MICA SPECIALE",
+ "TU! CHE C'\324 ?",
+ "CIAO",
+ "NIENTE NUOVO?",
+ "-COME VA LA FAMIGLIA?",
+ "- MA CHE STAI A DIRE?",
+ "-MA COME VADO A PRENDERE QUELLA COSA!",
+ "\324 VIETATO DALLA MIA RELIGIONE",
+ "MEGLIO DI NO",
+ "-COME NO!",
+ "NEANCHE PARLARNE",
+ "IMPOSSIBILE",
+ "QUESTO NON SI APRE",
+ "IO SOLO NON CE LA FACCIO",
+ "SE VORREI POTREI, MA MI FA PIGRIZIA",
+ "NON TROVO UNA BUONA RAGIONE",
+ "\324 UN CERVELLO ABBASTANZA CARINO",
+ "ALLORA, CERVELLO, CHE NE PENSI DI FARE STASERA?",
+ "NO, DEVE CONSERVARSI IN UN POSTO CHIUSO ALLA AZIONE MUTANTE DELLA ATMOSFERA",
+ "\324 COS\336 DURO, COME IL MIO CAPO",
+ "UNA TALEA MOLTO AFFILATA",
+ "FEDELE TALEA AFFILATAAA, NOBILE ROVERE TRANSILVANOOO",
+ "-INSOMMA, DEVO TAGLIARMI LE UNGHIE!",
+ "-LA, DENTRO, C'\324 B.J,E MAMMA MIA, CHE FIGA!",
+ "\324 CHIUSA SOTTO LUCCHETTO E CATENACCIO",
+ "\"LUCCHETTO E CATENACCIO S.A\"",
+ "\324 IL TIPICO SCHELETRO CHE C'\324 IN TUTTE LE CARCERE DI TUTTI I VIDEO-GIOCHI",
+ "SI UTILIZA PER DARE ELETRICIT\267 AGLI APARATTI COLLEGATI A LUI",
+ "\324 TOTALMEN11TE ARTIGIANO, PERCHE I GIAPONESSI LI FANNO TASCABILI",
+ "NELLA MIA VITA, HO VISTO SOLTANTO UNA VOLTA UNA COSA COS\336 BRUTTA",
+ "SMETILLA. NON DICO NULLA PER SE SI ARRABBIA",
+ "SEMBRA ABBASTANZA RAZIONALE",
+ "\324 UNA FOTO DI PLATONE SCRIVENDO IL SUO DISCORSO PERSO",
+ "NON SONO DI QUELLI CHE PARLANO CON POSTERS",
+ "UNA SCRIVANIA MOLTO CARINA",
+ "\324 UN DIPLOMA DI CACCIA-CACCIA-VAMPIRI OMOLOGATO DALLA UNIVERSIT\267 DI OXFORD",
+ "\324 NOTTE BUIA CON LUNA PIENA",
+ "SEMBRA CHE QUESTE VITI NON SONO MOLTO AVVITATE",
+ "NON GUARDARE, MA CREDO CHE UNA TELECAMERA NASCOSTA MI ST\267 REGISTRANDO",
+ "UN DETETTORE DI TALEE MOLTO MODERNO",
+ "NO, IL LABORATORIO SI TROVA NEL SECONDO PIANO",
+ "UN BEL TAVOLINO",
+ "\324 UN SACCO DI SOLDI CHE NON PUO MANCARE IN UNA AVVENTURA CHE SIA COS\336 IMPORTANTE",
+ "IF I WERE A RICHMAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ "SONO DELLE STRANE FOGLIE. DEVONO AVERLE PORTATE DALLA SUDAMERICA",
+ "NON CREDO CHE SIA RISPOSTO",
+ "\324 UN BEL CROCIFISSO DI LEGNO. LA ICONA NON RIFLESSA TUTTA LA SUA BELLEZA",
+ "IO SOLO PREGO PRIMA DI ANDARMENE AL LETTO",
+ "-EH, SEMBRA CHE QUESTO SPUNZONE \324 UN PO ALLENTATO!",
+ "E POI TI LAMENTI PERCHE NON TI DO SUGGERIMENTI",
+ "\324 UNO SPUNZONI ABBASTANZA CONVENZIONALE",
+ "SONO CARINI, SEBBENE HANNO PARECHIO POLVERE",
+ "NO, NON MI SENTIRANO; HI,HI,HI -CHE BUONO!",
+ "\"LA BELLA ADDORMENTATA DEL BOSCO\" DI CIAIKOSKY, O CIOIFRUSKY, O COME SI DICA",
+ "MOLTO APPETITOSA",
+ "NO, IO NON SONO DI QUELLI CHE SI METTONO IN BOCCA GOMME USATE",
+ "UNA FALCE MOLTO CARINA. MI DOMANDO DOVE CI SAR\265 IL MARTELLO",
+ "\"I FABBRICANTI DI TABACCO AVVERTONO CHE IL TABACCO NUOCE GRAVEMENTE LA SALUTE\"",
+ "UNA CANDELA NORMALE, ANZI CON CERA",
+ "MAMMA MIA COME BRILLANO QUESTE DUE BRILLANTI MONETE",
+ "MAMMA MIA COME BRILLA QUESTA BRILLANTE MONETA",
+ "CON QUESTO SAR\220 IMMUNE AI MORSI DEI VAMPIRI",
+ "NO, ANCORA NON \220 IL MOMENTO",
+ "C'E UN BIGLIETTO DI DIECIMILA E UN PAIO DI MONETE",
+ "DICE \"SI PREGA DI NON BUTTARE CIBO AL PIANISTA\"",
+ "OMELETTA, 3.000 .PESCI FRITI, 2.000,PATATINE, 2.500",
+ "LE MIGLIORI HAMBURGUER A QUESTA PARTE DEL DANUBIO, SOLTANTO PER 4.000",
+ "UN BEL TESCHIO, CON UNO SGUARDO MOLTO PENETRANTE. HI,HI,HI, CHE BUONO!",
+ "CIAO TESCHIO, MI RICORDI AL ZIO DI HAMLET",
+ "HO L'ABITUDINE DI NON TOCCARE COSE CHE SIANO STATE VIVE",
+ "UN CESTINO",
+ "UN TOTOCALCIO PER LA PARTITA DI STASERA",
+ "MI DOMANDO CHE CI SAR\265 DIETRO",
+ "-EH, QUESTA TENDE NON SI MUOVE!",
+ "MADONNA, CHE TETRO \220 QUESTO CASTELLO.",
+ "NON CE LA FACCIO, \220 TROPPO LONTANO PER SENTIRMI",
+ "UN TIPICO BOSCO TRANSILVANO, CON GLI ALBERI",
+ "-MA CHE SCIOCHEZZE DICI, \220 MOLTO BUIO",
+ "PASTICCERIA ROSSI. DOLCI E GOMME",
+ "UNA PORTA MOLTO BELLA",
+ "\220 CHIUSA",
+ "UN FUSTO COMPLETAMENTE CHIUSO",
+ "",
+ "CHE ANIMALETTI COS\326 BELLI!",
+ "BSSSSSS,BSSSS, GATINO..",
+ "NON RISPONDE",
+ "LA LUNA \220 UN SATELLITE CHE GIRA INTORNO LA TERRA CON UN PERIODO DI RIVOLUZIONE DI 28 GIORNI",
+ "CIAO, LUNA LUNETTA",
+ "\220 TOTALMENTE CHIUSA CON TABELLE",
+ "IMPOSSIBILE. QUESTO, NON LO APRE N\220 HOUDINI",
+ ".EH, SEMBRA CHE L'OMBRA DEL CIPRESSE \220 ALUNGATA",
+ "-EOOO, BARISTA",
+ "VORREI UNA CAMERA",
+ "SA DOVE POSSO TROVARE A UNO CHE SI FA CHIAMARE CONDE DRASCULA",
+ "SI, PER CHE?",
+ "COME MAI?",
+ "DA.....DAVVERO?",
+ "BUONA DOMANDA, GLI RACONTER\220 LA MIA STORIA, SENTA..",
+ "SONO SOLTANTO CINQUE MINUTI",
+ "MI CHIAMO JOHN HACKER, E SONO RAPPRESENTANTE DI UNA IMMOBILIARIE BRITANICA",
+ "MI HANNO DETTO CHE IL CONDE DRASCULA VUOLE COMPRARE DEI TERRENI A GIBRALTAR, E SONO QU\326 PER NEGOZIARE LA VENDITA",
+ "MA CREDO IO CHE DOMANI PRESTO TORNO CON LA MAMMA",
+ "BELLA NOTTE, VERO?",
+ "NO, NIENTE",
+ "EOOOO, PIANISTA",
+ "BELLA NOTTE",
+ "ANZI, NON FA FREDDO",
+ "ALLORA... TI LASCIO CONTINUARE A SUONARE",
+ "VA BENE",
+ "CIAO CAPO, COME VA?",
+ "E LA FAMIGLIA?",
+ "C'\220 GENTE QU\326, EH?",
+ "MEGLIO NON DICO NULLA",
+ "SI ST\265 MEGLIO A CASA CHE A NESSUN POSTO... -EH? MA SE LEI NON \220 LA ZIA EMMA. ANZI. SE IO NON HO NESSUNA ZIA EMMA.",
+ "SI, IL MIO ANCHE. LEI PUO CHIAMARMI COME GLI PARA, MA SE MI CHIAMA JOHNY, VENGO SUBITO COME I CANI",
+ "SI, CHE SPIRITOSO SONO, VERO? MAA.. DOVE MI TROVO?",
+ "SI.",
+ "MANAGIA..",
+ "OH, SI. COME NO",
+ "ALLORA GRAZIE MILE PER DARMI IL TUO AIUTO. NON TI DISTURBO PI\351 . SE MI DICI DOV'\220 LA PORTA, PER FAVORE...",
+ "PERCHE LA BOTTA HA DOVUTO DAGNARMI IL CERVELLO E NON VEDO UNA MADONNA",
+ "NON FA NIENTE. SEMPRE NE PORTO ALTRI IN PI\351 ",
+ "-UFFA, CHE FIGA!- NON MI ERA ACCORTO, CERTO, SENZA GLI OCCHIALI",
+ "SENTI..",
+ "COME MAI...?!",
+ "NON TI PREOCUPARE B.J., AMORE MIO! TI LIBERER\220 DA QUEL TIZIO",
+ "MI HA FATTO ARRABBIARE",
+ ".AHHH, IL LUPO- MANNARO! -MUORE MALDITO!",
+ "BENE, CREDO...",
+ "BENE, CREDO CHE PROSSIGUER\220 LA MIA STRADA. PERMESSOO..",
+ "-COME?",
+ "LA VERIT\267, PENSANDOCI MEGLIO, CREDO DI NO",
+ "DIMI, OH ERUDITO FILOSOFO, C'\324 QUALCUNA RELAZIONE CAUSA-EFETTO TRA LA VELOCIT\267 E LA PANCETA?",
+ "VA BENE, SMETTILA. COMUNQUE NON SO PERCHE HO DETTO QUESTO",
+ "COSA FAI QU\336 FILOSOFANDO, CHE NON STAI MANGIANDO GENTE?",
+ "COME MAI?",
+ "SENTI, PUOI RIPETERE QUELLO DI \"INCLINAZIONI PRE-EVOLUTIVE\"?",
+ "SI SI, QUELLA STORIA CHE MI HAI RACCONTATO PRIMA. PERCHE NON HO CAPITO MOLTO BENE.",
+ "NO, MEGLIO NON DICO NULLA, NON VOGLIO METTERE IL COLTELLO NELLA PIAGA...",
+ "SI, MI DICA?",
+ "SI, CHE SUCCEDE?",
+ "AH, ADESSO CHE CITA IL SOGGETTO GLI DIR\343 CHE...",
+ "",
+ "AH.., COSA SUCCEDEREBBE SE UN VAMPIRO PRENDEREBBE LA RICETA..",
+ "NIENTE. SENTI, QUESTO SEMBRA UN POSTICCIO MESSO SUL COPIONE PER FINIRE PRESTO IL VIDEO-GIOCO?. BENE, FORSE, NO",
+ "\324 VUOTO!",
+ "PERCHE HAI RUBATO IL MIO AMORE, B.J., SENZA LEI LA MIA VITA NON HA SENSO",
+ "-IL SUO CERVELLO?!",
+ "NO NIENTE, MA CREDO CHE ALLA FINE IL TUO PICCOLINO MOSTRO MI HA FATTO ARRABBIARE",
+ "SANTA MADONNA AIUTAMI!",
+ "NON TE LA CAVEREI. SICURO CHE APPARISCE SUPERMAN E MI LIBERA!",
+ "CHE SCHIFFO DI VIDEO-GIOCO NEL CUI MUORE IL PROTAGONISTA",
+ "UN ATTIMO, COSA SUCCEDE COL MIO ULTIMO DESIDERIO?",
+ "-HA,HA! ORA SONO IMMUNIZZATO CONTRO TE, MALEDETTO DEMONIO. QUESTA SIGARETTA \324 UNA POZIONE ANTI-VAMPIRI CHE MI HA DATTO VON BRAUN",
+ "SI CERTO. MA NON RIUSCIRAI MAI A FARMI DIRTI LA RICETA",
+ "POSSO SOPPORTARE LA TORTURA, ANZI CREARLA",
+ "-NO, PER FAVORE!- PARLER\220, MA NON FARMI QUESTO!",
+ "BENE, TI HO GI\267 DETTO QUELLO CHE VOLEVI SAPERE. ORA LIBERA B.J. E ME, E LASCIACI PERDERE",
+ "-B.J-.! COSA FAI QU\336? DOV'\324 DRASCULA?",
+ "CHE PERVERSO! SOLTANTO PERCH'\324 NOBILE PENSA CHE HA IL DIRITTO SU TUTTI QUANTI",
+ "ABASSO LA ARISTOCRAZIA!",
+ "FORZA I POVERI DEL MONDOOO...",
+ "E QUELLO CHE VEDO \324 CHE TI HA INCATENATO ANZI CON LUCCHETTO",
+ "O.K., NON AVRAI UNA FONCINA?",
+ "BENE BENE, NON PRENDERTELA COS\336, CI PENSER\220 IO",
+ "EH, BARISTA",
+ "COME VA LA PARTITA?",
+ "CHI?",
+ "MA NON VEDI CHE DRASCULA \324 QU\336?",
+ "ANDIAMO A UCCIDERLO",
+ "SERVIMI UN DRINK..",
+ "NIENTE. HO DIMENTICATO COSA VOLEVO DIRTI",
+ "O\247MI\247SERVI\247UN\247DRINK\247O\247MI\247METTO\247A\247SUONARE\247IL\247PIANOFORTE",
+ "QUANTO MANCA PER LA FINE DELLA PARTITA?",
+ "BUONA SERA",
+ "COME VA IGOR? VAI CON LA GOBBA? -HI,HI,HI,CHE BUONO!",
+ "CHE STAI FACENDO?",
+ "NO",
+ "ALLORA METTITI GLI OCCHIALI",
+ "COSA \324 QUELLA DELLA ORGIA SOPRANNATURALE?",
+ "VA BENE, NON COTINUARE, MI FACCIO IDEA",
+ "NON POTREI DIRMI DOV'\324 DRASCULA?",
+ "DAIII, PER FAVORE",
+ "PER CHE NO?",
+ "AH, MA DORME DI NOTTE?",
+ "BENE, ALLORA IN BOCCA IL LUPO CON I REDDITI",
+ "DEVO PROPRIO PARLARE CON LUI",
+ "EOOOO, SCHELETROOO!",
+ "OH DIO! UN MORTO CHE PARLA!",
+ "RACCONTAMI. COME MAI SEI VENUTO QU\336?",
+ "E PER CHE DRASCULA VUOLE CREARE UN MOSTRO?",
+ "COME TI CHIAMI, AMICO SCHELETRO?",
+ "SENTI, NON VUOI QUALCOSA DA MANGIARE?",
+ "DEVI AVERE LO STOMACO VUOTO .- HI,HI,HI!",
+ "LA VERIT\267 \324 CHE NON MI VA DI PARLARE ADESSO",
+ "VANFFAN ( BIP ) FIGLIO DI .......( BIIP ).. VAI A FARE....( BIIIP )",
+ "IO LA AMAVO DAVVERO. O.K., SONO D'ACCCORDO CHE NON ERA MOLTO INTELLIGENTE, MA NESSUNO \324 PERFETTO, NO?",
+ "ANZI, AVEVA UN CORPO DA PAURA",
+ "ORMAI NON SAR\343 PI\353 QUELLO DI PRIMA .MI RICHIUDER\343 IN UN MONASTERO, E LASCIER\343 LA MIA VITA PERDERE",
+ "NIENTE POTR\267 FARMI USCIRE DI QUESTA MISERIA PERCHE...",
+ "DI CHI? DI CHI?",
+ "VOGLIO ESSERE PIRATA",
+ "VOGLIO ESSERE PROGRAMMATORE",
+ "RACCONTAMI QUALCOSA SU GARIBALDI",
+ "CONTINUER\343 A GIOCARE E DIMENTICHER\343 CHE VI HO VISTI",
+ "MA CHI AVR\267 PENSATO QUESTA SCIOCHEZZA!",
+ "\324 UNA BORSA COME QUELLA DI MIA NONNA",
+ "MA CHE FIGO SONO!",
+ "PI\353 MI VEDO PI\353 MI PIACCIO",
+ "E POI COME MI CHIUDO?",
+ "PRIMA DEVO APRIRMI, VERO?",
+ "ST\343 BENE DOVE SONO",
+ "MI HO GI\267 PRESSO",
+ "CIAO IO",
+ "ME GLI INDOSSER\343 QUANDO SIA LA OCCASIONE OPORTUNA",
+ "NON VEDO NIENTE DI SPECIALE",
+ "\324 BENE DOV'\324",
+ "E PER CHE?",
+ "NON CE LA FACCIO",
+ "CIAO TU",
+ "\324 IL SEPOLCRO DELLO ZIO PEPPINO",
+ "EOOOO, ZIO PEPPINOOOO!",
+ "NO.NON VOGLIO TAGLIARMI UN' ALTRA VOLTA",
+ "-EHEM,EHEM..!",
+ "GNAMM, EMMM,!",
+ "-SI, COF, COF!",
+ "GUARDA, C'\324 UNA GOMMA QU\336 ATTACATA",
+ "\324 IL TELEFONINO CHE MI HANNO REGALATO A NATALE",
+ "COM'\324 ALTO",
+ "ESCI AL BALCONE GIULIETTA!",
+ "TU SEI LA LUCE CHE ILLUMINA LA MIA VITA!",
+ "EH, PORTA, CHE C'\324?",
+ "EOOOO, SPENDITRICE DI TABACCO DI TRANSILVANIAAA",
+ "\324 UNA SPENDITRICE DI TABACCO",
+ "HO UN'ALTRA MONETA DENTRO",
+ "NO. HO DECISSO SMETTERE DI FUMARE E DI BERE",
+ "DA OGGI SAR\343 SOLTANTO PER LE DONNE",
+ "QUESTO \324 UNA TRUFFA! NON \324 USCITO NULLA",
+ "ALLA FINE!",
+ "CHE TI HO DETTO?, UN BAULE",
+ "CIAO BAULE, TI CHIAMI COME MIO CUGINO CHE SI CHIAMA RAUL..E",
+ "HO TROVATO LA BORSA DI B.J.",
+ "MIO DIO, NON MI RIFLETTO, SONO UN VAMPIRO!",
+ "...AH, NO, \324 UN DISEGNO",
+ "SPECCHIO DELLE MIE BRAME: CHI \220 ILPI\351 BELLO DEL REAME?",
+ "NON VUOLE APRIRMI",
+ "MOLTO BENE. MI HO MESSO I TAPPI",
+ "\324 UN DIPLOMA DI CACCIA-VAMPIRI OMOLOGATO DALLA UNVERSIT\267 DI CAMBRIDGE",
+ "NO. MANCANO ANCORA GLI INGREDIENTI, NON MERITA LA PENA CHE SIA SVEGLIATO",
+ "NON HO SOLDI",
+ "\324 UNA LAMPADA BRITANICA",
+ "BARISTA! AIUTAMI!",
+ "HA COMPARITO UN VAMPIRO ED HA PRESSO LA MIA FIDANZATA",
+ "MA NON MI AIUTER\267",
+ "MORTA? CHE VUOLE DIRE?",
+ "- EHEM!",
+ "UN VAMPIRO HA SEQUESTRATO LA RAGAZZA DELLA 506!",
+ "DEVI AIUTARMI!",
+ "NON SAI SUONARE NESSUNA DI \"ELIO E LE STORIE TESSE\"",
+ "COME TI SOPPORTI, SUONANDO SEMPRE LO STESSO?",
+ "ALLORA COME MI SENTI?",
+ "PRESTAMI I TAPPI",
+ "DAI, TE LI RESTITUISCO SUBITO",
+ "DAIIII...",
+ "CIAO. DEVO UCCIDERE UN VAMPIRO",
+ "",
+ "COSA DICI? IN TRANSILVANO?",
+ "CHI \324 LO ZIO PEPPINO?",
+ "MA CHE SUCCEDE CON DRASCULA?",
+ "CHI \324 VON BRAUN?",
+ "E PER CHE NON LO FA?",
+ "E DOVE POSSO TROVARE VON BRAUN?",
+ "GRAZIE E CIAO, SOGNI D'ORO",
+ "SAR\267 MEGLIO BUSSARE PRIMA",
+ "\324 LEI IL PROFESSORE VON BRAUN?",
+ "E MI POTREBBE DIRE DOVE POSSO ...?",
+ "NON CREDO SIA IL NANNO GANIMEDI",
+ "-PROFESSORE!",
+ "AIUTAMI! LA VITA DEL MIO AMORE DIPENDE DI LEI!",
+ "VA BENE, NON HO BISOGNO DEL SUO AIUTO",
+ "O.K. ME NE VADO",
+ "NON AVERE PAURA. INSIEME VINCEREMO DRASCULA",
+ "ALLORA PER CHE NON MI AIUTA?",
+ "IO CE LE HO",
+ "SI CE LE HO",
+ "D'ACCORDO",
+ "...EHH...SI",
+ "VENGO A RIENTRARE A QUESTA CABINA",
+ "SONO PRONTO PER FARE LA PROVA",
+ "VA BENE, VECCHIETO. SONO VENUTO PER IL MIO SOLDI",
+ "NO, NIENTE. ME NE GI\267 ANDAVO",
+ "SCUSA",
+ "TI \324 INTERESANTE QUESTO LIBRO? HA PARTITURE DI TCIAKOWSKY",
+ "COME POSSO UCCIDERE UN VAMPIRO?",
+ "NON TI HANNO DETTO CHE NON \324 BUONO DORMIRE IN CATTIVA POSIZIONE?",
+ "\324 QUELLO CHE SEMPRE DICE MIA MADRE",
+ "PER CHE DRASCULA NON FU RIUSCITO A UCCIDERTI?",
+ "E COSA FU?",
+ "BENISSIMO! HA LEI LA POZIONE DI IMMUNIT\267...!",
+ "ALLORA",
+ "MOLTO BENE",
+ "MI PUO RIPETERE COSA BISOGNO PER QUELLA POZIONE?",
+ "VADO VIA VELOCE A TROVARLO",
+ "SENTA, COSA \324 SUCCESO CON IL PIANISTA?",
+ "HO GI\267 TUTTI GLI INGREDIENTI DI QUESTA POZIONE",
+ "UNA DOMANDA: COSA \324 QUELLA DI ALUCSARD ETEREUM?",
+ "DICA, DICA..",
+ "E DOV'\324 QUELLA GROTTA?",
+ "CHE C'\324? NON AVETE TRIBUNALE?",
+ "...MA ...E SE TROVO PI\353 VAMPIRI?",
+ "\324 UN VAMPIRO CHE NON MI FA PASSARE",
+ "SI ASSOMIGLIA A YODA, MA PI\353 ALTO",
+ "EH, YODA. SE MI FAI PASSARE TI DAR\343 CENTO LIRE",
+ "BENE, O.K., NON POSSO DIRTI NULLA",
+ "CIAO VAMPIRO, BELLA NOTTE, VERO?",
+ "TI HANNO DETTO QUALCHE VOLTA CHE TI ASSOMIGLII A YODA?",
+ "SEI UN VAMPIRO O UN DIPINTO ALL'OLEO?",
+ "MEGLIO NON DIRTI NIENTE, PERCHE POI TI ARRABBII",
+ "\324 CHIUSA CON LA CHIAVE",
+ "SE PROVO, LA GAZZA MI POTREI CAVARE UN OCCHIO",
+ "\324 CHIUSA! DIO MIO, CHE PAURA!",
+ "LE CERNIERE SONO OSSIDATE",
+ "LA DENTRO C'\324 SOLTANTO UN BARATOLO DI FARINA",
+ "QUESTO HA TOLTO L'OSSIDO",
+ "HO TROVATO UNA TALEA DI LEGNO DI PINO",
+ "PRENDER\343 QUESTO CH'\220 PI\353 GROSSO",
+ "BENE, CREDO DI POTERE TOGLIERMI QUESTO STUPIDO COSTUME",
+ "\"CORRIDOIO AI TORRIONI CHIUSO PER LAVORI IN CORSO. PER FAVORE, PER LA PORTA PRINCIPALE. SCUSATE PER IL DISTURBO\"",
+ "..\324 PALLIDO, HA DENTI CANINI, HA CIUFFO E UTILIZA MANTELLO...- SICURO CH'\324 DRASCULA!",
+ "B.J., B.J., STAI BENE?",
+ "SI, SO CH'\324 SCEMA MA MI SENTO SOLISSIMO",
+ "NON AVRAI UNA CHIAVE PER CASO, VERO?",
+ "- E SICURO CHE NON HAI UN GRIMALDELLO?",
+ "DAMI UNA FONCINA. VADO A FARE COME MCGYVER",
+ "NON MUOVERTI, TORNO SUBITO",
+ "- MANAGIA!- SI \324 ROTTA!",
+ "OLE, ANCHE MI HO FATTO LA BARBA!",
+ "SI, CARO?",
+ "NON ARRIVA",
+ "IL PIANISTA NON C'\324",
+ "UN DRINK TRANSILVANO",
+ "ANCORA NON HO CAMERA",
+ "SEMBRA CHE FU RISUCCHIATO NELLO SCARICO DELLA VASCA E HA DECISO APRIRE UN BAR",
+ "\324 UBRIACO PERSO",
+ "QUESTI CAPELLI.... CREDO CHE MI FANNO RICORDARE A QUALCUNO",
+ "\324 UNO SCHELETRO OSSUTO",
+ "GUARDA! MIGUEL BOSE!",
+ "\324 ADDORMENTATO. SAREBBE UN PECCATO SVEGLIARGLI",
+ "\324 PI\353 BRUTTO CHE BEGNINI",
+ "UN FERETRO DI LEGNO DI PINO",
+ "MI TAGLIER\267 A FETTINI, COME UN SALSICCIOTTO",
+ "NON MI PIACCIONO I PENDOLI. PREFERISCO LE CARCIOFE",
+ "LE MIE MANI SONO LEGATE. NON CE LA FAR\343",
+ "\324 OVVIO CH'\324 UNA PORTA SEGRETA",
+ "MI IGNORANO",
+ "-DAIII!",
+ "NEL PRIMO COPIONE SI MUOVEVA, MA IL VIDEO-GIOCO \220 USCITO DAL BUDGET E NON HANNO POTUTO PAGARMI UNA PALESTRA E NON SONO GONFFIATO",
+ "SEMBRA CH'\324 UN P\343 ALLENTATA DAL MURO",
+ "NON CREDO CHE MI SIA UTILE. \324 TROPPO UMIDA PER ACCENDERLA.",
+ "AL LATO OVEST? -N\324 PAZZO, CHI SA CHE CI SAR\267 LI!",
+ "HA DEI BELLI DISEGNI TRANSILVANI",
+ "",
+ "CHE PENA CHE NON CI SIA DENTRO UN AGNELLINO ARRROSTANDOSI",
+ "LA ULTIMA VOLTA CHE APRII UN FORNO, LA CASA SALT\220 PER ARIA",
+ "LO SCUDO DELLA SCUADRA DI CALCIO DI TRANSILVANIA",
+ "E PER CHE? PER INDOSARLA SULLA TESTA?",
+ "NON CREDO CHE I CASSETI SIANO DI QUELLI CHE SI APPRONO",
+ "NON VOGLIO SAPERE IL CIBO CHE CI SAR\267 LA DENTRO!",
+ "HO L'IMPRESSIONE CH'\324 IMPRESSIONISTA",
+ "LA NOTTE SI IMPADRONA DI TUTTI QUANTI... CHE PAURA?",
+ "\324 OSTACOLATA",
+ "\324 IL RE, NON LO AVEVI IMAGINATO?",
+ "NO, NE UNO A CASA, ANZI GLI DO DA MANGIARE",
+ "UNA SCAFFALATURA CON LIBRI ED ALTRE COSE",
+ "E A CHI CHIAMO A QUESTE ORE?",
+ "\"COME FARE LA DECLARAZIONE DI REDDITI\"- CHE INTERESSANTE!",
+ "NE HO UNO A CASA, CREDO CH'\324 UN BEST-SELLER MONDIALE",
+ "UNA CHIAVE COMPLETAMENTE NORMALE",
+ "MI SA QHE QUESTA NON \220 DI QU\336",
+ "EH, SONO PATATINE FRITE A FORMA DI DENTI CANINI ! MI AFASCINA",
+ "NON CREDO CHE SIA IL MOMENTO MIGLIORE PER METTERSI A MANGIARE DOLCI, L'ESSERE PI\353 CATTIVO DEL MONDO ha nelle sue mani la mia fidanzzata",
+ "COME MI ST\343 DIVERTENDO UCCIDENDO VAMPIRI CON QUESTO!",
+ "VEDIAMO SE APPARISCE UN ALTRO PRESTO",
+ "NO, DEVE ESSERE CON UN VAMPIRO SPORCO E SCHIFFOSO COME QUELLO DI PRIMA",
+ "\324 L'AUTENTICA PARRUCA CHE UTILIZZ\343 ELVIS QUANDO DIVENT\343 PELATO",
+ "\220 FARINA MA NON POSSO DIRE MARCHE",
+ "FORSE IN UN ALTRO MOMENTO. OK?",
+ "\220 UNA ASCIA BUONISSIMA, CHE PENA CHE NON CI SIA QU\336 VICINO NESSUNA TESTA DI VAMPIRO",
+ "NO. NEL FONDO SONO UNA BRAVISSIMA PERSONA",
+ "\324 IL DEODORANTE DELLA TACHER -HI,HI,HI!",
+ "\324 UN MANTELLO ABBASTANZA CARINO",
+ "",
+ "COME TUTTI I RAMI DI TUTTI GLI ALBERI DEL MONDO, CIO\324 MICA SPEZIALE",
+ "OH, INCREDIBILE!- UNA CORDA IN UNA AVVENTURA GRAFICA!",
+ "MI DOMANDO A CHE SERVE...",
+ "UNA CORDA LEGATA A UNA BRANCA, O UNA BRANCA LEGATA A UNA CORDA, DIPENDE COME SI GUARDI",
+ "SEMBRA CHE QUESTA GAZZA HA CATIVE INTENZIONI",
+ "DAI.., NON LA DICO NULLA CHE POI SI ARRABBIA",
+ "SEMBRA ESSERE MORTA, MA NON \220 VERO - EH?",
+ "NESSUN ANIMALE \220 STATO MALTRATO DURANTE LE RIPRESE DI QUESTO VIDEO-GIOCO",
+},
+};
+
+const char *_textd[][79] = {
+{
+ "",
+ "HEY IGOR, HOW IS EVERYTHING GOING?",
+ "IT'S ALWAYS THE SAME STORY EVERYTIME THERE'S A GOOD GAME ON THE SATELLITE! ANYWAY, WE'LL GO WATCH IT IN THE BAR, AS USUAL",
+ "IGOR LISTEN CAREFULLY MAN, WE ARE GOING TO START WITH PHASE NUMBER ONE OF MY PLAN TO CONQUER THE WORLD",
+ "FIRST WE'LL CAPTURE ONE OF THE LIGHTNINGS AND WE'LL DEMAGNETIZE IT WITH OUR INDIFIBULATOR. THE ELECTRICITY WILL COME THROUGH TO MY MONSTER AND HE'LL GET ALIVE!",
+ "IF EVERYTHING WORKS OUT ALL RIGHT, THIS WILL BE THE BEGINNING OF A GREAT ARMY THAT WILL CONQUER THE WORLD FOR ME. HA, HA",
+ "THE MONSTERS WILL DESTROY ALL THE ARMY'S WEAPONS IN THE WORLD, MEANWHILE, WE'LL BE SAFE IN THE PIECES OF LAND I BOUGHT IN GIBRALTAR",
+ "WE'LL SET UP A COUP. GOVERNMENTS ALL OVER THE WORLD WILL BE UNCOVERED AND THEIR COUNTRIES WILL SURRENDER TO ME!",
+ "I'LL BECOME THE FIRST BAD GUY IN HISTORY TO MAKE IT ! HA, HA!",
+ "I'M NOT TALKING TO YOU, IDIOT! I'M JUST GIVING YOU THE PLOT. ALL RIGHT, EVERYTHING READY?",
+ "THE TIME HAS COME! TURN ON THE ALKALINE BATTERIES' SWITCH",
+ "DAMNED IT! WHAT WENT WRONG?",
+ "ARE YOU SURE YOU CHECKED IT ALL AND THERE WAS NOTHING MISSING? YOU'VE BEEN LATELY MESSING AROUND WITH THAT STUFF ABOUT TAXES AND I DON'T KNOW MAN...",
+ "YOU STUPID THING! YOU FORGOT TO CONNECT THE INDIFIBULATOR. THE SCREWS HAVE PROBABLY MAGNETIZED AND HIS BRAIN BURNT",
+ "YOU ARE DEAD, YOU ARE DEAD...WAIT TILL I GET YOU!",
+ "SHUT UP! I'LL GET ANOTHER BRAIN TOMORROW AND THEN WE WILL REPEAT THE EXPERIMENT",
+ "THIS TIME I'LL GET A WOMAN'S BRAIN. SHINY AND NOT USED YET...HA, HA, HA, GOODIE ONE!",
+ "SO WHAT? I'M THE BAD GUY, RIGHT? SO I CAN BE AS FULL OF MACHISMO AS I WANT, ALL RIGHT? AND IF YOU SAY SOMETHING AGAIN I'LL TURN YOUR HUMP BACK TO FRONT!",
+ "HA, HA, HA. YOU FELL TOOO!! NOW YOU ARE GOING TO PAY FOR DARING TO FIGHT AGAINST ME! IGOR, TAKE HIM TO THE PENDULUM OF DEATH!",
+ "AND SO, TELL ME, YOU STUPID HUMAN. HOW COME YOU WANT TO DESTROY ME?",
+ "THAT'S BEAUTIFUL!. IF IT WASN'T BECAUSE IT MAKES ME LAUGH, I WOULD CRY",
+ "OUR GIRLFRIEND'S BRAIN TO HELP ME CONQUERING THE WORLD",
+ "YES, SURE! I'LL TAKE IT FROM HER AND GIVE IT TO MY FRUSKYNSTEIN. THE WORLD WILL BE MINE WITH IT, HA, HA",
+ "WHAT!? YOU'RE DEAD, MAN! I'M GOING TO...YOU REALLY GOT ME ANGRY MAN...COME ON, PREPARE TO DIE!",
+ "HA, HA, HA. NOT EVEN IN YOUR WILDEST DREAMS!",
+ "YES, ISN'T IT? HA, HA",
+ "ALL RIGHT, ALL RIGHT. BUT DO IT QUICKLY, OK?",
+ "PUT THAT CIGARETTE OUT NOW! I CAN'T STAND YOU ANYMORE!",
+ "AND SO, DOES THAT BREW HAVE THE OPPOSITE EFFECT?",
+ "WELL, WE'LL SEE THAT",
+ "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?",
+ "YES, WHAT?...OH, DAMNED, THE GAME!",
+ "I FORGOT ABOUT THAT. GET THE GIRL AND LET'S GO AND WATCH IT. WE CAN CONQUER THE WORLD LATER",
+ "THANKS MAN, I WAS THIRSTY",
+ "OH, THE CRUCIFIX!!...THE CRUCIFIX...!",
+ "I DIDN'T NOTICE ABOUT THAT BEAUTIFUL CRUCIFIX!",
+ "LEAVE ME ALONE!, I'M WATCHING THE GAME",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HI BLIND MAN. HOW IT'S GOING?",
+ "HOW DO YOU KNOW I'M A FOREIGNER?",
+ "YOU LOOK BLIND. YOU'RE WEARING DARK GLASSES LIKE STEVIE WONDER",
+ "LOOK, I'M SORRY, I DIDN'T KNOW YOU COULD SEE",
+ "BUT HAVEN'T YOU JUST TOLD ME YOU WEREN'T BLIND",
+ "BUT IF YOU CAN'T SEE",
+ "OOOOKAY. SORRY. IN THAT CASE, HI THERE SIGHTLESS PERSON",
+ "I'M JOHN HACKER. YOU MUST BE ONE OF THOSE CHARACTERS WHO WILL HELP ME OUT IN EXCHANGE FOR AN OBJECT. AREN'T YOU? EH? AREN'T YOU?",
+ "UUUUM, EXCUSE ME FOR ASKING BLIN... SIGHTLESS PERSON! BUT WHAT SORT OF JOB IS THAT, TO GIVE SICKLES IN EXCHANGE FOR MONEY WHILE YOU PLAY THE ACCORDION?",
+ "AH YES, I SUPPOSE THAT'S TRUE. GOODBYE SIGHTLESS PERSON... BLIND MAN",
+ "HERE IS THE LARGE AMOUNT OF MONEY YOU ASKED ME FOR",
+ "YOU BETTER HAVE HAD",
+ "HI THERE FOREIGNER",
+ "AND HOW DO YOU KNOW I'M BLIND?",
+ "AND I'M NOT KIDDING YOU BUT YOUR'S ARE LIKE WOODY ALLEN'S",
+ "NO, I CAN'T SEE",
+ "AND I'M NOT",
+ "OH OF COURSE. JUST COS I CAN'T SEE, YOU ACCUSE ME OF BEING BLIND",
+ "HI THERE FOREIGNER! WHAT ARE YOU DOING IN TRANSYLVANIA?",
+ "THAT'S RIGHT, FOREIGNER. IN EXCHANGE FOR A LARGE SUM OF MONEY I'LL GIVE YOU A SICKLE FOR WHEN YOU MIGHT NEED IT",
+ "SHHHH, I'M A SICKLES TRADER, THAT'S WHY I HAVE TO HIDE",
+ "BECAUSE YOU TOLD ME BEFORE, DIDN'T YOU?",
+ "THANKS FOREIGNER. HERE'S THE SICKLE IN EXCHANGE. YOU'LL FIND IT REALLY USEFUL LATER ON, HONESTLY",
+},
+{
+ "",
+ "\250COMO VA TODO, IGOR?",
+ "\255SIEMPRE QUE HAY UN BUEN PARTIDO EN LA PARABOLICA PASA LO MISMO! EN FIN, IREMOS A VERLO AL BAR COMO DE COSTUMBRE",
+ "AHORA IGOR, ATIENDE. VAMOS A REALIZAR LA FASE 1 DE MI PLAN PARA CONQUISTAR EL MUNDO",
+ "PRIMERO CAPTAREMOS UNO DE LOS RAYOS DE LA TORMENTA Y LO DESMAGNETIZAREMOS CON NUESTRO INDIFIBULADOR. LA ELECTRICIDAD PASARA A MI MONSTRUO \255Y LE DARA VIDA! ",
+ "SI TODO SALE BIEN ESTE NO SERA MAS QUE EL PRIMERO DE UN INMENSO EJERCITO QUE CONQUISTARA EL MUNDO PARA MI, JA, JA, JA",
+ "LOS MONSTRUOS DESTRUIRAN TODAS LAS ARMAS DE TODOS LOS EJERCITOS DEL MUNDO, MIENTRAS NOSOTROS NOS REFUGIAMOS EN UNOS TERRENOS QUE HE COMPRADO EN GIBRALTAR",
+ "ENTONCES, DAREMOS UN GOLPE DE ESTADO, LOS GOBIERNOS DEL MUNDO NO TENDRAN CON QUE PROTEGERSE, Y PONDRAN SUS PAISES A MIS PIES",
+ "\255SERE EL PRIMER MALO EN LA HISTORIA QUE LO CONSIGA! \255JUA, JUA, JUA!",
+ "\255A TI NADA, IDIOTA! ESTOY EXPONIENDO LA TRAMA. BIEN \250ESTA TODO LISTO?",
+ "\255LLEGO EL MOMENTO, ENTONCES! \255DALE AL INTERRUPTOR DE LAS PILAS ALCALINAS! ",
+ "\255MALDITA SEA! \250QUE ES LO QUE HA PODIDO FALLAR?",
+ "\250SEGURO QUE LO REVISASTE BIEN Y NO FALTABA NADA? ULTIMAMENTE ESTAS CON ESO DE LA RENTA QUE NO VES UN PIJO A DOS METROS",
+ "\255IDIOTA, NO HABIAS CONECTADO EL INDIFIBULADOR! LOS TORNILLOS SE HABRAN MAGNETIZADO Y SE LE HABRA QUEMADO EL CEREBRO",
+ "ESTAS MUERTO, ESTAS MUERTO, COMO TE COJA...",
+ "\255A CALLAR! MA\245ANA IRE A POR OTRO CEREBRO Y REPETIREMOS EL EXPERIMENTO ",
+ "NO. ESTA VEZ TRAERE UNO DE MUJER, PARA QUE ESTE NUEVECITO Y SIN ESTRENAR. JA, JA, JA, QUE MALISIMA DE CHISTA",
+ "\250Y QUE? YO SOY EL MALO Y SOY TODO LO MACHISTA QUE QUIERA \250ENTENDIDO? Y COMO ME VUELVAS A RECHISTAR TE TRAGAS LA CHEPA ",
+ "JA, JA, JA. OTRO QUE HA CAIDO. AHORA VAS A PAGAR TU OSADIA DE QUERER ACABAR CONMIGO. \255IGOR, AL PENDULO DE LA MUERTE!",
+ "DIME, HUMANO ESTUPIDO, \250COMO ES QUE TE HA DADO POR QUERER DESTRUIRME? ",
+ "\255QUE BONITO!, ME PONDRIA A LLORAR SI NO FUERA PORQUE ME HACE GRACIA",
+ "A TU NOVIA LA NECESITO PARA QUE ME AYUDE CON SU CEREBRO A CONQUISTAR EL MUNDO",
+ "\255SI, JA! SE LO QUITARE Y SE LO PONDRE A MI FRUSKYNSTEIN, Y CON EL DOMINARE EL MUNDO, JA, JA, JA",
+ "\255\250QUE?! \255ESTAS MUERTO, ESTAS MUERTO! TE VOY A... ME HAS TOCADO LAS NARICES, VAMOS. \255PREPARATE A SER MATADO!",
+ "JA, JA, JA. QUE TE CREES TU ESO",
+ "SI, \250VERDAD? JA, JA, JA ",
+ "AH, ESTA BIEN, PUEDES FUMARTE EL ULTIMO CIGARRILLO, PERO DEPRISITA",
+ "APAGA YA ESE CIGARRILLO, ME TIENES HARTO YA",
+ "Y DIME, \250ESA POCION TIENE EL EFECTO CONTRARIO?",
+ "ESO YA LO VEREMOS...",
+ "BUENO, A VER SI ES VERDAD. IGOR, TRAE EL COMPACT DISC DE U\245AS ARRASCANDO UNA PIZARRA",
+ "ESO NI SO\245ARLO. LA CHICA SE QUEDA CONMIGO, Y TU TE QUEDAS AHI HASTA QUE EL PENDULO TE CORTE EL RODAJITAS. JA, JA, JA",
+ "PERO QUE MALO QUE SOY, VAMOS IGOR, VAMOS A PREPARAR LA POCION Y CONQUISTAR EL MUNDO",
+ "\250QUE PASA AHORA?",
+ "SI, \250QUE PASA?... \255ANDA, EL PARTIDO!",
+ "SE ME HABIA OLVIDADO. COGE A LA CHICA Y VAMONOS A VERLE. YA CONQUISTARE EL MUNDO DESPUES",
+ "GRACIAS MACHO, TENIA SED",
+ "\255ArgH! \255ESE CRUCIFIJO! \255ESE CRUCIFIJO!...",
+ "QUE BONITO ES ESE CRUCIFIJO, NO ME HABIA YO FIJADO",
+ "DEJAME, QUE ESTOY VIENDO EL FUTBOL",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Hola ciego. \250Que tal?",
+ "\250Como sabes que soy extranjero?",
+ "Pareces un ciego. Tienes gafas como serafin zubiri, hablas mirando al frente como Stevie Wonder...",
+ "Bueno, perdona. No sabia que vieses.",
+ "\250Pero no me acabas de decir que no eres ciego?",
+ "\255Pero si no ves!",
+ "Vaaaale. Perdona. En ese caso: Hola invidente.",
+ "Soy John Hacker, y estoy jugando al Drascula. Tu debes ser el tipico personaje que me ayudara a cambio de un objeto. \250A que si? \250Eh? \250A que si?",
+ "Em... Perdona que te pregunte cieg..\255Invidente!. Pero... \250Que clase de profesion es la tuya, de dar hoces a cambio de dinero, mientras tocas el acordeon?",
+ "Ah, si. Es verdad. Adios invidente...(ciego)",
+ "Ahi tienes la cuantiosa cantidad de dinero que me pediste.",
+ "Mas te vale.",
+ "Hola extranjero.",
+ "Y tu... \250Como sabes que soy ciego?",
+ "Y tu hablas como el hijo de Bill Cosby y no me meto contigo.",
+ "No, si no veo.",
+ "Y no lo soy.",
+ "\255Oh, claro! Como no veo se me tacha de ciego \250no?",
+ "\255Hola Extranjero! y \250que haces en Transilvania?",
+ "Correcto extranjero. A cambio de una cuantiosa suma de dinero, te dare una hoz, para cuando te haga falta.",
+ "Shhhhhh. Soy traficante de hoces, tengo que disimular.",
+ "Porque me lo has dicho antes \250no?",
+ "Gracias extranjero. Aqui tienes tu hoz a cambio. Un objeto que te sera muy util algo mas adelante... de verdad.",
+},
+{
+ "",
+ "WIE GEHTS, WIE STEHTS, IGOR ?",
+ "IMMER WENN auf kabel EIN GUTES SPIEL KOMMT, PASSIERT DAS GLEICHE. NAJA, DANN GUCKEN WIR ES UNS EBEN WIE IMMER IN DER KNEIPE AN",
+ "JETZT PASS AUF, IGOR. WIR WERDEN JETZT PHASE 1 MEINES WELTEROBERUNGSPLANS STARTEN.",
+ "Pah, einige GEWITTERBLITZE, die wir MIT dem VIBROXATOR ENTMAGNETISIEREN. und der strom wird meinem MONSTERCHEN leben einhauchen.",
+ "WENN ALLES KLAPPT WIRD ER DER ERSTE SOLDAT EINER RIESIGEN ARMEE SEIN, DIE DIE WELT FueR MICH EROBERN WIRD, HARHARHAR",
+ "DIE MONSTER WERDEN ALLE WAFFEN IN DER GANZEN WELT VERNICHTEN WaeHREND WIR UNS AUF UNSERE LaeNDEREIEN ZURueCKZIEHEN, DIE ICH UNS AUF HELGOLAND GEKAUFT HABE.",
+ "DANN WERDEN WIR EINEN STAATSSTREICH MACHEN UND DIE REGIERUNGEN DIESER WELT WERDEN AUFGEBEN UND SICH MIR ZU FueSSEN WERFEN",
+ "ICH WERDE DER ERSTE BoeSE IN DER GESCHICHTE SEIN, DER DAS SCHAFFT, HUAHUAHUA !",
+ "GAR NICHTS, IDIOT ! ICH ERZaeHLE DIE HANDLUNG .O.K . IST ALLES FERTIG ?",
+ "ES IST ALSO SOWEIT !DRueCK AUF DEN SCHALTER MIT DEN ALKALI-BATTERIEN !",
+ "VERFLIXT NOCHMAL ! WAS IST DA SCHIEFGELAUFEN ?",
+ "BIST DU SICHER, DASS DU ALLES GECHECKT HAST ? SEIT NEUESTEM DENKST DU NUR NOCH AN DEINE EINKOMMENSERKLaeRUNG UND KRIEGST NICHTS MEHR MIT",
+ "DU IDIOT !DU HAST DEN VIBROXITOR NICHT EINGESCHALTET !JETZT SIND DIE SCHRAUBEN MAGNETISIERT UND IHM WIRD WOHL DAS GEHIRN VERBRANNT SEIN",
+ "DU BIST EIN TOTER MANN, NA WARTE, WENN ICH DICH KRIEGE...",
+ "HALT DIE KLAPPE !MORGEN HOLE ICH EIN NEUES HIRN UND WIR WIEDERHOLEN DAS EXPERIMENT",
+ "NEIN, DIESMAL BESORG ICH EIN FRAUENHIRN, DASS NOCH GANZ FRISCH UND UNBENUTZT IST, HAR,HAR,HAR, SUPERJOKE !",
+ "NA UND ? ICH BIN DER BoeSE UND DER SUPER-MACHO ODER WAS ? UND WENN DU MIR NOCHMAL WIDERSPRICHST KANNST DU DEINEN BUCKEL SCHLUCKEN",
+ "HARHARHAR,SCHON WIEDER EINER. DU WARST SO DREIST, MICH UMBRINGEN ZU WOLLEN. DAS WIRST DU JETZT BueSSEN. IGOR! ZUM TODESPENDEL MIT IHM !",
+ "SAG MAL DU DUMMES MENSCHLEIN, WIESO WOLLTEST DU MICH ZERSToeREN ?",
+ "ACH WIE SueSS !ICH KoeNNTE GLATT ANFANGEN ZU HEULEN, WENN ES NICHT SO LUSTIG WaeRE",
+ "DEINE FREUNDIN BRAUCHE ICH NOCH, DAMIT SIE MIR MIT IHREM HIRN DABEI HILFT, DIE WELT ZU EROBERN",
+ "JA, HA !ICH WERDE ES RAUSREISSEN UND ES FRUNKSFENSTEIN GEBEN UND DANN WERDE ICH DIE WELT EROBERN,HARHARHAR",
+ "WAS ? !DU BIST EIN TOTER MANN! ICH WERDE DICH... DU HAST MICH VERaePPELT,GANZ KLAR . MACH DEIN TESTAMENT!",
+ "HARHARHAR, GLAUB DU DAS MAL ",
+ "JA, WIRKLICH ? HARHARHAR",
+ "JA, SCHON GUT, RAUCH DIR NOCH EINE LETZTE ZIGARETTE, ABER RUCKZUCK",
+ "MACH MAL DIE ZIGARETTE AUS. MIR IST SCHON SCHLECHT",
+ "UND SAG MAL, DIESE MISCHUNG HAT DIE GEGENWIRKUNG ?",
+ "DAS WERDEN WIR JA MAL SEHEN...",
+ "NA, MAL GUCKEN OB DAS STIMMT, IGOR., BRING MAL DIE CD MIT DEN DEM SOUND VON kratzenden FINGERNaeGELN AUF EINER SCHULTAFEL",
+ "NICHT IM TRAUM. DAS MaeDCHEN BLEIBT BEI MIR UND DU BLEIBST WO DU BIST, BIS DICH DAS PENDEL IN LECKERE SCHEIBCHEN SCHNEIDET, HARHAR",
+ "WIE BoeSE ICH DOCH BIN. KOMM IGOR, WIR BEREITEN DIE MISCHUNG ZU UND EROBERN DANN DIE WELT",
+ "WAS IST DENN JETZT WIEDER LOS ?",
+ "JA, WAS IST LOS ?...VERDAMMT, DAS SPIEL !",
+ "DAS HAB ICH GLATT VERGESSEN. NIMM DAS MaeDCHEN UND LASS UNS DAS SPIEL ANGUCKEN GEHEN . DIE WELT EROBERN WIR DANACH.",
+ "DANKE, ALTER, ICH HATTE DURST",
+ "ARGHH! DAS KRUZIFIX DA ! DAS KRUZIFIX !",
+ "WIE SCHoeN DAS KRUZIFIX DA IST, HAB ICH GAR NICHT BEMERKT",
+ "LASS MICH, ICH GUCK DOCH GERADE FUSSBALL",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Hallo Blinder. Wie gehts?",
+ "Woher weisst Du, dass ich nicht von hier bin ?",
+ "Du siehst wie ein Blinder aus . Du guckst beim Sprechen immer gerade aus, und dann diese Stevie-Wonder-Brille....",
+ "O.k,entschuldige. Ich dachte, du kannst nichts sehen",
+ "Aber hast Du mir nicht gerade gesagt, dass Du NICHT blind bist?",
+ "Ich denke, Du siehst nichts ?",
+ "Okaaay,okaay! Tut mir leid. Also wenn das so ist: Sehkranker ",
+ "Ich bin Heinz Hacker und spiele Drascula . Du bist bestimmt derjenige, der mir hilft und dafuer irgendwas haben will. Stimmts? Hae? Hab ich recht!?",
+ "aeh....Entschuldige die Frage, Blind-Sehkranker!Aber...Was hast Du fuer einen komischen Beruf, dass Du Sicheln verkaufst und dabei Akkordeon spielst!",
+ "Ach, klar, stimmt. Auf Wiedersehen Sehkranker...(Blinder)",
+ "Hier hast Du den Wahnsinnsbatzen Geld, um den Du mich gebeten hast",
+ "Das ist auch besser so!",
+ "Hallo Fremder!",
+ "Und Du...Woher willst Du wissen, dass ich blind bin?",
+ "Und Du bist der Sohn von Bill Cosby und ich werde mich nicht mit Dir anlegen",
+ "Nein, ich seh doch nichts!",
+ "Und ich bin es nicht",
+ "Na super! Nur weil ich nichts sehe bin ich direkt ein Blinder, oder was?",
+ "Hallo Fremder! Und was machst Du in Transylvanien?",
+ "Richtig, Fremder. Gegen einen Wahnsinnsbatzen Geld bekommst Du von mir eine Sichel damit Du eine hast, wenn Du eine brauchst.",
+ "Psssssst. Ich bin Sichel-Dealer, ich muss unentdeckt bleiben ",
+ "Warum hast Du mir das nicht vorher gesagt ?",
+ "Danke, Fremder. Hier hast du dafuer Deine Sichel. Sie wird Dir nachher noch nuetzlich sein...glaub mir !",
+},
+{
+ "",
+ "COMMENT VA TOUT, IGOR?",
+ "C'EST TOUJOURS LA M\322ME CHOSE QUAND IL Y A UN BON MATCH \267 LA PARABOLIQUE! ENFIN, ALLONS LE VOIR AU BAR, COMME D'HABITUDE",
+ "MAINTENANT, COUTE IGOR. NOUS ALLONS RALISER LA PHASE 1 DE MON PLAN POUR CONQURIR LE MONDE",
+ "D'ABORD, ON SAISIRA L'UNE DES FOUDRES DE L'ORAGE ET ON LA DMAGNTISERAIT AVEC l'INDIFUBULATEUR. LA COURANTE PASSERA DANS MON MONSTRE ET LUI DONNERA LA VIE!",
+ "SI TOUT VA BIEN CELUI-L\267 NE SERA QUE LE PREMIER D'UNE IMMENSE ARME QUE CONQURRA LE MONDE POUR MOI, HA! HA! HA! ",
+ "LES MONSTRES VONT ANANTIR TOUTES LES ARMES DE TOUTES LES ARMES DU MONDE, TANDIS QUE NOUS NOUS RFUGIONS DANS LES TERRAINS QUE J'AI ACHET \267 GIBRALTAR",
+ "ALORS, ON DONNERA UN COUP D'TAT. LES GOUVERNEMENTS DU MONDE N'AURONT PAS DE PROTECTION ET SES PAYS SERONT \267 MES PIEDS",
+ "JE SERAI LE PREMIER MALIN DE L'HISTOIRE \267 Y AVOIR RUSSI! -HOUA! HOUA! HOUA!",
+ "POUR TOI RIEN, IDIOT! JE PRSENTE LA TRAME. BIEN, TOUT EST PR\322T? ",
+ "LE MOMENT EST ARRIV\220, ALORS! -APPUIE DONC SUR L'INTERRUPTEUR DES BATTERIES ALCALINES! ",
+ "H\220LAS! QU'EST-CE QUE N'A PAS MARCH\220?",
+ "C'EST S\352R QUE TU L'AS BIEN R\220VIS\220 ET IL NE MANQUAIT RIEN? DERNI\324REMENT AVEC CETTE HISTOIRE DE LA RENTE TU N'Y VOIS GOUTTE",
+ "IDIOT! TU N'AVAIS PAS CONNECT\220 L'INFIBULATEUR! LES VIS SE SERONT MAGN\220TIS\220ES ET SA CERVELLE AURA BR\352L\220E",
+ "TU ES MORT, TU ES MORT, SI JE T'ATTRAPE...",
+ "TAIS-TOI! DEMAIN J'AURAI UNE AUTRE CERVELLE ET ON FERA L'ESSAI \267 NOUVEAU",
+ "NON, CETTE FOIS J'APPORTERAI UNE DE FEMME POUR QU'ELLE SOIT TOUTE NEUVE ET DE PREMI\324RE MAIN. HA! HA! HA! QUE MALIN DE XISTE",
+ "ET QUOI? JE SUIS LE MALIN ET TOUT LE SEXISTE QUE JE D\220SIRE, C'EST ENTENDU? SI TU ME R\220PLIQUES ENCORE JE TE FAIS ENGLOUTIR TA BOSSE",
+ "HA! HA! HA!. UN AUTRE QUI S'EST LAISS\220 PRENDRE. MAINTENANT TU PAIERAS CHER TON AUDACE DE VOULOIR EN FINIR AVEC MOI. -IGOR, AU PENDULE DE LA MORT!",
+ "DIS-MOI, HUMAIN STUPIDE, POURQUOI TU AS PENS\220 ME D\220TRUIRE? ",
+ "QUE C'EST BEAU! JE SANGLOTERAIS SI CE N'ETAIT PAS DR\342LE",
+ "J'AI BESOIN DE TA FIANC\220E POUR QU'ELLE M'AIDE \267 CONQU\220RIR LE MONDE AVEC SA CERVELLE",
+ "OUI, HA! JE LA LUI ARRACHERAI ET L'INSTALLERAI SUR MON FRUSKYNSTEIN, ET AVEC LUI JE VAIS MA\327TRISER LE MONDE, HA! HA! HA!",
+ "QUOI?! -TU ES MORT, TU ES MORT! JE VAIS TE... TU M'AS CASS\220 LE NEZ, ALLONS, -APPR\322TE-TOI \267 \322TRE TU\220!",
+ "HA! HA! HA! C'EST-CE QUE TU CROIS",
+ "OUI, N'EST-CE PAS? HA! HA! HA!",
+ "AH, C'EST BIEN! TU PEUX FUMER LA DERNI\324RE CIGARETTE, MAIS D\220P\322CHE-TOI!",
+ "\220TEINS D\220J\267 CETTE CIGARETTE, J'EN A RAS LE BOL!",
+ "ET DIS-MOIS, CETTE POTION, A-T-ELLE L'EFFET CONTRAIRE?",
+ "ON VERRA \200A...",
+ "EH BIEN, ON VERRA SI C'EST VRAI. IGOR, APPORTE LE COMPACT DISC D'ONGLES GRATTANT UN TABLEAU",
+ "N'Y PENSES PAS. LA FILLE RESTE AVEC MOI, ET TOI TU RESTERAS L\267 JUSQU'\267 QUE LA PENDULE TE COUPE EN PETITES TRANCHES. HA! HA! HA!",
+ "MAIS QUE JE SUIS MALIN. ON Y VA, IGOR, ALLONS PR\220PARER LA POTION ET CONQU\220RIR LE MONDE",
+ "QU'Y A-T-IL MAINTENANT?",
+ "OUI, QU'Y A-T-IL?... -TIENS, LE MATCH!",
+ "JE L'AVAIS OUBLI\220. PRENDS LA FILLE ET ALLONS LE VOIR. J'IRAI CONQU\220RIR LE MONDE PLUS TARD",
+ "MERCI MON VIEUX, J'AVAIS SOIF",
+ "ArgH! CE CRUCIFIX! -CE CRUCIFIX!...",
+ "C'EST BEAU CE CRUCIFIX, JE NE M'AVAIS PAS RENDU COMPTE",
+ "FICHE-MOI LA PAIX! JE REGARDE LE FOOT-BALL",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "BONJOUR, L'AVEUGLE. A VA?",
+ "POURQUOI TU SAIS QUE JE SUIS UN TRANGER?",
+ "TU PARAT UN AVEUGLE. TU AS DES LUNETTES COMME SERAFIN ZUBIRI ET TU PARLES EN REGARDANT DEVANT TOI, COMME STEVIE WONDER...",
+ "BON, EXCUSE-MOI. JE NE SAVAIS PAS QUE TU PUISSES VOIR.",
+ "MAIS, TU NE VIENS PAS DE ME DIRE QUE TU N'EST PAS AVEUGLE?",
+ "MAIS TU NE VOIS PAS!",
+ "A VA, A VA.... PARDONNE-MOI. DANS CE CAS-L: BONJOUR AVEUGLE.",
+ "JE SUIS JOHN HACQUER ET JE JOUE AU DRASCULA. TU ES SREMENT LE TYPIQUE PERSONNAGE QUI VA M'AIDER EN TROC D'UN OBJET. D'ACCORD? H? D'ACCORD?",
+ "EUH... AVEUGLE, UNE QUESTION! MAIS... QUEL GENRE DE MTIER C'EST LE TIEN? CELUI D'CHANGER DE FAUCILLES CONTRE DE L'ARGENT EN JOUANT DE L'ACCORDON?",
+ "AH, OUI! C'EST VRAI. AU REVOIR AVEUGLE...",
+ "VOIL LA GROSSE SOMME D'ARGENT QUE TU M'AS DEMANDE.",
+ "IL TE VAUX MIEUX.",
+ "BONJOUR, TRANGER!",
+ "ET TOI... COMMENT TU SAIS QUE JE SUIS UN AVEUGLE?",
+ "ET TOI TU PARLES COMME LE FILS DE BILL COSBY ET MOI, JE NE T'EMBTE PAS.",
+ "NON, SI JE NE VOIS PAS.",
+ "ET MOI, JE NE LE SUIS PAS.",
+ "OH, BIEN SR! COMME JE NE VOIS PAS ON ME TCHE D'AVEUGLE, N'EST-CE PAS",
+ "BONJOUR, TRANGER! ET QU'EST-CE QUE TU FAIS EN TRANSYLVANIE?",
+ "C'EST CORRECT, TRANGER. POUR UNE GROSSE SOMME D'ARGENT, JE TE DONNERAI UNE FAUCILLE, POUR QUAND TU EN AURAS BESOIN.",
+ "CHUT! JE SUIS UN TRAFICANT DE FAUCILLES, JE DOIS ME CACHER.",
+ "PARCE QUE TU ME L'AS DIT AVANT, N'EST-CE PAS?",
+ "MERCI TRANGER. VOIL TA FAUCILLE EN CHANGE. UNE CHOSE QUI SERA TRS PRATIQUE POUR TOI, PLUS TARD... VRAIMENT.",
+},
+{
+ "",
+ "COME VA, IGOR?",
+ "-SEMPRE CHE C' UNA BUONA PARTITA SUCCEDE LO STESSO! BENE, ANDREMO A GUARDARLA AL BAR, COME SEMPRE",
+ "ADESSO IGOR, ASCOLTA. ANDIAMO A REALIZZARE LA FASE 1 DEL MIO PROGETTO PER CONQUISTARE IL MONDO",
+ "ATTRARREMO UN FULMINo DELLA TEMPESTA E LO DISMAGNETIZZAREMO CON L'INDIFIBULATORE. LA ELETTRICIT\265 ANDR\265 AL MIO MOSTRO E, GLI DAR\265 VITA!",
+ "SE TUTTO VA BENE QUESTO SAR\265 SOLTANTO IL PRIMO DI UN'IMMENSO ESERCITO CHE CONQUISTAR\265 IL MONDO PER ME, HA,HA,HA",
+ "I MOSTRI DISTRUGGERANNO TUTTE LE ARME DI TUTTI GLI ESERCITI DEL MONDO, MENTRE NOI CI RIFURGIAREMO nei miei terreni A GIBRALTAR",
+ "POI, FAREMO UN GOLPE, E I GOVERNI DEL MONDO NON AVRANNO PER DIFENDERSI, E AVR\220 LE LORO NAZIONI SOTTO I MIEI PIEDI",
+ "SAR\220 IL PRIMO CATTIVO DELLA STORIA CHE RIESCA!",
+ "A TE NIENTE, SCIOCCO! ST\220 SPORRENDO LA TRAMA. BENE, TUTTO A POSTO?",
+ "-\220 IL MOMENTO! -PREMI L'INTERRUTTORE DELLE BATTERIE ALCALINE!",
+ "- PORCA MISERIA! -CHE COSA NON \220 ANDATA BENE?",
+ "SEI SICURO DI AVERLO CONTROLLATO BENE? E NO MANCABA NIENTE? ULTIMAMENTE PER I REDDITI NON VEDI UNA MADONNA",
+ "IMBECILE!, NON HAI CONETTATO L'INDIFIBULATORE! LE VITI SARANO MAGNETIZZATE E ADESSO AVR\265 IL CERVELLO BRUCIATO",
+ "SEI MORTO, SEI MORTO, COME TI PRENDA..",
+ "STAI ZITTO! DOMANI CERCHER\220 UN ALTRO CERVELLO E RIPETEREMO L'ESPERIMENTO",
+ "NO. QUESTA VOLTA NE PORTER\220 UNO DI DONNA, COS\326 SAR\265 NUOVISSIMO, MAI UTILIZZATO. HA, HA HA, CHE BARZELLETA FALLITA",
+ "E? SONO IL CATTIVO DELLA STORIA, E SONO MASCHILISTA SE VOGLIO, CAPITO? E NON LAMENTARTI UNA ALTRA VOLTA PERCHE MANGERAI LA TUA GOBBA",
+ "HA,HA,HA. UN ALTRO PRESSO. ADESSO PAGHERAI MOLTO CARO QUESTA OFFESA, LA TUA INTENZIONE DI FINIRE CON ME. -IGOR, AL PENDOLO DELLA MORTE!",
+ "DIMI, STUPIDO UMANO, COME MAI HAI PENSATO A DISTRUGGERMI?",
+ "-CHE BELLO!, MI METTEREI A PIANGERE SE NON FOSSE PERCHE MI FA RIDERE",
+ "HO BISOGNO DELLA TUA RAGAZZA, IL SUO CERVELLO MI AIUTER\265 A CONQUISTARE IL MONDO",
+ "-SI, HA ! VADO A TOGLIARSILO PER METTEGLIELO AL MIO FRUSKYNSTEIN, E CON LUI DOMINER\220 IL MONDO, HA,HA,HA",
+ "CHE?! - SEI MORTO, SEI MORTO! TI VADO A...MI HAI FATTO ARRABBIARE. SEI PRONTO PER MORIRE?",
+ "HA,HA,HA. TU CREDI?",
+ "SI, VERO? HA,HA,HA",
+ "VA BENE, PUOI FUMARE LA ULTIMA SIGARETTA, MA SBRIGATI",
+ "SONO STUFFO, BUTTA GI\265 LA SIGARETTA!",
+ "E DIMI, QUELLA POZIONE HA L'EFFETTO INVERSO?",
+ "QUELLO SI VEDR\265 ..",
+ "BENE, SAR\265 VERO?. IGOR, DAMI IL COMPACT DISC DI UNGHIE GRAFFIANDO UNA LAVAGNA",
+ "NEANCHE SOGNARLO. LA RAGAZZA RIMANE CON ME, E TU RIMANI LI FINO CHE IL PENDOLO TI TAGLII IN FETTE. HA,HA,HA",
+ "MA COME SONO CATTIVO, ANDIAMO IGOR, ANDIAMO A FARE LA POZIONE, ANDIAMO A CONQUISTARE IL MONDO",
+ "ADESSO CHE SUCCEDE?",
+ "SI, CHE C'E?....LA PARTITA!",
+ "L'AVEVO DIMENTICATA. PRENDI LA RAGAZZA E ANDIAMO A GUARDARE IL CALCIO. CONQUISTER\220 IL MONDO DOPO",
+ "GRAZIE AMICO, AVEVO SETE",
+ "-ARGH! -QUEL CROCIFISSO! -QUEL CROCIFISSO!...",
+ "QUE BELLO \220 QUEL CROCIFISSO, NON MI ERO ACCORTO",
+ "LASCIAMI, ST\220 GUARDANDO LA PARTITA",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Ciao cieco. Come va?.",
+ "Come sai che sono straniero.",
+ "Sembri un cieco. Hai gli occhiali come il cieco di Sorrento, parli guardando all'infinito come Stevie Wonder..",
+ "Bene, scusa. Non sapevo che non vedessi",
+ "Ma non mi hai appena detto che non sei cieco?.",
+ "- Ma se non vedi!.",
+ "Beeeene. Scusa. Allora: Ciao : non vedente",
+ "Sono John Hacker, st giocando al Drascula. Tu devi proprio essere il tipico personaggio che mi aiuter in cambio di un oggeto. Vero...?",
+ "Ma... Scusa ciec..- non vedente! .Ma.. . che tipo di mestiere il tuo, di dare falci per soldi, mentre suoni la fisarmonica?.",
+ "Ah, si. \324 vero. Ciao non vedente....(cieco)",
+ "Ecco la abbondante quantit di soldi che mi avevi chiesto.",
+ "Mi raccomando",
+ "Ciao straniero.",
+ "E tu... Come sai che sono cieco?",
+ "E tu parli come il figlio di Bill Cosby e non ti offendo.",
+ "No, se non vedo.",
+ "E non lo sono.",
+ "-Oh, certo!. Come non vedo mi chiamano cieco, no?.",
+ "-Ciao Straniero! e cosa fai in Transilvania?",
+ "Corretto straniero. Per una abbondante quantit di soldi, ti dar in cambio una falce, per quando ne avrai bisogno.",
+ "Shhhhhh. Sono trafficante di falci, devo proprio dissimulare.",
+ "Perche mi lo hai detto prima, no?",
+ "Grazie straniero. Ecco la tua falce. Un oggeto che ti sar molto utile pi avanti...... davvero.",
+},
+};
+
+const char *_textb[][15] = {
+{
+ "",
+ "I'M HERE, DRINKING",
+ "THEY ARE ALL DEAD, THANKS. BURPP...",
+ "YES, SURE...",
+ "SHE FEELS ATTRACTED TO UNCLE DESIDERIO",
+ "EVEN BETTER, UNCLE DESIDERIO'S DEAD BODY",
+ "MY UNCLE. HE WENT TO CASTLE AND NEVER CAME BACK",
+ "WELL, HE CAME BACK JUST A LITTLE. IF ONLY VON BRAUN HADN'T SCREWED THINGS UP MY UNCLE WOULD BE DRINKING WITH US NOW",
+ "NOTHING...",
+ "WELL, YES !. THAT MEAN MAN HAS TERRIFIED US ALL",
+ "FROM TIME TO TIME HE COMES DOWN TO THE VILLAGE AND TAKES SOMEONE WITH HIM.",
+ "A LITTLE WHILE AFTER WE JUST A FEW FOUND BODY PARTS. I THINK HE IS DEALING WITH ORGANS OR SOMETHING LIKE THAT",
+ "THE ONLY PERSON IN THE VILLAGE WHO KNOWS HOW TO END UP WITH DRASCULA IS A CULTIVATED PERSON",
+ "HE LIVES IN A LOG-CABIN OUT OF TOWN, EVER SINCE DRASCULA BEAT HIM UP",
+ "HE IS THE ONLY ONE WHO COULD HELP US WITH DRASCULA, AND HE DOESN'T WANT TO HEAR ABOUT US. HOW DO YOU LIKE THAT?",
+},
+{
+ "",
+ "AQUI, BEBIENDO",
+ "MUERTOS TODOS. GRACIAS. BURRP ",
+ "SI, NO VEAS... ",
+ "ESTA POR EL TIO DESIDERIO",
+ "Y ESTA OTRA, POR EL CADAVER DEL TIO DESIDERIO",
+ "MI TIO. FUE AL CASTILLO Y NO VOLVIO",
+ "BUENO, VOLVIO PERO POCO. SI EL VON BRAUN NO HUBIESE METIDO LA PATA MI TIO ESTARIA AQUI BEBIENDO",
+ "NADA... ",
+ "\255BUENO, SI! ESE DESALMADO NOS TIENE ATEMORIZADOS A TODOS",
+ "DE VEZ EN CUANDO BAJA AL PUEBLO Y SE LLEVA A ALGUIEN",
+ "POCO DESPUES SOLO ENCONTRAMOS UNOS POCOS RESTOS. CREO QUE ESTA TRAFICANDO CON ORGANOS, O ALGO ASI",
+ "EL UNICO DEL PUEBLO QUE SSABE COMO ACABAR CON DRASCULA TIENE ESTUDIOS",
+ "DESDE QUE LE DERROTO DRASCULA SE HA APARTADO A UNA CABA\245A EN LAS AFUERAS DEL PUEBLO",
+ "ES EL UNICO QUE PODRIA AYUDARNOS A ACABAR CON DRASCULA, Y NO QUIERE SABER NADA DE NOSOTROS. \250QUE TE PARECE A TI?",
+},
+{
+ "",
+ "HIER, BEI EINEM GUTEN TROPFEN",
+ "ALLE TOT. VIELEN DANK. RueLPS !",
+ "YO, STIMMT...",
+ "DIE HIER IST FueR ONKEL DESIDERIUS",
+ "UND DIESE HIER FueR DIE LEICHE VON ONKEL DESIDERIUS",
+ "MEIN ONKEL. ER GING ZUM SCHLOSS UND KAM NICHT ZURueCK",
+ "NAJA, ER KAM NUR IN RESTEN ZURueCK. WENN VON BRAUN SICH NICHT VERTAN HaeTTE, WueRDE ER JETZT MIT UNS EINEN HEBEN",
+ "NICHTS...",
+ "JA STIMMT! DIESER SCHURKE JAGT UNS ALLEN EINE RIESENANGST EIN",
+ "AB UND ZU GEHT ER RUNTER INS DORF UND HOLT SICH JEMANDEN",
+ "KURZ DANACH HABEN WIR NUR NOCH RESTE GEFUNDEN, ICH GLAUBE ER HANDELT MIT ORGANEN ODER SO",
+ "DER EINZIGE, DER MIT DRASCULA FERTIGWERDEN KANN, WAR AN DER UNI ",
+ "SEITDEM DRASCULA IHN BESIEGT HAT, LEBT ER IN EINER EINSAMEN HueTTE AUSSERHALB DES DORFES",
+ " ER IST DER EINZIGE, DER DRASCULA ERLEDIGEN KoeNNTE UND WILL NICHTS VON UNS WISSEN. WAS HaeLST DU DAVON ?",
+},
+{
+ "",
+ "ICI, EN BUVANT",
+ "TOUS MORTS. MERCI. BOURRP",
+ "OUI, VRAIMENT...",
+ "CELLE-CI POUR L'ONCLE DSIR",
+ "ET CELLE-L\267 POUR LE CADAVRE D'ONCLE DSIR",
+ "MON ONCLE EST ALL AU CH\266TEAU ET N'EST PAS ENCORE REVENU",
+ "BON, IL EST REVENU MAIS POUR PEU DE TEMPS. SI VON BRAUN N'AURAIT FAIT UN IMPAIR, MON ONCLE DSIR SERAIT ICI EN BUVANT",
+ "RIEN... ",
+ "EH OUI! CE MALIN NOUS A INTIMIDS \267 TOUS",
+ "DE FOIS IL DESCEND SUR LE VILLAGE ET ENLEVE QUELQU'UN",
+ "UN PEU PLUS TARD ON NE TROUVE QUE QUELQUES RESTES. JE PENSE QU'IL FAIT DU TRAFIQUE D'ORGANES, OU QUELQUE CHOSE PAREILLE",
+ "LE SEUL DU VILLAGE QUI SAIT COMMENT FINIR AVEC DRASCULA IL A DES \220TUDES",
+ "DEPUIS QUE DRASCULA L'A VAINCU, IL S'EST RETIR\220 DANS UNE CABANE, EN DEHORS DU VILLAGE",
+ "C'EST LE SEUL QUI POURRAIT NOUS AIDER \267 FINIR AVEC DRASCULA ET LUI NE VEUX RIEN SAVOIR DE NOUS. QU'EN PENSES-TUI?",
+},
+{
+ "",
+ "QU\326, BEVENDO",
+ "MORTI TUTTI. GRAZIE. BURRP",
+ "SII, CERTO, SICURO..",
+ "QUESTA PER IL ZIO PEPPINO",
+ "E QUEST'ALTRA, PER IL CADAVERE DEL ZIO PEPPINO",
+ "MIO ZIO. FU ANDATO AL CASTELLO, E NON MAI TORNATO",
+ "EEEHH, TORN\220, MA PER POCO TEMPO. SE IL VON BRAUN NON AVESSE SBAGLIATO, MIO ZIO SAREBBE QU\326 BEVENDO",
+ "NIENTE..",
+ "EEH,SI! QUEL MALVAGIO CI HA INTIMORATI",
+ "A VOLTE SCENDE AL PAESE E QUANDO SE NE VA SI PORTA QUALCUNO",
+ "UN P\220 DOPO SOLTANTO TROVIAMO QUALQUE RESTO. CREDO CHE TRAFFICA ORGANI O QUALCOSA DEL GENERE",
+ "L'UNICO DEL PAESE CHE SA COME FINIRE CON DRASCULA \220 UNO CHE HA STUDIATO",
+ "DA CHE FU SCONFFIGIATO DA DRASCULA SI \220 ALLONTANATO A UNA CAPANNA FUORI DEL PAESE",
+ "L'UNICO CHE POTREBBE AIUTARCI A VINCERE DRASCULA, E NON VUOLE SAPERE NIENTE DI NOI. COSA PENSI?",
+},
+};
+
+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 STRONG NOISE DOWN THE CORRIDOR",
+ "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",
+ "I WAS GOING TO GIVE YOU THE KISS OF LIFE BUT IT WASN'T NECESSARY BECAUSE YOU STARTED TO TALK",
+ "YOU SAID SOMETHING ABOUT A SCARECROW. I WAS VERY SCARED, YOU KNOW. IT'S A REAL SHOCK WHEN A DEAD PERSON STARTS TALKING RIGHT?",
+ "ISN'T THAT RIGHT? WELL, THEN I MANAGED TO BRING YOU TO MY ROOM THE BEST WAY I COULD. I PUT YOU IN BED... AND THAT'S ALL... HA, HA, HA...",
+ "OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEEPED 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, THANKS GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO SEE THE FOOTBALL GAME",
+ "YES, IT'S TRUE. PLEASE, SET ME FREE",
+ "NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO LIBERATE WHILE YOU LET ME DOWN",
+ "JOHNNY, IS THAT YOU? OH, GOD, GREAT! I KNEW YOU'D COME!",
+ "YOU DON'T EVEN KNOW HOW MUCH THAT EVIL DRASCULA HAS MADE ME SUFFER",
+ "FIRSTLY HE BROUGHT ME FLYING OVER HER AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT EVEN A MIRROR OR ANYTHING",
+ "I'M TELLING YOU! AND THE WORSE PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE",
+ "JHONNY 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...",
+ "\"DEAR JOHNNY\"",
+ "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",
+ "I HOPE THERE WON'T BE HARD FEELINGS BETWEEN US. REMEMBER THAT I STILL LOVE YOU, BUT ONLY AS A FRIEND",
+},
+{
+ "",
+ "\250ESTA USTED BIEN? OIGA, DESPIERTE. \250ME OYE? \250ESTA USTED MUERTO?",
+ "NO, MI NOMBRE ES BILLIE JEAN, PERO PUEDES LLAMARME B.J. ES MAS CORTO",
+ "\255JI, JI! \255QUE BUENO!",
+ "PUES VERAS JOHNY, YO ESTABA AQUI, DISPUESTA A ACOSTARME, CUANDO OI UN FUERTE GOLPE EN EL PASILLO",
+ "AL PRINCIPIO NO LE DI MUCHA IMPORTANCIA, PERO A LAS DOS HORAS MAS O MENOS DESCUBRI QUE NO PODIA DORMIR Y DECIDI SALIR A DAR UN PASEO",
+ "Y CUAL NO SERIA MI SORPRESA CUANDO ABRI LA PUERTA Y TE ENCONTRE AHI, EN EL SUELO TIRADO. TE LO JURO QUE PENSE QUE HABIAS MUERTO, JE, JE, TONTA DE MI",
+ "TE FUI A HACER EL BOCA A BOCA, PERO NO FUE NECESARIO PORQUE EMPEZASTE A HABLAR",
+ "DECIAS NO SE QUE DE UN ESPANTAPAJAROS. YO ME LLEVE UN SUSTO MUY GORDO, PORQUE CUANDO UN MUERTO SE PONE A HABLAR ES UNA IMPRESION MUY FUERTE, \250NO CREES?",
+ "\250VERDAD QUE SI? BUENO, PUES COMO PUDE, CARGUE CONTIGO Y TE TRAJE A MI HABITACION. TE PUSE SOBRE LA CAMA... Y ESO ES TODO. JI, JI,JI",
+ "OH, NO HA SIDO EL GOLPE, JI, JI. ES QUE SIN QUERER PISE TUS GAFAS",
+ "\255HAY QUE VER QUE BIEN LE SIENTAN LAS GAFAS! YA SE QUE NO ES FERNANDO LANCHA, PERO TIENE UN NO SE QUE QUE QUE SE YO",
+ "SI, SI, QUIERO... VAMOS, ABRAZAME FUERTE, BESAME MUCHO...",
+ "OH JOHNY, CARI\245O, MENOS MAL QUE HAS VENIDO. ESE DESALMADO DE DRASCULA ME HA ATADO A LA CAMA Y LUEGO SE HA IDO ABAJO A VER EL PARTIDO",
+ "SI, ES VERDAD. LIBERAME ",
+ "NO, LO SIENTO. GASTE TODAS EN LA MAZMORRA INTENTANDO LIBERARME MIENTRAS TU ME DEJABAS TIRADA",
+ "JOHNY \250ERES TU? \255QUE ALEGRIA! \255SABIA QUE VENDRIAS!",
+ "NO SABES CUANTO ME HA HECHO SUFRIR ESE DESALMADO DE DRASCULA",
+ "PRIMERO ME TRAJO VOLANDO HASTA AQUI Y LUEGO ME ENCERRO EN ESTE CUARTUCHO, SIN ESPEJO NI NADA",
+ "COMO LO OYES. Y LO PEOR ES QUE NO PIDIO PERDON NI UNA SOLA VEZ",
+ "JOHNY, QUERIDO. \250DONDE ESTAS?",
+ "ESTOY LISTA PARA QUE ME SAQUES DE AQUI",
+ "ESPERA QUE VOY A MIRAR... NO CARI\245O, LO SIENTO",
+ "TOMA...",
+ "\"QUERIDO JOHNY:",
+ "NUNCA PODRE OLVIDARTE, PERO ME HE DADO CUENTA DE QUE LO NUESTRO NO FUNCIONARIA. VOY A SER SINCERA CONTIGO: HAY OTRO HOMBRE; MAS ALTO, MAS FUERTE...",
+ "Y ADEMAS ME HA RESCATADO DE LAS MANOS DE DRASCULA. ME HA PEDIDO EN MATRIMONIO, Y YO HE ACEPTADO",
+ "ADIOS, JOHNY. NO INTENTES DARLE UNA EXPLICACION, PORQUE EL AMOR ES CIEGO Y NO ATIENDE A RAZONES",
+ "ESPERO QUE NO ME GUARDES RENCOR, Y RECUERDA QUE TE SIGO QUERIENDO, AUNQUE SOLO COMO AMIGO\"",
+},
+{
+ "",
+ "HALLO, ALLES KLAR ?HEY, WACHEN SIE AUF. HoeREN SIE MICH ? SIND SIE TOT ?",
+ "NEIN, ICH HEISSE BILLIE JEAN., ABER DU KANNST MICH B.J. NENNEN, DAS IST KueRZER",
+ "HI,HI! SUPERGUT !",
+ "JA STELL DIR VOR, HEINZ, ICH WOLLTE MICH HIER GERADE HINLEGEN, ALS ICH EINEN LAUTEN KNALL IM FLUR HoeRTE",
+ "ANFANGS HAB ICH NICHT SO DRAUF GEACHTET, ABER NACHDEM ICH 2 STUNDEN LANG NICHT SCHLAFEN KONNTE, GING ICH RUNTER, UM SPAZIERENZUGEHEN",
+ "ICH WAR NATueRLICH BAFF, ALS ICH DICH VOR der tuer LIEGEN SAH. ICH HABE ECHT GEDACHT,DASS DU TOT BIST, HEHE, WIE bloed"
+ "ICH WOLLTE GERADE MUND-ZU-MUND BEATMUNG MACHEN, ABER DANN FINGST DU JA AN ZU REDEN",
+ "DU FASELTEST WAS VON NER VOGELSCHEUCHE UND ICH Hatte ganz schoen schiss,WEIL sprechende tote schon echt UNHEIMLICH sind?",
+ "NICHT WAHR ?NAJA,ICH HABE DICH DANN AUFGEHOBEN UND IN MEIN ZIMMER GETRAGEN UND AUF MEIN BETT GELEGT.... WEITER NICHTS. HI,HI,HI",
+ "ACH NEIN, ES WAR NICHT DIE BEULE, HIHI, ICH BIN VERSEHENTLICH AUF DEINE BRILLE GETRETEN ",
+ "MAN MUSS SICH ECHT MAL ANGUCKEN, WIE GUT IHM DIE BRILLE STEHT. ER IST ZWAR NICHT DER MARTINI-MANN, ABER ER HAT WAS WEISS ICH WAS",
+ "JA, JA, ICH WILL. KOMM NIMM MICH UND KueSS MICH...",
+ "OH HEINZ, LIEBLING, GUT DASS DU DA BIST. DIESER WueSTLING VON DRASCULA HAT MICH ANS BETT GEFESSELT UND IST DANN RUNTER UM SICH DAS SPIEL ANZUSEHEN",
+ "JA, WIRKLICH. BEFREIE MICH",
+ "NEIN, TUT MIR LEID. ICH HAB ALLE BEIM VERSUCH, AUS DEM VERLIES AUSZUBRECHEN, AUFGEBRAUCHT",
+ "HEINZ, BIST DU ES ? WIE TOLL ! ICH WUSSTE, DASS DU KOMMEN WueRDEST !",
+ "DU AHNST JA NICHT, WIE SEHR ICH WEGEN DIESEM UNGEHEUER VON DRASCULA GELITTEN HABE",
+ "ZUERST IST ER MIT MIR HIERHER GEFLOGEN UND DANN HAT ER MICH IN DIESES LOCH GESPERRT, OHNE SPIEGEL UND GAR NICHTS",
+ "WIE ICHS GESAGT HABE. DAS SCHLIMMSTE IST,DASS ER SICH KEIN EINZIGES MAL ENTSCHULDIGT HAT.",
+ "HEINZ, GELIEBTER, WO BIST DU ?",
+ "ICH BIN BEREIT, VON DIR GERETTET ZU WERDEN",
+ "WARTE, ICH GUCK MAL...NEIN, SCHATZ, TUT MIR LEID",
+ "HIER NIMM...",
+ "LIEBER HEINZ !",
+ "ICH WERDE DICH NIE VERGESSEN, aber das mit uns funktioniert nicht.ICH gebs zu : ES GIBT EINEN ANDERN. GRoeSSER,STaeRKER...",
+ "UND AUSSERDEM HAT ER MICH AUS DRASCULAS KLAUEN BEFREIT UND UM MEINE HAND ANGEHALTEN,UND ICH HABE JA GESAGT",
+ "LEB WOHL,HEINZ. VERSUCH NICHT EINE ERKLaeRUNG ZU FINDEN, DENN DIE LIEBE IST BLIND UND KENNT KEINE VERNUNFT",
+ "DU BIST MIR HOFFENTLICH NICHT BoeSE. DENK IMMER DARAN DASS ICH DICH IMMER NOCH LIEBE, WENN AUCH NUR ALS FREUND",
+},
+{
+ "",
+ "VOUS ALLEZ BIEN? ALLEZ, REVEILLEZ-VOUS! VOUS M'ENTENDEZ? VOUS \322TES MORT?",
+ "NON, MON NOM EST BILLIE JEAN, MAIS TU PEUX M'APPELLER B.J., C'EST PLUS COURT",
+ "HI! HI! -C'EST BON!",
+ "EN VRIT JOHNY, J'TAIS L\267, PR\322TE \267 ME COUCHER, ET J'AI ENTENDU UN FORT COUP DANS LE COULOIR",
+ "AU DBUT JE N'Y AI PAS DONN D'IMPORTANCE, MAIS APR\324S JE ME SUIS RENDUE COMPTE QUE NE POUVAIS PAS M'ENDORMIR ET SUIS SORTIE FAIRE UNE PROMENADE",
+ "ET \267 MON GRAN TONNEMENT, QUAND J'AI OUVERT LA PORTE, JE T'AI TROUV L\267, PAR TERRE. J'TAIS SUR LE POINT DE PENSER QUE TU AVAIS MORT, HE!, QUE JE SUIS B\322TE!",
+ "J'ALLAIS TE FAIRE LE BOUCHE-\267-BOUCHE MAIS IL N'A T PAS NCESSAIRE PUISQUE TU AS COMMENC \267 PARLER",
+ "TU DISAIS \267 SAVOIR QUOI D'UN POUVANTAIL. CELA M'A FAIT UNE GRANDE PEUR, PARCE QUE QUAND UN MORT SE MET \267 PARLER L'IMPRESSION EST TR\324S FORTE, NE CROIS-TU PAS?",
+ "C'EST VRAI, NON? ENFIN. JE ME SUIS DBROUILLE POUR TE PRENDRE SUR MOI, T'EMMENER DANS MA CHAMBRE ET T'INSTALLER SUR LE LIT... ET VOIL\267 TOUT. HI! HI! HI!",
+ "HO! CE N'EST PAS \267 CAUSE DU COUP, HI! HI! CE QUE J'AI MARCHE SUR TES LUNETTES PAR ACCIDENT",
+ "\220VIDEMMENT LES LUNETTES LUI FONT DU BIEN! JE SAIS BIEN QUIL N'EST PAS FERNANDO LANCHA, MAIS IL A UN AIR QU'ALLEZ DONC SAVOIR",
+ "OUI, OUI, JE VEUX... VAS-Y, EMBRASSE-MOI FORT, EMBRASSE-MOI BEAUCOUP...",
+ "OH,JOHNY!, MON AMOUR! HEUREUSEMENT QUE TU ES VENU. CE M\220CHANT DRASCULA M'A ATTACH\220 AU LIT ET APR\324S IL EST PARTI EN BAS VOIR LE MATCH",
+ "OUI, C'EST VRAI, LIB\324RE-MOI",
+ "NON, SUIS D\220SOL\220E. JE LES AI TOUTES UTILIS\220ES, DANS LE CACHOT, EN T\266CHANT DE ME LIB\220RER ALORS QUE TOI TU M'ABANDONNAIS",
+ "JOHNY, C'EST TOI? -QUELLE JOIE! -JE SAVAIS QUE TU VIENDRAIS!",
+ "TU NE PEUX PAS SAVOIR COMBIEN M'A FAIT SOUFFRIR CE M\220CHANT DRASCULA",
+ "D'ABORD IL M'EMMEN\220 EN VOLANT JUSQU'ICI ET APR\324S IL M'ENFERM\220E DANS CE TAUDIS, SANS MIROIR NI RIEN D'AUTRE",
+ "COMME TU L'ENTENDS. ET LE PIRE C'EST QUIL NE M'A PAS DEMAND\220 PARDON N'UNE SEULE FOIS ",
+ "JOHNY, MON CH\220RI, O\353 EST-CE QUE TU ES?",
+ "JE SUIS PR\322TE POUR QUE TU M'EN SORTES D'ICI",
+ "ATTEND, JE VAIS REGARDER... NON CH\220RI, JE REGRETTE",
+ "TIENS...",
+ "\"CHER JOHNY",
+ "JAMAIS JE T'OUBLIERAI, MAIS JE ME SUIS APER\200UE QUE NOTRE AFFAIRE NE POUVAIT PAS MARCHER. JE VAIS \322TRE SINC\324RE AVEC TOI: IL Y A UN AUTRE HOMME, PLUS GRAND...",
+ "ET ENCORE IL M'A LIB\220R\220 DES MAINS DE DRASCULA. IL M'A DEMAND\220 EN MARIAGE, ET MOI J'AI ACCEPT\220",
+ "AU REVOIR, JOHNY. N'Y CHERCHES PAS UNE EXPLICATION, L'AMOUR EST AVEUGLE ET N'\220COUTE PAS DES RAISONS",
+ "J'ESP\324RE QUE TU SERAS SANS RANCUNE, ET N'OUBLIES PAS QUE JE T'AIME ENCORE, MAIS EN AMI SEULEMENT\"",
+},
+{
+ "",
+ "ST\265 BENE? SENTA, PUO SENTIRMI? SI \220 MORTO?",
+ "NO, IL MIO NOME BILLIE JEAN, MA PUOI CHIAMARMI B.J. PI \351 BREVE",
+ "HI,HI!- CHE BUONO!",
+ "NON SO JOHNY, ERO QU\326, STAVO PER ADDORMENTARMI, QUANDO HO SENTITO UN FORTE RUMORE NEL CORRIDOIO",
+ "PRIMA NON GLI HO DATTO IMPORTANZA, MA DUE ORE DOPO HO SCOPERTO CHE NON RIUSCIVO A ADDORMENTARMI E SONO uscita A FARE QUATTRO PASSI",
+ "E FIGURATI LA SORPRESA QUANDO HO APERTO LA PORTA E TI HO TROVATO PER TERRA. TI GIURO, HO PENSATO CH'ERI MORTO..., MA COME SONO SCIOCCA",
+ "VOLEVO FARTI IL BOCCA A BOCCA, MA NON C'ERA BISOGNO PERCHE SUBITO HAI COMINCIATO A PARLARE",
+ "HAI DETTO NON SO CHE DI UN SPAVENTAPASSERI. CHE COLPO.....!, PERCHE QUANDO UN MORTO SI METTE A PARLARE FA UN COLPO GRANDISSIMO!",
+ "VERO DI SI? NON SO COME SONO RIUSCITA, TI HO TRASPORTATO ALLA MIA CAMERA, TI HO MESSO SUL MIO LETTO E.... NIENTE PI\351 .",
+ "NO, NON \220 STATA LA BOTTA, HI, HI. \220 PERCHE ... HO PESTATO I TUOI OCCHIALI",
+ "MAMMA MIA MA COM'\220 BELLO CON GLI OCCHIALI! SO CHE NON \220 FERNANDO LANCHA, MA HA QUALCOSA CHE MI PIACE MOLTISSIMO",
+ "SI,SI, VOGLIO... ABBRACIAMI FORTE, BACIAMI MOLTO..",
+ "OH JOHNY, CARO, MENO MALE CHE SEI VENUTO. QUEL MALVAGIO, DRASCULA, MI HA LEGATO AL LETTO E POI SE NE \220 ANDATO A GUARDARE LA PARTITA",
+ "SI, \220 VERO, LIBERAMI",
+ "NO, MI DISPIACE. HO UTILIZZATO TUTTE IN CARCERE PROBANDO LIBERARMI QUANDO TU MI AVEVI LASCIATA",
+ "JOHNY, SEI TU? - BENISSIMO. LO SAPEVO ",
+ "NON TI FIGURI QUANTO MI HA FATTO SOFFRIRE DRASCULA",
+ "PRIMA MI HA PORTATO VOLANDO FINO QUA E POI MI HA RICHIUSA IN QUESTA CAMERACCIA CHE NON HA N\220 UNO SPECCHIO",
+ "COME HAI SENTITO. E LO PEGLIORE: N\220 UNA VOLTA SI \220 SCUSATO",
+ "JOHNY, CARO. DOVE SEI?",
+ "SONO PRONTA, FAMI USCIRE DA QU\326 ",
+ "ASPETTA, VADO A GUARDARE... NO CARO, MI DISPIACE",
+ "PRENDI..",
+ "\"CARO JOHNY:",
+ "MAI POTR\220 DIMENTICARTI, MA NON SAREMO MAI FELICI INSIEME. SAR\220 SINCERA CON TE : C'\220 NE UN ALTRO; PI\351 ALTO, PI\351 FORTE..",
+ "ANZI MI HA LIBERATO DA DRASCULA. MI HA CHIESTO LA MANO E HO DETTO DI SI",
+ "ADIO JOHNY. NON CERCARE UNA SPIEGAZIONE, PERCHE L'AMORE \220 CIECO.",
+ "SPERO NON MI ODII, E RICORDA CHE ANCORA TI VOGLIO BENE, SEBBENE SOLO COME UN AMICO\"",
+},
+};
+
+
+const char *_texte[][24] = {
+{
+ "",
+ "YOU... HEY YOU!",
+ "DON'T GIVE ME THAT CRAP ABOUT A DEAD BODY OK?",
+ "I'M ALIVE. IT'S JUST THAT I'M STARVING",
+ "WELL, YOU SEE. I WAS THE DRUNKARD OF THE VILLAGE, JUST KEEPING UP WITH THE FAMILY TRADITION, YOU KNOW? ONE NIGHT DRASCULA KIDNAPPED ME TO TAKE MY ORGANS AWAY",
+ "SINCE ALCOHOL STILL KEEPS ME QUITE YOUNG, I'M HERE LIKE A SCRAP YARD. EVERYTIME HE NEEDS SOMETHING FOR THE MONSTER HE IS MAKING, HE COMES AND TAKES IT FROM ME",
+ "IT HURT AT FIRST, BUT I DON'T CARE ANYMORE",
+ "I DON'T KNOW. I GUESS IT'S HIS GRADUATE PROJECT",
+ "I'M DESIDERIO, AND I CAN HELP YOU IN ANYTHING YOU NEED",
+ "THE TRUTH IS THAT I DON'T REALLY FEEL LIKE IT, BUT THANKS VERY MUCH ANYWAY SIR",
+ "YEAH, IT'S YOU",
+ "WHY DO ALL ADVENTURE GAMES END UP WITH A SUNRISE OR A SUNSET?",
+ "DO ALL THESE NAMES BELONG TO THE CREATORS OF THE GAME?",
+ "AREN'T THEY ASHAMED TO BE SEEN BY EVERYBODY?",
+ "JESUS, THAT EMILIO DE PAZ IS EVERYWHERE!!",
+ "REALLY?",
+ "YES",
+ "WELL, DON'T MAKE A FUSS ABOUT IT",
+ "HEY WEREWOLF, BY THE WAY...",
+ "DIDN'T YOU FALL OFF A WINDOW AND GOT BADLY HURT",
+ "IF AT LEAST IT WASN'T ALWAYS THE SAME ONES...",
+ "HE'S BEEN OUT FOUR TIMES ALREADY",
+ "I'D LIKE TO BE A MODEL",
+ "ALL RIGHT, AND WHAT ARE YOU GOING TO DO?",
+},
+{
+ "",
+ "EO, USTED",
+ "\255QUE MUERTO NI OCHO CUARTOS!",
+ "ESTOY VIVO, LO QUE PASA ES QUE YO PASO HAMBRE, \250SABE USTED? ",
+ "PUES VERA, SE\245OR. YO ERA EL BORRACHO DEL PUEBLO, DIGNO SUCESOR DE UNA FAMILIA DE ILUSTRES BORRACHUZOS, Y UNA NOCHE DRASCULA ME SECUESTRO PARA ROBARME LOS ORGANOS",
+ "RESULTA QUE COMO ME CONSERVO EN ALCOHOL, ME TIENE AQUI EN PLAN DESSGUACE. CADA VEZ QUE NECESITA ALGO PARA EL MONSTRUO QUE ESTA CREANDO VIENE Y ME LO COGE",
+ "AL PRINCIPIO ME DOLIA, NO CREA, PERO YA ME DA IGUAL",
+ "NO SE, SERA SU PROYECTO DE FIN DE CARRERA",
+ "MI NOMBRE ES DESIDERIO, PARA SERVIRLE A USTED",
+ "PUES LA VERDAD ES QUE NO TENGO MUCHA GANA, PERO MUCHAS GRACIAS DE TODAS MANERAS, SE\245OR",
+ "SI, TU MISMO",
+ "\250POR QUE TODOS LOS JUEGOS DE AVENTURAS TERMINAN CON UN AMANECER O UNA PUESTA DE SOL? ",
+ "\250Y TODOS ESTOS NOMBRES SON DE LOS QUE HAN HECHO EL JUEGO?",
+ "\250Y NO LES DA VERG\232ENZA SALIR Y QUE LOS VEA TODO EL MUNDO?",
+ "JOLIN, NO HACE MAS QUE SALIR \"EMILIO DE PAZ\" ",
+ "\250DE VERDAD?",
+ "SI",
+ "PUES NO ES PARA TANTO",
+ "POR CIERTO HOMBRE LOBO...",
+ "... \250NO CAISTE POR UNA VENTANA Y TE HICISTE POLVO?",
+ "SI AL MENOS NO FUESEN SIEMPRE LOS MISMOS",
+ "ESE YA HA SALIDO CUATRO VECES",
+ "ME GUSTARIA SER MODELO",
+ "YA, \250Y TU QUE VAS A HACER?",
+},
+{
+ "",
+ "EJ, SIE DAA",
+ "DU BIST WOHL BESOFFEN ODER WAS ? !",
+ "ICH BIN LEBENDIG, ABER ICH HABE HUNGER, WISSEN SIE ?",
+ "TJA,ICH WAR DER DORFSaeUFER, STOLZER abkomme EINER DORFSaeUFERsippe UND EINES NACHTS holte mich DRASCULA, UM MIR DIE ORGANE ZU KLAUEN",
+ "WEIL ICH MICH IN ALKOHOL gut HALTE BIN ICH SEIN ERSATZTEILLAGER. IMMER WENN ER WAS FueR SEIN MONSTERCHEN BRAUCHT, BEDIENT ER SICH BEI MIR",
+ "AM ANFANG TAT DAS HoeLLISCH WEH, ABER JETZT MERK ICH SCHON NICHTS MEHR",
+ "KEINE AHNUNG, ES WIRD WOHL SEINE DIPLOMARBEIT SEIN",
+ "ICH HEISSE DESIDERIUS UND STEHE ZU IHREN DIENSTEN",
+ "NAJA, EIGENTLICH HABE ICH KEINE GROSSE LUST ABER VIELEN DANK JEDENFALLS, MEIN HERR",
+ "JA,NUR ZU",
+ "WARUM HoeREN ALLE SPIELE MIT SONNENAUFGANG ODER SONNENUNTERGANG AUF ?",
+ "UND SIE HABEN DIE NAMEN VON DEN MACHERN DIESES SPIELS BENUTZT ?",
+ "UND SIE SCHaeMEN SICH NICHT SICH ALLER WELT ZU OFFENBAREN ?",
+ "SCHEIBENKLEISTER. SCHON WIEDER DER PROGRAMMIERER",
+ "WIRKLICH ?",
+ "JA",
+ "SO SCHLIMM IST ES AUCH WIEDER NICHT",
+ "APROPOS WERWOLF....",
+ "....BIST DU NICHT AUS EINEM FENSTER GEFALLEN UND ZU STAUB GEWORDEN ?",
+ "WENN ES WENIGSTENS NICHT IMMER DIESELBEN WaeREN",
+ "DER IST SCHON 4 MAL AUFGETAUCHT",
+ "ICH WaeRE GERN FOTOMODELL",
+ "KLAR, UND WAS WILLST DU SPaeTER MAL MACHEN ?",
+},
+{
+ "",
+ "OH\220! VOUS!",
+ "QUEL MORT NI QUELLE HISTOIRE!",
+ "JE SUIS VIVANT. C'EST QUE J'AI FAIM, VOUS SAVEZ? ",
+ "J'TAIS L'IVROGNE DU VILLAGE, LE DIGNE REPRSENTANT D'UN FAMILLE D'ILLUSTRES SO\352LARDS, ET DRASCULA M'A SQUESTR UNE NUIT POUR ME VOLER LES ORGANES",
+ "COMME JE ME CONSERVE EN ALCOOL, IL ME TIENS ICI EN PLAN DBALLAGE. \267 CHAQUE FOIS QU'IL A BESOIN DE QUELQUE CHOSE POUR SON MONSTRE, IL LE PRENDRE",
+ "AU DBUT A ME FAISAIT MAL, MAIS JE M'EN FICHE DJ\267",
+ "JE NE SAIS PAS, MAIS CE SERA SON PROJET FIN D'TUDES",
+ "MON NOM EST DSIR, POUR VOUS SERVIR",
+ "VRAIMENT JE N'AI PAS UNE ENVIE FOLLE, MAIS MERCI QUAND M\322ME, MONSIEUR",
+ "OUI, TOI M\322ME",
+ "POURQUOI TOUS LES JEUX D'AVENTURES FINISSENT AVEC UNE AUBE OU UN COUCHER DU SOLEIL? ",
+ "ET VOIL\267 LES NOMS DE TOUS QUI ON FAIT LE JEU?",
+ "ET N'ONT-ILS PAS LA HONTE DE SE MONTRER ET QUE TOUT LE MONDE LES VOIT?",
+ "AH ZUT! IL NE FAIT QUE SORTIR \"EMILIO DE PAZ\" ",
+ "C'EST VRAI",
+ "OUI",
+ "EH BIEN, IL NE FAUT PAS EXAG\220RER",
+ "EN FAIT HOMME-LOUP...",
+ "...N'EST-TU PAS TOMB\220 D'UNE FEN\322TRE EN TE BR\220SILLANT?",
+ "SI DU MOINS N'\220TAIENT PAS TOUJOURS LES M\322MES...",
+ "CELUI-L\267 EST D\220J\267 SORTI QUATRE FOIS",
+ "J'AIMERAIS \322TRE MANNEQUIN",
+ "PARFAITEMENT. ET TOI, QUE VAS-TU FAIRE?",
+},
+{
+ "",
+ "EO, LEI",
+ "MA CHE DICI!",
+ "SONO VIVO, MA HO SEMPRE MOLTA FAME, SA LEI?",
+ "IO ERO IL BEONE DEL PAESE, DEGNO SUCCESSORE DI UNA FAMIGLIA DI ILLUSTRI BEONI, E UNA NOTTE DRASCULA MI SEQUESTR\220 PER RUBARMI GLI ORGANI",
+ "mi utilizza COME UNO SCASSO, OGNI VOLTA CHE HA BISOGNO DI QUALCOSA PER IL MOSTRO CHE ST\265 CREANDO VIENE QUA E MI LO toglia",
+ "AL INIZIO MI FACEVA MALE, MA ORA NON FA NIENTE",
+ "NON SO, SAR\265 LA SUA TESINA DI FINE DI LAUREA",
+ "IL MIO NOME PEPPINO, PER SERVIRGLI",
+ "LA VERIT\265 CHE NON HO MOLTA VOGLIA, COMUNQUE GRAZIE MILE, SIGNORE",
+ "SI, PROPRIO TU",
+ "PER CHE TUTTI I VIDEO-GIOCHI D' AVVENTURE FINISCONO CON UN'ALBEGGIARE O UN TRAMONTO?",
+ "E TUTTI QUESTI NOMI SONO DI CHI HANNO FATTO IL GIOCO?",
+ "E NON SI VERGOGNANO DI USCIRE ED ESSERE VISTI DA TUTTI QUANTI?",
+ "UFFA, SOLTANTO ESCI \"EMILIO DE PAZ\"",
+ "DAVVERO?",
+ "SI",
+ "NON \220 PER METTERSI COS\326 ",
+ "CERTO LUPO-MANNARO..",
+ "... MA NON SEI CADUTO DA UNA FINESTRA E TI HAI FATTO MALE?",
+ "SE PER UNA VOLTA NON FOSSENO SEMPRE GLI STESSI",
+ "QUELLO \220 GIA USCITO QUATRO VOLTE",
+ "MI PIACEREBBE ESSERE TOP MODEL",
+ "SI, E TU, COSA VAI A FARE?",
+},
+};
+
+
+const char *_texti[][33] = {
+{
+ "",
+ "MASTER, I THINK THIS IS NOT WORKING",
+ "I AM POSITIVE, MASTER",
+ "I'M SORRY MASTER",
+ "ARE YOU GOING TO BRING HERE ANOTHER CRAZY SCIENTIST? I'LL TELL YOU THAT THE LABORATORY IS ALREADY PACKED UP, AND BESIDES, THEY'RE ALL OUT OF DATE",
+ "HUSH MASTER, THE FEMINIST COULD HEAR YOU",
+ "DAMNED IT!",
+ "I DIDN'T EXPECT YOU SO SOON, MASTER",
+ "QUITE BAD MASTER. THERE MUST BE SOME PROBLEMS WITH THE SATELLITE AND I JUST CAN'T RECEIVE ANYTHING. BESIDES THERE ARE SOME INTERFERENCES BECAUSE OF THE STORM",
+ "WHAT DO I KNOW, MASTER?",
+ "YES, MY MASTER",
+ "MASTER",
+ "DO YOU KNOW WHAT TIME IS IT?",
+ "WHAT? OH, THAT SCARED ME!. YOU ARE THE \"NIGHT-CLEANING GUY\", RIGHT?",
+ "I'M IGOR, THE VALET. YOU CAN START WITH THE BALL ROOM. THERE'S BEEN A SUPER NATURAL ORGY YESTERDAY AND IT LOOKS LIKE SHIT",
+ "IF YOU NEED ANYTHING, JUST BUY IT",
+ "IT'S THE TAX RETURN APPLICATION FORM, CAN'T YOU SEE IT?",
+ "NEITHER DO I. FIRST OF ALL THE NUMBERS ARE VERY SMALL AND ALSO I CAN'T SEE MUCH AT THIS DISTANCE.",
+ "NO WAY! THEY MAKE ME LOOK UGLY",
+ "OH, WELL. IT'S JUST LIKE A CRAZY PARTY THAT THE MASTER ORGANIZES WITH HIS FRIENDS EACH TIME SOME IDIOT COMES ALONG TRYING TO KILL HIM",
+ "THEY TAKE HIS EYES OUT. THEN, POUR SOME LEMON JUICE SO THAT IT ITCHES TO DEATH, AND THEN...",
+ "NO",
+ "WHAT DO YOU MEAN WHY NOT? DO YOU KNOW WHAT TIME IT IS?",
+ "YES, IT'S WINTER",
+ "SEE YOU LATER",
+ "DON'T EVEN THINK ABOUT IT!",
+ "WELL, THAT'S ENOUGH FOR TODAY. I'M GOING TO HAVE SUPPER",
+ "MAN, I ALWAYS FORGET TO LOCK IT, RIGHT?",
+ "THE HELL WITH IT!",
+ "WHAT? OH, YOU SCARED ME MASTER, I THOUGHT YOU WERE ASLEEP",
+ "OH, BY THE WAY, I TOOK THE LIVING-ROOM KEYS SO THAT YOU CAN WATCH THE EARLY MORNING CARTOONS WITHOUT WAKING ME UP",
+ "YOU'VE GOT ANOTHER COLD MASTER? DAMN IT! I TOLD YOU TO GET SOME HEATING IN HERE...",
+ "ALL RIGHT, JUST TAKE YOUR ASPIRIN AND GO TO BED TO SWEAT FOR A WHILE. GOOD NIGHT",
+},
+{
+ "",
+ "MAESTRO, CREO QUE ESTO NO RULA",
+ "ESTOY SEGURISIMO, MAESTRO...",
+ "LO SIENTO, MAESTRO",
+ "\250VA A TRAER OTRO DE CIENTIFICO LOCO? LE ADVIERTO QUE TENEMOS EL LABORATORIO LLENO Y ESTAN TODOS CADUCADOS",
+ "CALLE, MAESTRO, QUE COMO LE OIGAN LAS FEMINISTAS",
+ "HAY QUE JOROBARSE",
+ "\255MAESTRO! \255NO LE ESPERABA TAN PRONTO!",
+ "MAL MAESTRO, DEBE HABER PROBLEMAS CON EL SATELITE Y NO CONSIGO SINTONIZAR LA IMAGEN. ADEMAS LA TORMENTA PRODUCE INTERFERENCIAS",
+ "\250Y A MI QUE ME CUENTA, MAESTRO?",
+ "SI, MAESTRO",
+ "MAESTRO",
+ "\250SABE LA HORA QUE ES?",
+ "\250EH? \255AH, QUE SUSTO ME HAS DADO! TU ERES EL DE \"LIMPIEZA NOCTURNA\"\250NO?",
+ "YO SOY IGOR, EL MAYORDOMO. PUEDES EMPEZAR POR EL SALON DE BAILE. AYER HUBO ORGIA SOBRENATURAL Y ESTA HECHO UNA MIERDA",
+ "SI NECESITAS ALGO, LO COMPRAS",
+ "LA DECLARACION DE LA RENTA \250ES QUE NO LO VES?",
+ "PUES YO TAMPOCO, PORQUE ENTRE QUE LOS NUMEROS SON MUY CHICOS, Y YO QUE NO VEO BIEN DE LEJOS...",
+ "\255NI HABLAR! ME HACEN PARECER FEO",
+ "BAH, ES UN FESTORRO QUE SE MONTA EL MAESTRO CON SUS COLEGAS CADA VEZ QUE LLEGA ALGUN IMBECIL QUERIENDO ACABAR CON EL",
+ "PRIMERO LE SACAN LOS OJOS; LUEGO LE ECHAN ZUMO DE LIMON PARA QUE LE ESCUEZA; DESPUES...",
+ "NO",
+ "\250COMO QUE POR QUE NO? \250TU HAS VISTO LA HORA QUE ES?",
+ "EN INVIERNO, SI",
+ "HASTA LUEGO",
+ "\255NI SE TE OCURRA!",
+ "BUENO, POR HOY YA VALE. ME VOY A CENAR",
+ "\255Y QUE SIEMPRE SE ME OLVIDA CERRAR CON LLAVE!",
+ "\255HAY QUE JOROBARSE!",
+ "\250EH? \255AH! QUE SUSTO ME HA DADO, MAESTRO. CREIA QUE ESTABA DURMIENDO",
+ "AH, POR CIERTO, TOME LAS LLAVES DE LA SALA DE ESTAR Y ASI NO ME MOLESTA MA\245ANA TEMPRANO SI QUIERE VER LOS DIBUJOS",
+ "\250QUE, YA SE HA RESFRIADO OTRA VEZ, MAESTRO? HAY QUE JOROBARSE. SI SE LO TENGO DICHO, QUE PONGA CALEFACCION... ",
+ "BUENO, TOMESE UNA PASTILLA DE ACIDOACETIL SALICILICO Y HALA, A SUDAR. BUENAS NOCHES",
+},
+{
+ "",
+ "MEISTER, ICH GLAUBE, DAS KLAPPT NICHT",
+ "ICH BIN ABSOLUT SICHER, MEISTER....",
+ "TUT MIR LEID, MEISTER",
+ "NOCH SO EINEN VERRueCKTEN WISSENSCHAFTLER ? ABER DAS LABOR IST DOCH VOLL MIT IHNEN UND ALLE SIND ueBER DEM VERFALLSDATUM",
+ "SEIEN SIE STILL MEISTER. WENN DAS DIE FEMINISTINNEN HoeREN",
+ "GRueNSPAN UND ENTENDRECK",
+ "MEISTER! ICH HABE SIE NOCH GAR NICHT ERWARTET !",
+ "SCHLECHT, MEISTER. ES GIBT WOHL PROBLEME MIT DER SCHueSSEL UND ICH BEKOMME DAS BILD EINFACH NICHT KLAR. UND DANN DAS GEWITTER !",
+ "UND WIESO ERZaeHLEN SIE MIR DAS, MEISTER ?",
+ "JA, MEISTER",
+ "MEISTER",
+ "WISSEN SIE, WIEVIEL UHR ES IST ?",
+ "Hae ?OH, DU HAST MICH GANZ SCHoeN ERSCHRECKT. BIST DU VON \"BLITZ UND BLANK BEI MONDESSCHEIN\"",
+ "ICH BIN IGOR, DER HAUSVERWALTER.DU KANNST MIT DEM WOHNZIMMER ANFANGEN. GESTERN HATTEN WIR EINE ueBERNATueRLICHE ORGIE UND ES SIEHT AUS WIE im SAUSTALL",
+ "KAUF ALLES WAS DU BRAUCHST !",
+ "DIE STEUERERKLaeRUNG.SIEHST DU DAS NICHT ?",
+ "ICH AUCH NICHT, WEIL DIE ZAHLEN SCHON MAL SEHR KLEIN SIND UND ICH DOCH kurzsichtig bin....",
+ "VON WEGEN ! SIE MACHEN MICH HaeSSLICH",
+ "PAH, DAS IST EINE RIESENFETE DIE DER MEISTER JEDESMAL DANN ABZIEHT, WENN IRGENDSOEIN IDIOT KOMMT, DER IHN ERLEDIGEN WILL",
+ " ZUERST REISSEN SIE IHM DIE AUGEN AUS DANACH GIESSEN SIE ZITRONENSAFT DRueBER DAMIT ES SCHoeN BRENNT UND DANN...",
+ "NEIN",
+ "WIE WARUM NICHT ? WEISST DU WIEVIEL UHR ES IST ?",
+ "im WINTER JA",
+ "TSCHueSS",
+ "WAG ES BLOOOSS NICHT !",
+ "GUT, FueR HEUTE REICHTS, DAS ABENDESSEN RUFT",
+ "IMMER VERGESSE ICH ZUZUSCHLIESSEN !",
+ "VERDAMMTER MIST NOCHMAL !",
+ "HaeH ?AH !SIE HABEN MICH GANZ SCHoeN ERSCHRECKT, MEISTER. ICH DACHTE SIE SCHLAFEN",
+ "ACH,ueBRIGENS, ICH HABE DIE WOHNZIMMERSCHLueSSEL GENOMMEN. SO NERVEN SIE MICH MORGEN FRueH NICHT MIT IHREN ZEICHENTRICKSERIEN",
+ "ACH, SIE HABEN SICH SCHON WIEDER ERKaeLTET, MEISTER ? ICH HAB JA IMMER SCHON GESAGT, SIE SOLLEN DIE HEIZUNG ANMACHEN...",
+ "NAJA, SCHLUCKEN SIE EINE SALICILACETYLSaeURE-TABLETTE UND AB INS BETT ZUM SCHWITZEN. GUTE NACHT",
+},
+{
+ "",
+ "MA\327TRE, JE CROIS QUE \200A NE ROULE PAS",
+ "J'EN SUIS TR\324S S\352R, MA\327TRE...",
+ "JE LE REGRETTE, MA\327TRE",
+ "IL APPORTERA UN AUTRE DE SCIENTIFIQUE FOU? JE VOUS PRVIENS QUE LE LABORATOIRE EN EST PLEIN ET TOUS SONT PRIMS",
+ "TAISEZ-VOUS, MA\327TRE, SI LES FMINISTES VOUS COUTENT...",
+ "CE QU'IL FAUT SUPPORTER!",
+ "MA\327TRE! -JE NE VOUS ATTENDAIT PAS SI T\342T!",
+ "A VA MAL MA\327TRE. IL DOIT AVOIR DES PROBL\324MES AVEC LE SATELLITE ET JE NE RUSSIT PAS \267 SINTONISER L'IMAGE. ET ENCORE L'ORAGE PRODUIT DES INTERFRENCES.",
+ "CANCANS QUE TOUT CELA, MA\327TRE!",
+ "OUI, MA\327TRE",
+ "MA\327TRE",
+ "QUELLE HEURE IL EST?",
+ "H\220? -AH! TU M'AS FAIT PEUR! TU EST CELUI DU \"NETTOYAGE DE NUIT\", NON?",
+ "JE SUIS IGOR, LE MAJORDOME. TU PEUX COMMENCER PAR LE SALON DE BAL. HIER IL Y A EU UNE ORGIE SURNATURELLE ET C'EST UNE SALOPERIE",
+ "SI TU AS BESOIN DE QUELQUE CHOSE, ACHETE-EN!",
+ "LA D\220CLARATION D'IMP\342TS, NE LE VOIS-TU PAS?",
+ "EH BIEN, MOI NON PLUS, CAR \267 CAUSE DE SI PETITS NUM\220ROS ET MA DIFFICULT\220 POUR BIEN VOIR DE LOIN...",
+ "ON N'EN PARLE PLUS! ILS ME FONT PARA\327TRE LAID",
+ "BAH! C'EST UNE BELLE F\322TE QUE LE MA\327TRE ORGANISE AVEC SES COLL\324GUES \267 CHAQUE FOIS QU'UN IMB\220CILE ARRIVE ET VEUT FINIR AVEC LUI",
+ "D'ABORD ON LUI ARRACHE LES YEUX; APR\324S, ON LUI VERSE DE JUS DE CITRON POUR QUE \200A LUI CUISE; APR\324S...",
+ "NON",
+ "POURQUOI PAS? TU AS VU L'HEURE QU'IL EST?",
+ "EN HIVER, OUI",
+ "AU REVOIR",
+ "N'Y PENSES M\322ME PAS!",
+ "BON, \200A VA POUR AUJOURD'HUI. JE VAIS D\327NER",
+ "J'OUBLIE TOUJOURS FERMER \267 CL\220, H\220LAS!",
+ "QUEL ENNUI!",
+ "H\220? -VOUS M'AVEZ FAIT PEUR, MA\327TRE. JE PENSAIS QUE VOUS DORMIEZ",
+ "H\220, MA\327TRE! PRENEZ LES CL\220S DE LA SALLE DE S\220JOUR, AINSI DONC SI VOUS VOULEZ VOIR LES DESSINS ANIM\220S DEMAIN DE BONNE HEURE NE ME D\220RANGEREZ PAS",
+ "QUOI? VOUS VOUS \322TES ENRHUM\220 ENCORE UNE FOIS, MA\327TRE? QUELLE CONTRARI\220T\220! JE VOUS AI D\220J\267 DIT D'Y METTRE LE CHAUFFAGE... ",
+ "BON, AVALEZ UN COMPRIM\220 D'ACIDEAC\220TYL SALICYLIQUE ET ALLEZ TRANSPIRER! BONNE NUIT!",
+},
+{
+ "",
+ "MAESTRO, CREDO CHE QUESTO NON VA",
+ "SICURISSIMO, MAESTRO",
+ "SCUSI, MAESTRO",
+ "VA A PORTARE UN ALTRO SCIENTIFICO PAZZO? GLI AVVERTO CHE IL LABORATORIO PIENO E NE ABBIAMO TUTTI SCADUTI",
+ "ZITTO, MAESTRO, FIGURASI SE LE SENTONO LE FEMMINISTE",
+ "ACCIDENTI!",
+ "-MAESTRO! NON LE ASPETTAVO COS\326 PRESTO!",
+ "MALE MAESTRO, DEVONO CI ESSERE PROBLEMI CON IL SATELLITE E NON RIESCO A SINTONIZZARE L'IMMAGINE. ANZI LA TEMPESTA CAUSA INTERFERENZE",
+ "CHE NE SO, MAESTRO",
+ "SI, MAESTROl",
+ "MAESTRO",
+ "SA CHE ORE SONO?",
+ "EH? -AH, CHE COLPO! TU SEI QUELLO DI \"PULIZIA NOTTURNA\" NO?",
+ "IO SONO IGOR, IL MAGGIORDOMO. PUOI COMINCIARE NEL SALOTTO DI BALLO, IERI C'ERA ORGIA SOPRANATURALE ED \220 PIENO DI MERDA",
+ "SE HAI BISOGNO DI QUALCOSA, COMPRALA",
+ "LA DECLARAZIONE DI REDDITI, NON VEDI?",
+ "NEANCH'IO, I NUMERI SONO PICCOLISSIMI E ANZI, IO NON VEDO BENE DA LONTANO",
+ "NEANCHE PARLARNE, MI FANNO SEMBRARE BRUTTO",
+ "\220 UNA FESTA CHE FA IL MAESTRO PER I SUOI AMICI OGNI VOLTA CHE ARRIVA QUALCHE IMBECILE CHE VUOLE FINIRE CON LUI",
+ "PRIMA, GLI TOGLIANO GLI OCCHI; POI GLI VERSANO SUCCO DI LIMONE, DOPO IL BRUCIORE.......",
+ "NO",
+ "COME CHE PER CHE NO? MA TU HAI VISTO CHE ORE SONO?",
+ "IN INVERNO, SI",
+ "ARRIVEDERCI",
+ "N\324 PENSARCI",
+ "BENE, BASTA PER OGGI. VADO A CENARE",
+ "E CHE SEMPRE DIMENTICO CHIUDERE CON LA CHIAVE",
+ "ACCIDENTI!",
+ "EH? -AH! CHE COLPO, MAESTRO, PENSAVO STAVA DURMENDO",
+ "ORA MI RICORDO, PRENDA LE CHIAVI DEL SOGGIORNO, COS\326 DOMANI MATTINA NON MI DISTURBA SE VUOLE GUARDARE I CARTONI ANIMATI",
+ "HA PRESSO FREDDO UN'ALTRA VOLTA, MAESTRO? SEMPRE GLI DICO CHE METTA IL RISCALDAMENTO",
+ "PRENDA UNA ASPIRINA ED A SUDARE. BUONA NOTTE",
+},
+};
+
+
+const char *_textl[][32] = {
+{
+ "",
+ "ARE YOU GOING TO LET OURSELVES BE GUIDED BY PRIMITIVE INSTINCTS JUST BECAUSE WE BELONG TO DIFFERENT RACES AND THE SOCIAL SITUATION IS TELLING US TO DO SO?",
+ "AREN'T WE TIED BY SENSE WHICH IS THE MOST POWERFUL WEAPON AS WELL AS THE MOST PRECIOUS GIFT?",
+ "OH, IF WE ALL LET OUR THOUGHTS GUIDE OUR WAY IN LIFE WITHOUT LEAVING SOME ROOM FOR FEELINGS WHICH LET OUR PRE-EVOLUTIVE INSTINCTS COME OUT!",
+ "ANSWER ME, EPHEMERAL CREATURE. WOULDN'T WE ALL BE HAPPIER WITH THOSE EMOTIONAL BOUNDINGS?",
+ "YOU ARE NOT GETTING THROUGH",
+ "THIS IS A VERY CLEAR EXAMPLE, YOU SEE?: YOU WANT TO GET THROUGH AND GO AHEAD WITH YOUR ADVENTURE, AND I WON'T LET YOU DO THAT",
+ "WILL THAT BE A CONTROVERSIAL POINT BETWEEN US THAT HAVE JUST MET?",
+ "WELL THEN",
+ "WELL, THAT DEPENDS ON WHAT WE TAKE A RELATIONSHIP FOR. SOME AUTHORS DEFEND...",
+ "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 BETHINK 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",
+ "WHAT?",
+ "I DON'T KNOW WHAT YOU'RE TALKING ABOUT, YOU EPHEMERAL CREATURE",
+ "I'M NOT INTERESTED",
+ "I DON'T KNOW ABOUT THE OTHER GAMES, BUT WE COULD USE THIS BEAUTIFUL SCREEN",
+ "",
+ "I'D CARE...",
+ "NO. IT'S JUST THE SON, THE FATHER, THE GRANDFATHER AND A FRIEND, WHO ARE CALLED LIKE THAT",
+ "BUT, IT IS GOING TO LOOK LIKE THE GAME WAS MADE BY FIVE PEOPLE",
+ "THESE ARE PROMISING GUYS",
+ "THAT'S A GOOD ONE! A GOOD ONE!",
+ "PLEASE, CALL ME CONSTANTINO",
+ "IT WASN'T ME MAN. IT WAS \"EL COYOTE\", MY TWIN",
+ "JESUS, THESE ARE REALLY LONG CREDIT TITLES",
+ "I STOPPED COUNTING A LONG TIME AGO",
+ "WHAT WILL BECOME OF YOU NOW, DESIDERIO?",
+ "BUT, YOU SHOULD LOSE SOME WEIGHT",
+ "I'LL JUST RETIRE TO THE TIBET AND THINK ABOUT THE MEANING OF LIFE",
+},
+{
+ "",
+ "UN MOMENTO. \250SOLO PORQUE PERTENECEMOS A RAZAS DISTINTAS Y LA SOCIEDAD DICE QUE SEREMOS ENEMIGOS VAMOS A DEJARNOS LLEVAR POR NUESTROS MAS PRIMITIVOS INSTINTOS?",
+ "\250ACASO NO NOS UNE LA RAZON, ELARMA MAS PODEROSA Y, A LA VEZ, EL DON MAS PRECIADO QUE TENEMOS?",
+ "\255AH, SI EL ENTENDIMIENTO GUIARA NUESTROS PASOS POR LA VIDA SIN DEJAR SITIO A LOS SENTIMIENTOS, QUE AFLORAN NUESTRAS INCLINACIONES PRE-EVOLUTIVAS!",
+ "\250NO CREES QUE SERIAMOS MAS DICHOSOS SIN ESAS ATADURAS EMOCIONALES? CONTESTA EFIMERA CRIATURA",
+ "NO PASAS",
+ "\250VES? ESTE ES UN CLARO EJEMPLO: TU QUIERES PASAR Y CONTINUAR TU AVENTURA Y YO NO PUEDO PERMITIRLO",
+ "\250HA DE SER ESE MOTIVO SUFICIENTE DE CONFLICTO ENTRE NOSOTROS, QUE NO NOS CONOCEMOS DE NADA?",
+ "PUES ESO",
+ "BUENO, ESO DEPENDE DE LO QUE ENTENDAMOS POR RELACION. ALGUNOS AUTORES DEFIENDEN...",
+ "AGGG. LA CAZA COMO MEDIO DE SUBSISTENCIA ES UNA ACTIVIDAD ARCAICA INCOMPATIBLE CON UNA NATURALEZA SUPERIOR COMO LA MIA. Y ADEMAS ME HE VUELTO VEGETARIANO",
+ "RESULTA QUE ESTABA COMIENDOME A UN TIO Y ME PUSE A REFLEXIONAR. LLEGUE A LA CONCLUSION ANTES MECIONADA",
+ "ME COSTO MUCHO DEJAR LOS HABITOS DESDE TANTO TIEMPO ADQUIRIDOS, PERO POR FIN MI ALMA IRASCIBLE VENCIO A LA CONCUPISCIBLE Y NO HE VUELTO A PROBAR LA CARNE",
+ "NI SIQUIERA EL PLACER QUE SUPONE UN HUESO, CON EL JUGO DE LA PIEL ENTRE SUS POROS Y ESE SABOR QUE TE TRANSPORTA A LUGARES REMOTOS PARADISIACOS...",
+ "NI SIQUIERA ME AFECTA. PARA NADA, DE VERDAD",
+ "\250EL QUE?",
+ "NO SE DE QUE ME HABLAS, EFIMERA CRIATURA",
+ "NO ME INTERESA",
+ "LOS DEMAS JUEGOS, NO SE, PERO ESTE PARA APROVECHAR ESTA PANTALLA TAN BONITA",
+ "",
+ "A MI SI ME DARIA",
+ "NO, ES QUE SON EL ABUELO, EL PADRE, EL HIJO, Y UN AMIGO QUE SE LLAMA ASI",
+ "NO, PERO ES QUE SI NO VA A PARECER QUE HAN HECHO EL JUEGO ENTRE CINCO",
+ "ESTOS CHICOS PROMETEN",
+ "\255ESE ES BUENO, ESE ES BUENO!",
+ "LLAMAME CONSTANTINO",
+ "NO ERA YO, HOMBRE. ERA MI DOBLE, EL COYOTE",
+ "VAYA, QUE CREDITOS MAS LARGOS",
+ "YO YA PERDI LA CUENTA",
+ "BUENO DESIDERIO, \250Y QUE VA A SER DE TI AHORA?",
+ "PERO TENDRIAS QUE ADELGAZAR",
+ "ME RETIRARE AL TIBEL A REFLEXIONAR SOBRE EL SENTIDO DE LA VIDA",
+},
+{
+ "",
+ "MOMENT mal. NUR WEIL WIR UNTERSCHIEDLICHER HERKUNFT SIND UNd eigentlich feinde sein muessten mueSSEN WIR UNS DOCH Nicht wie die primaten auffuehren!",
+ "VERBINDET UNS ETWA NICHT DIE VERNUNFT, GEFaeHRLICHSTE WAFFE UND ZUGLEICH GRoeSSTE GABE, DIE WIR HABEN ?",
+ "AH, WENN NUR DAS GEGENSEITIGE VERSTaeNDNIS die gefuehle besiegen koennte,DIE DIE WURZEL UNSERER PRaeHISTORISCHEN NEIGUNGEN SIND!",
+ "GLAUBST DU NICHT, DASS WIR OHNE DIESE GEFueHLSFESSELN GLueCKLICHER WaeREN ? ANTWORTE, DU EINTAGSFLIEGE",
+ "DU KOMMST NICHT DURCH",
+ "SIEHST DU ? DU WILLST HIER DURCH UND MIT DEM ABENTEUER WEITERMACHEN UND ICH KANN DAS NICHT ZULASSEN",
+ "MUSS DENN DIE TATSACHE, DASS WIR UNS NICHT KENNEN, ANLASS ZUM STREIT SEIN?",
+ "GENAU",
+ "NAJA. KOMMT DARAUF AN, WAS WIR UNTER BEZIEHUNG VERSTEHEN. EINIGE VERTRETEN JA DEN STANDPUNKT, DASS....",
+ "ARRGH.nur zu jagen, um zu ueberleben ist mir zu primitiv.UND AUSSERDEM BIN ICH SEIT KURZEM VEGETARIER",
+ "ES GING LOS,ALS ICH MIR GERADE EINEN TYPEN EINVERLEIBTE UND ANFING NACHZUDENKEN UND ZUM EBENERWaeHNTEN SCHLUSS KAM",
+ "ES war hart, DIE ALTEN laster ABZULEGEN, ABER seit MEINE FLEISCHESLUST MEINEn JaeHZORN besiegt hat HABE ICH KEIN FLEISCH MEHR GEGESSEN:",
+ "NICHT MAL DIE GAUMENFREUDE EINES KNOCHENS, MIT DEM SAFT DER HAUT IN DEN POREN UND DIESEm GESCHMACK DER DICH INS REICH DER SINNE ENTFueHRT...",
+ "ES MACHT MIR ueBERHAUPT NICHTS AUS, WIRKLICH",
+ "WAS JETZT ?",
+ "ICH WEISS NICHT, WOVON DU REDEST, DU EINTAGSFLIEGE",
+ "DAS INTERESSIERT MICH NICHT",
+ "ANDERE SPIELE, ACH ICH WEISS NICHT, ABER DAS HIER HAT SO EINE NETTE GRAFIK",
+ "ICH HaeTTE SCHON LUST..",
+ "NEIN, SO HEISSEN DER OPA, DER VATER, DER SOHN UND EIN FREUND.",
+ "NEIN, ABER WENN NICHT, SIEHT ES SO AUS ALS WaeRE DAS SPIEL VON FueNF LEUTEN GEMACHT WORDEN",
+ "DIESE JUNGS SIND VIELVERSPRECHEND !",
+ "DER IST GUT, SUPERKLASSE !",
+ "NENN MICH KONSTANTIN",
+ "MANN, DAS WAR NICHT ICH, SONDERN MEIN DOUBLE, DER KOYOTE",
+ "WOW, WAS FueR EINE LANGE DANKESLISTE",
+ "ICH HAB SCHON DEN ueBERBLICK VERLOREN",
+ "O.K. DESIDERIO, UND WAS WIRD JETZT AUS DIR WERDEN ?",
+ "ABER DANN MueSSTEST DU ABNEHMEN",
+ "ICH WERDE NACH TIBET AUSWANDERN UND ueBER DEN SINN DES LEBENS NACHDENKEN",
+},
+{
+ "",
+ "c'est parce qu'on APPARTIENT \267 DES RACES DIFF\220RENTES ET QUE LA SOCI\220T\220 NOUS CONFRONTE, QUE NOUS ALLONS AGIR PAR NOS PLUS M\220PRISABLES INSTINCTS?",
+ "NE SOMMES-NOUS PAR HASARD ACCROCHS PAR LA RAISON, L'ARME LA PLUS PUISSANTE, ET AUSSI LE DON LE PLUS PRCIEUX QUE NOUS AVONS?",
+ "AH!, SI LA RAISON GUIDAIT NOS PAS DANS LA VIE SANS Y ENTRA\327NER LES SENTIMENTS, QUI FONT JAILLIR NOS INCLINAISONS PR-VOLUTIVES!",
+ "NE CROIS-TU PAS QUE NOUS SERIONS PLUS HEREUX SANS CES ATTACHEMENTS-L\267? RPONDS-MOI, CRATURE PHM\324RE ",
+ "TU NE PASSES PAS",
+ "TU VOIS? C'EST UN EXEMPLE CLAIR: TOI, TU VEUX PASSER ET POURSUIVRE TON AVENTURE ET MOI, JE NE PEUX PAS LE TOLRER",
+ "CELA DOIT \322TRE UNE RAISON SUFFISANTE DE CONFLIT ENTRE NOUS DEUX, QUI NE NOUS CONNAISSONS DE RIEN?",
+ "C'EST CELA",
+ "EH BIEN, CELA DPEND DE CE QU'ON ENTEND PAR RLATION. D'APR\324S QUELQUES AUTEURS...",
+ "LA CHASSE COMME MOYEN DE SUBSISTANCE EST UNE ACTIVIT\220 ARCHA\330QUE, INCOMPATIBLE AVEC ma NATURE SUP\220RIEURE . ET DE PLUS JE SUIS DEVENU V\220G\220TARIEN",
+ "IL S'EN SUIT QU'EN TRAIN DE D\220VORER UN TYPE, JE ME SUIS MIS \267 R\220FL\220CHIR. ALORS, SUIS ARRIV\220 \267 LA CONCLUSION MENTIONN\220 CI-DESSUS",
+ "ABANDONNER CES HABITUDES M'EST REVENU CHER, MAIS \267 LA FIN MON \266ME IRASCIBLE a vancue MON \266ME CONCUPISCIBLE, ET D\324S LORS JE N'AI GO\352T\220 \267 LA VIANDE",
+ "M\322ME PAS LE PLAISIR DE CROQUER UN OS, AVEC LE SUC DE LA PEAU ENTRE SES PORES ET sa SAVEUR QUI TE TRANSPORTE VERS DES LIEUX TR\324S LONTAINS, PARADISIAQUES...",
+ "CECI NE M'AFFECTE PAS M\322ME, ABSOLUMENT PAS, C'EST VRAI",
+ "QUOI?",
+ "JE NE SAIS PAS DE QUOI TU M'EN PARLES, CR\220ATURE \220PH\220M\324RE",
+ "CELA NE ME REGARDE PAS",
+ "LES AUTRES JEUX, JE NE SAIS PAS; MAIS CELUI-CI OUI, POUR EN PROFITER DE CET \220CRAN SI JOLI",
+ "",
+ "MOI, JE NE M'EN FICHERAI PAS",
+ "NON, C'EST QU'ILS SONT LE GRAND-P\324RE, LE P\324RE, LE FILS, ET UN AMI QUI S'APPELLE COMME \200A",
+ "NON, MAIS SI NON, IL VA PARA\327TRE QU'ON A FAIT LE JEU ENTRE CINQ",
+ "CES GAR\200ONS ONT DU FUTUR",
+ "CELUI-L\267 EST BON! CELUI-L\267 EST BON!",
+ "APPELLE-MOI CONSTANTIN",
+ "CE N'\220TAIT PAS MOI, MON VIEUX. C'\220TAIT MON DOUBLE, LE COYOTE",
+ "TIENS! QUELS CR\220DITS SI LONGS",
+ "J'AI D\220J\267 PERDU LES COMPTES",
+ "EH BIEN, D\220SID\324RE, QUE T'ARRIVERA-T-IL MAINTENANT?",
+ "MAIS TU DEVRAIS MAIGRIR",
+ "JE VAIS ME RETIRER AU TIBEL POUR Y R\220FL\220CHIR SUR LE SENS DE LA VIE",
+},
+{
+ "",
+ "UN ATTIMO. PERCHE SIAMO DI DIVERSE RAZZE E LA SOCIET\265 DICA CHE SIAMO NEMICI, ANDIAMO A LASCIARCI DOMINARE PER I PI\351 PRIMITIVI ISTINTI?",
+ "MA NON SIAMO UNITI DALLA RAGIONE, DALLA ARMA PI\351 PODEROSA E ANCHE PER IL DONO PI\351 PREZIOSO CHE ABBIAMO?",
+ "SE IL GIUDIZIO GUIDASSE I NOSTRI PASSI NELLA VITA SENZA LASCIARE POSTO AI SENTIMENTI, CHE MOSTRANO LE NOSTRE INCLINAZIONI PRE-EVOLUTIVI!",
+ "NON CREDI CHE SAREMMO PI\351 BEATI SENZA QUESTO LEGAME EMOZIONALE? RISPONDE EFFIMERA CREATURA",
+ "NON PASSI",
+ "VEDI? QUESTO UN CHIARO ESEMPIO: TU VUOI PASSARE E PROSEGUIRE LA TUA AVVENTURA ED IO NON POSSO PERMETTERLO",
+ "MA DEVE ESSERE CAUSA DI CONFRONTO QUANDO ANCORA NON CI CONOSCIAMO?",
+ "CHE TI HO DETTO?",
+ "BOH, DIPENDE DI CHE CAPIAMO COME RELAZIONE. CI SONO AUTORI CHE DIFENDONO...",
+ "LA CACCIA COME FORMA DI SUSSISTENZA \220 UNA ATTIVIT\265 ARCAICA, INCOMPATIBILE CON UNA NATURA SUPERIORE COM'\220 LA MIA: ADESSO SONO VEGETARIANO",
+ "TEMPO FA, STAVO MANGIANDO UN TIZIO QUANDO MI SONO MESSO A RIFLETTERE. FU QUANDO LA CONCLUSIONE DI PRIMA ARRIV\220 ",
+ "FU DIFFICILE LASCIARE LE MIE VECCHIE ABITUDINI, MA LA MIA ANIMA IRASCIBILE HA VINTO LA CONCUPISCIBILE E NON MANGIO PI\351 DELLA CARNE",
+ "NEPPURE IL PIACERE CHE FA UN OSSO, COL SUCCO DELLA PELLE E QUEL SAPORE CHE TI PORTA A POSTI LONTANI E PARADISIACI...",
+ "NEMMENO MI TOCCA DA VICINO, DAVVERO",
+ "CHE COSA?",
+ "NON SO SU CHE MI PARLI, EFFIMERA CREATURA",
+ "NON MI INTERESA",
+ "GLI ALTRI VIDEO-GIOCHI, NON SO, MA QUESTO \220 PER APPROFITTARE QUESTO BELLO SCHERMO",
+ "",
+ "IO SI ME VERGOGNAREI",
+ "NO, SONO IL NONNO, IL PADRE, IL FIGLIO, E UN AMICO CHE SI CHIAMA COS\326 ",
+ "NO, MA SE NON \220 COS\326, SEMBRAR\265 CHE HANNO FATTO IL VIDEO-GIOCO IN CINQUE",
+ "BRAVI RAGAZZI",
+ "-QUELLO \220 BUONO, QUELLO \220 BUONO!",
+ "CHIAMAMI COSTANTINO",
+ "NON ERO IO, DAI,. ERA IL MIO CONTROFIGURA, IL COYOTE",
+ "INSOMMA, MOLTI TITOLI DI CODA",
+ "IO NON SO GI\265 QUANTI",
+ "ALLORA PEPPINO, CHE VAI FARE ADESSO?",
+ "MA DOVRESTI DIMAGRIRE",
+ "MI APPARTER\220 AL TIBET A RIFLETTERE SUL SENSO DELLA VITA",
+},
+};
+
+const char *_textp[][20] = {
+{
+ "",
+ "HI",
+ "YES SIR. IT'S BEAUTIFUL",
+ "NO, NO. HE WON'T DO IT",
+ "ALL RIGHT THEN",
+ "REALLY?",
+ "SO?",
+ "I'M SORRY. THE PIANIST UNION TRADE DOESN'T ALLOW ME TO SAVE GIRLS FROM VAMPIRES' CLUTCHES",
+ "IF SHE HAD BEEN KIDNAPPED BY THE WEREWOLF...",
+ "I CAN ONLY PLAY THIS SONG",
+ "I'M A CONSERVATOIRE PIANIST AND THE BARTENDER WON'T BUY MORE SCORES FOR ME",
+ "OH GOD, I REALLY LOVE CLASSIC MUSIC!",
+ "IT'S BECAUSE I'M WEARING EAR-PLUGS",
+ "IT'S BECAUSE I CAN LIP-READ",
+ "NOOO",
+ "NO! I'M NOT TAKING THIS ANY LONGER!",
+ "NO WAYYYYY!",
+ "WHAT? OF COURSE I'M INTERESTED",
+ "THANKS GOD! I CAN PLAY A DIFFERENT SONG NOW!",
+ "I GUESS YOU CAN KEEP MY EAR-PLUGS",
+},
+{
+ "",
+ "HOLA",
+ "BONITA. SI SE\245OR",
+ "NO QUE NO LO HACE",
+ "PUES VALE",
+ "\250SI?",
+ "\250Y?",
+ "LO SIENTO. EL SINDICATO DE PIANISTAS NO ME PERMITE RESCATAR CHICAS DE LAS GARRAS DE LOS VAMPIROS",
+ "SI LA HUBIERA RAPTADO UN HOMBRE LOBO...",
+ "NO PUEDO TOCAR MAS QUE ESTA CANCION",
+ "ES QUE SOY PIANISTA DE CONSERVATORIO Y EL TABERNERO NO COMPRA MAS PARTITURAS",
+ "\255CON LO QUE A MI ME GUSTA LA MUSICA CLASICA!",
+ "PORQUE LLEVO TAPONES EN LOS OIDOS",
+ "PORQUE LEO LOS LABIOS",
+ "NOOO",
+ "\255QUE NO! \255QUE NO ME AGUANTO!",
+ "\255QUE NOOOOOO!",
+ "\250QUE? CLARO QUE ME INTERESA",
+ "AHORA PODRE TOCAR OTRA CANCION \255QUE ALIVIO!",
+ "SUPONGO QUE TE PUEDES QUEDAR CON MIS TAPONES",
+},
+{
+ "",
+ "HALLO",
+ "JAWOLL, SEHR SCHoeN",
+ "NEIN, ER TUT ES EINFACH NICHT",
+ "NA GUT, OK.",
+ "JA ?",
+ "UND ?",
+ "TUT MIR LEID. DIE KLAVIERSPIELERGEWERKSCHAFT ERLAUBT ES MIR NICHT, MaeDCHEN AUS DEN KLAUEN VON VAMPIREN ZU BEFREIEN",
+ "WENN SIE WERWOLF ENTFueHRT HaeTTE.....",
+ "ICH KANN NUR DIESES EINE LIED",
+ "ICH HABE AM KONSERVATORIUM KLAVIER GESPIELT UND DER WIRT WILL MEINE PARTITueDEN NICHT KAUFEN",
+ "WO MIR DOCH KLASSISCHE MUSIK SO GUT GEFaeLLT !",
+ "WEIL ICH OHRENSToePSEL IN DEN OHREN HABE",
+ "WEIL ICH VON DEN LIPPEN LESEN KANN",
+ "NEEEIN",
+ "NEEIEN! ICH KANN MICH NICHT BEHERRSCHEN !",
+ "NEIN,NEIN,UND NOCHMAL NEIN !",
+ "WIE BITTE ? KLAR BIN ICH INTERESSIERT",
+ "ENDLICH KANN ICH WAS ANDERES SPIELEN,WELCH ERLEICHTERUNG !",
+ "ICH GLAUBE, DU KANNST MEINE OHRENSToePSEL BEHALTEN",
+},
+{
+ "",
+ "BONJOUR!",
+ "JOLIE, OUI M'SIEUR",
+ "NON, QU'ELLE NE LE FAIT PAS",
+ "D'ACCORD, A VA",
+ "OUI?",
+ "ET QUOI?",
+ "SUIS DSOL. LE SYNDICAT DE PIANISTES NE ME PERMET PAS DE LIBRER LES FILLES DES GRIFFES DE VAMPIRES",
+ "SI ELLE AVAIT T RAPTE PAR UN HOMME-LOUP...",
+ "JE NE PEUX PAS JOUER DAVANTAGE CETTE CHANSON",
+ "JE SUIS LE PIANISTE DU CONSERVATOIRE ET LE TAVERNIER N'ACH\324TE PAS MES PARTITIONS",
+ "ET MOI QUI AIME BEAUCOUP LA MUSIQUE CLASSIQUE!",
+ "PARCE QUE J'AI DES TAMPONS \267 L'OU\330E",
+ "PARCE QUE JE LIS LES LEVRES",
+ "NOOON!",
+ "QUE NON! QUE JE NE PEUX PAS ME RETENIR DAVANTAGE!",
+ "QUE NOOOOOON!",
+ "QUOI? BIEN S\352R QUE \200A M'INT\220RESSE",
+ "MAINTENANT JE POURRAI JOUER UNE AUTRE CHANSON -QUEL SOULAGEMENT!",
+ "TU PEUX GARDER MES TAMPONS, JE SUPPOSE",
+},
+{
+ "",
+ "CIAO",
+ "BELLA, MOLTO BELLA",
+ "NO, CHE NON LO FA",
+ "VA BENE",
+ "-SI?",
+ "E?",
+ "MI DISPIACE. IL SINDACATODI PIANISTI NON MI DA PERMESSO PER LIBERARE RAGAZZE DALLE MANI DI VAMPIRI",
+ "SE LA AVESSE SEQUESTRATA IL LUPO-MANNARO...",
+ "SOLTANTO POSSO SUONARE QUESTA CANZONE",
+ "\324 PERCHE SONO PIANISTA DI CONSERVATORIO E IL TABERNERO NON COMPRA PI\353 PARTITURE",
+ "PECCATO.....MI PIACE MOLTISSIMO LA MUSICA CLASSICA!",
+ "PERCHE MI HO MESSO TAPPI NEGLI ORECCHII",
+ "PERCHE SO LEGGERE LE LABRA",
+ "NOOO",
+ "NO!, NON MI SOPPOROTO!",
+ "HO DETTO DI NOOO!",
+ "COSA? SI, SI MI INTERESA, COME NO",
+ "ADESSSO POTR\343 SUONARE UN'ALTRA CANZONE, GRAZIE!!",
+ "CREDO CHE I MIEI TAPPI ADESSO SONO TUOI",
+},
+};
+
+
+const char *_textt[][25] = {
+{
+ "",
+ "WHAT HAPPENS, WHAT'S THE MATTER?",
+ "OK. ROOM 512. UPSTAIRS. THE KEY IS ON THE DOOR",
+ "COUNT DRASCULA!!?",
+ "NO, NOTHING. THAT GUY HAS A BAD REPUTATION OVER HERE",
+ "WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK UP 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...",
+ "WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TELL ME TO",
+ "THEY'RE WINNING",
+ "LEAVE ME ALONE, ALL RIGHT?",
+ "OF COURSE. I'M NOT BLIND",
+ "THE TRADITION IN THIS VILLAGE IS TO FORGET ALL HARD FEELINGS WHENEVER THERE IS A GAME, SO AS TO CHEER UP THE LOCAL TEAM",
+ "AND PLEASE, SHUT UP FOR GOD'S SAKE. I CAN'T HEAR ANYTHING!",
+ "COME ON, LEAVE ME ALONE AND DON'T BOTHER ME ANYMORE",
+ "IT HAS JUST STARTED! AND SHUT UP!",
+ "OK, OK, I THOUGHT SOMETHING WAS GOING ON",
+ "IT DOESN'T MATTER, ANYWAY. SHE'LL PROBABLY BE DEAD BY NOW",
+ "HE JUST STARTED PLAYING CLASSIC MUSIC, AND I COULDN'T STAND IT",
+ "SINCE I'M PAYING HIM FOR PLAYING WHATEVER I WISH, I JUST FIRED HIM",
+ "AND THEN, HE GOT FRESH WITH ME. JESUS!, HE LOOKED SO NICE AND INNOCENT...WHAT A HYPOCRITE!",
+ "BY THE WAY, BE CAREFUL BECAUSE I JUST WAXED THE FLOOR",
+ "SHUT UP! WE'RE WATCHING THE GAME!",
+ "OH, COME ON! TAKE IT!",
+},
+{
+ "",
+ "\250QUE PASA, QUE PASA?",
+ "DE ACUERDO. HABITACION 512. SUBIENDO POR LAS ESCALERAS. LA LLAVE ESTA EN LA PUERTA",
+ "\255\250 EL CONDE DRASCULA ?!",
+ "NO, NADA. ESE TIPO TIENE MALA FAMA POR AQUI",
+ "BUENO, CORREN VARIOS RUMORES SOBRE EL. ALGUNOS DICEN QUE ES UN VAMPIRO Y VA SECUESTRANDO GENTE PARA CHUPARLES LA SANGRE",
+ "CLARO, QUE OTROS OPINAN QUE SOLO ES UN TRAFICANTE DE ORGANOS, Y POR ESO APARECE GENTE DESCUARTIZADA POR LOS ALREDEDORES",
+ "POR SUPUESTO SON SOLO RUMORES. LO MAS PROBABLE ES QUE SEA LAS DOS COSAS. POR CIERTO, \250PARA QUE QUIERE USTED VER A ESE TIPO?",
+ "NO DEJELO, QUE ES QUE TENGO MUCHO QUE HACER...",
+ "BUENO VALE, PERO PORQUE QUIERO YO, NO PORQUE LO DIGAS TU",
+ "VAN GANANDO",
+ "DEJAME EN PAZ, \250VALE?",
+ "PUES CLARO, NO SOY CIEGO",
+ "ES TRADICION EN EL PUEBLO QUE CUANDO HAY PARTIDO SE OLVIDAN RENCORES PARA ANIMAR A LA SELECCION",
+ "Y CALLATE YA DE UNA VEZ, QUE NO ME DEJAS OIR",
+ "ANDA, DEJAME EN PAZ Y NO MOLESTES",
+ "\255ACABA DE EMPEZAR! \255Y CALLATE!",
+ "AH, BUENO. CREIA QUE PASABA ALGO",
+ "NO, SI ES IGUAL. A ESTAS HORAS YA ESTARA MUERTA",
+ "ES QUE SE PUSO A TOCAR MUSICA CLASICA Y YO NO LA AGUANTO",
+ "Y COMO YO LE PAGO PARA QUE TOQUE LO QUE YO QUIERO, PUES LE HE ECHADO",
+ "Y ENCIMA SE ME PUSO CHULO... \255Y PARECIA UNA MOSQUITA MUERTA!",
+ "...POR CIERTO, TENGA CUIDADO. EL SUELO ESTA RECIEN ENCERADO",
+ "\255SILENCIO! \255ESTAMOS VIENDO EL PARTIDO!",
+ "\255VENGA, ANDA! TOMA.",
+},
+{
+ "",
+ "WAS ZUM TEUFEL IST LOS ?",
+ "O.K. ZIMMER 512. DIE TREPPE HOCH. DIE SCHLueSSEL STECKEN SCHON",
+ " GRAF DRASCULA ? !",
+ "NEIN, DER TYP HAT HIER EINEN SCHLECHTEN RUF",
+ "NAJA, ES GIBT MEHRERE GERueCHTE ueBER IHN. EINIGE BEHAUPTEN, DASS ER LEUTE ENTFueHRT UND IHNEN DAS BLUT AUSSAUGT",
+ "KLAR, ANDERE GLAUBEN, DASS ER EIN ORGANHaeNDLER IST UND DESHALB TAUCHEN ueBERALL AM WALDRAND ZERSTueCKELTE LEICHEN AUF",
+ "NATueRLICH SIND DAS ALLES NUR GERueCHTE. HoeCHSTWAHRSCHEINLICH STIMMEN SIE ABER. ACH, UND WAS WOLLEN SIE VON IHM ?",
+ "NEIN, VERGESSEN SIES. ICH HABE NaeMLICH ZU TUN...",
+ "O.K. ABER WEIL ICH DAS WILL UND NICHT WEIL DU DAS SAGST",
+ "SIE GEWINNEN",
+ "LASS MICH IN RUHE, OK ?",
+ "KLAR, ICH BIN DOCH NICHT BLIND",
+ "ES IST EIN ALTER BRAUCH IM DORF, DASS MAN BEI EINEM SPIEL ALTE ZWISTE VERGISST, UM DIE MANNSCHAFT ANZUFEUERN",
+ "UND HALT ENDLICH DEINEN MUND, ICH WILL ZUHoeREN",
+ "MANN, LASS MICH IN RUHE UND NERV MICH NICHT",
+ "ES FaeNGT GERADE AN ! STILL JETZT !",
+ "ACH SO, ICH DACHTE ES IST IRGENDWAS LOS",
+ "NEIN, IST DOCH EGAL. JETZT WIRD SIE EH SCHON TOT SEIN",
+ "ER HAT KLASSIK GESPIELT UND ICH HALTE DAS NICHT AUS",
+ "UND WEIL ICH ES BIN, DER IHN DAFueR BEZAHLT, DASS ER SPIELT, WAS ICH WILL, HABE ICH IHN ENTLASSEN",
+ "UND DANN KAM ER MIR AUCH NOCH SCHRaeG... UND WAS FueR EINE PAPPNASE ER DOCH IST !",
+ "...ACH JA, UND PASSEN SIE AUF. DER BODEN IST FRISCH GEBOHNERT",
+ "RUHE !WIR GUCKEN GERADE DAS SPIEL !",
+ "LOS, HAU REIN, GIBS IHM",
+},
+{
+ "",
+ "QU'EST-CE QU'IL Y A, QU'Y A-T-IL?",
+ "D'ACCORD. CHAMBRE 512. PAR LES ESCALIERS. LA CL EST SUR LA PORTE",
+ "LE COMTE DRASCULA?!",
+ "NON, RIEN, CE TYPE A UNE MAUVAISE RPUTATION PAR ICI",
+ "EH BIEN, IL Y A DES RUMEURS QUI COURENT SUR LUI. CERTAINS DISENT QUE C'EST UN VAMPIRE ET QU'IL ENLEVE DU MONDE POUR SUCER LEUR SANG ",
+ "MAIS D'AUTRES PENSENT QU'IL EST SEULEMENT UN TRAFICANT D'ORGANES, ET C'EST POUR CELA QUE DES PERSONNES DPECES SONT APPARUES DANS LES ALENTOURS",
+ "CERTAINEMENT IL NE S'AGIT QUE DES BRUITS QUI COURENT. S\352REMENT IL AURA LES DEUX MTIERS. MAIS, POURQUOI VOULEZ-VOUS VOIR CE TYPE?",
+ "OH, NON! OUBLIEZ CELA, J'AI BEAUCOUP \267 FAIRE.",
+ "BON, A VA. MAIS PARCE QUE JE VEUX ET NON PARCE QUE TU LE DIS",
+ "ILS GAGNENT",
+ "FICHE-MOI LA PAIX, D'ACCORD?",
+ "C'EST S\352R, JE NE SUIS PAS UN AVUGLE",
+ "SELON LA TRADITION DU VILLAGE, QUAND IL Y A UN MATCH ON OUBLIE LES RANCUNES, POUR ALLER ENCOURAGER LA S\220LECTION",
+ "ET FERME-LA D'UNE FOIS!, JE NE PEUX PAS ENTENDRE",
+ "ALLEZ, VA-T'-EN ET NE D\220RANGES PAS!",
+ "\200A VIENT DE COMMENCER! -ET TAIS-TOI!",
+ "AH, BON! JE PENSAIS QU'IL SE PASSAIT QUELQUE CHOSE",
+ "NON, C'EST \220GAL. \267 CES HEURES-CI ELLE SERA D\220J\267 MORTE",
+ "LE FAIT EST QU'ELLE A COMMENC\220 JOUER DE LA MUSIQUE CLASSIQUE ET QUE JE NE SUPPORTE PAS CELA",
+ "ET MAINTENANT QUE JE LUI AI MIS DEHORS, COMMENT JE LUI PAIE POUR QU'IL JOUE CE QUE JE VEUX",
+ "ET ENCORE IL S'EST MONTR\220 ARROGANT... -ET DIRE QU'IL PARAISSAIT UNE SAINTE-NITOUCHE!",
+ "...FAITES ATTENTION, ON VIENT DE CIRER LE PARQUET",
+ "SILENCE! ON VOIT LE MATCH!",
+ "OH L\267 L\267! TIENS!",
+},
+{
+ "",
+ "CHE SUCCEDE, CHE SUCCEDE?",
+ "D'ACCORDO. CAMERA 512. DEVE SALIRE LE SCALE. LA CHIAVE \324 NELLA PORTA",
+ "IL CONDE DRASCULA?",
+ "NO, NIENTE. QUEL TIZIO HA MALA REPUTAZIONE QU\336",
+ "SE DICONO MOLTE COSE SU LUI. COME CH'\324 UN VAMPIRO E SEQUESTRA GENTE PER BERE LA SUA SANGUE",
+ "ALTRI DICONO CHE SOLO \324 UN TRAFFICANTE DI ORGANI, PER QUELLO TROVIAMO GENTE SQUARTATA FUORI LE MURA",
+ "SONO SOLTANTO CHIACCHIERE. FORSE SIA LE DUE COSE. MA, PERCHE VUOLE TROVARE QUEL TIZIO?",
+ "NO, HO MOLTO DA FARE..",
+ "VA BENE, MA PERCHE VOGLIO IO, NON PERCHE L'ABBIA DETTO TU",
+ "ADESSO VINCONO",
+ "LASCIAMI IN PACE, O.K.?",
+ "CERTO, NON SONO CIECO",
+ "C'\324 LA TRADIZIONE NEL PAESE DI DIMENTICARE I RANCORI QUANDO C'\324 PARTITA DI CALCIO; PER ANIMARE LA SELEZIONE",
+ "TI HO DETTO DI STARE ZITTO, NON RIESCO A SENTIRE",
+ "LASCIAMI IN PACE E NON MI DISTURBARE",
+ "\324 APPENA COMINCIATO, ZITTO!",
+ "AH, BENE. HO PENSATO CHE SUCCEDEVA QUALCOSA",
+ "NO, NON FA NIENTE. ADESSO SICURO CH'\324 GI\267 MORTA",
+ "SI \324 MESSO A SUONARE MUSICA CLASSICA ED IO LA ODIO",
+ "\324 COME FACCIO PER SENTIRE QUELLO CHE VOGLIO SE L'HO LICENZIATO",
+ "E ORA SI METTE BULLO...-E SEMBRAVA PROPRIO SCEMO!",
+ "...SENTA! FACCIA ATTENZIONE. IL PAVIMENTO \324 APPENA INCERATO",
+ "ZITTO! - STIAMO GUARDANDO LA PARTITA!",
+ "DAI! PRENDI",
+},
+};
+
+
+const char *_textvb[][63] = {
+{
+ "",
+ "WHO THE HELL IS CALLING AT THIS TIME?",
+ "OH, ..OH, NO, NO....I'M...GANIMEDES THE DWARF. PROFESSOR VON BRAUN DOESN'T LIVE HERE ANYMORE",
+ "NO, I DON'T KNOW WHERE IT IS !!",
+ "GET OUT!!",
+ "IT'S TOO LATE NOW, YOU IDIOT!! IT ALWAYS IS",
+ "I COULDN'T AGREE MORE",
+ "ME, SCARED?",
+ "LISTEN HERE, DUDE. YOU'RE RIGHT NOW TALKING TO THE ONLY PERSON WHO KNOWS THE SECRET TO FIGHT AGAINST THE VAMPIRE",
+ "YOU NEED TO HAVE SPECIAL SKILLS TO FIGHT AGAINST A VAMPIRE. NOT EVERYBODY CAN DO IT",
+ "YOU DON'T HAVE THEM",
+ "I'M SURE YOU WOULDN'T BET ALL YOUR MONEY ON IT, HUH?",
+ "WELL, ALL RIGHT, COME ON IN",
+ "IF YOU REALLY MEAN TO FACE DRASCULA, YOU'VE GOT TO BE ABLE TO TAKE ALL TYPES OF CREAKING AND VAMPIRE-LIKE NOISES",
+ "IS THAT CLEAR?",
+ "OK, WAIT A MINUTE",
+ "STAND IN THE CENTER OF THE ROOM, PLEASE",
+ "WHERE DID I PUT THAT RECORD CALLED \"NAILS SCRATCHING THE BLACKBOARD\"?",
+ "ALL RIGHT. LET'S GET TO IT",
+ "YOU ARE USELESS. YOU SEE...?, JUST LIKE THE REST!!",
+ "JUST GIVE ME NOW THE MONEY YOU LOST AND GET OUT OF HERE",
+ "AND DON'T COME BACK UNTIL YOU ARE ABSOLUTELY READY",
+ "WHAT DO YOU WANT NOW?",
+ "I HAVE TO ADMIT IT. YOU REALLY GOT WHAT IT TAKES TO FIGHT AGAINST THE VAMPIRES",
+ "HEY, TAKE YOUR MONEY. I ADMIT IT WHEN I MAKE A MISTAKE...",
+ "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",
+ "YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTICS POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE",
+ "YOU'D BE LOST IF IT WASN'T FOR THEY...",
+ "...BREW!",
+ "YEAH, YOU'RE RIGHT! I MIGHT HAVE SOME PROBLEMS WITH MY BACK IN THE FUTURE IF I KEEP ON SLEEPING THIS WAY",
+ "I UNDERSTAND HE WAS A BETTER OPPONENT THAN ME, BUT YOU HAVE TO ADMIT THAT THE DISCOVERY I MADE ABOUT ANTI-VAMPIRE TECHNIQUES WAS WHAT ACTUALLY PROTECTED ME",
+ "I'VE FOUND THIS IMMUNIZING BREW THAT KEEPS YOU SAFE FROM ANY VAMPIRES' BITE OR AGAINST HIS FRISISNOTICS POWERS",
+ "NO, NO, EXCUSE ME. I HAD IT ONCE BUT IT'S VERY DANGEROUS TO HAVE A BREW OF THAT TYPE. CAN YOU IMAGINE WHAT COULD HAPPEN IF A VAMPIRE GOT IT?",
+ "HE'D BE IMMUNIZED AGAINST GARLIC, THE SUNSHINE LIGHT... SO I HAD TO GET RID OF WHAT I DIN'T USE BY THE SCIENTIFIC METHOD OF THROWING IT IN THE LAVATORY",
+ "DON'T WORRY, I REMEMBER EXACTLY HOW TO MAKE THAT BREW",
+ "I NEED GARLIC, BUT I ALREADY HAVE THEM. HOWEVER YOU'LL HAVE TO GET ME SOME WAX, BUBBLE GUM AND CIGARETTE PAPER OR PERHAPS A NAPKING OR SOMETHING ALIKE",
+ "OH...AND OF COURSE THE MOST IMPORTANT INGREDIENT. LEAVES FROM A VERY STRANGE PLANT CALLED FERNAN",
+ "IT'S A CLIMBING PLANT WHICH LEAVES HAVE MAGIC POWERS IF THEY'RE CUT WITH A GOLDEN SICKLE",
+ "SO THAT AS SOON AS YOU HAVE THESE FIVE THINGS, JUST COME HERE AND I'LL MAKE THE BREW",
+ "YOU'LL BE READY THEN TO FIGHT AGAINST DRASCULA",
+ "REMEMBER: WAX, NICOTINE, A PIECE OF BUBBLE GUM, A PAPER AND SOME FERNAN'S LEAVES CUT WITH A GOLDEN SICKLE",
+ "I TOLD YOU! IT WAS JUST BECAUSE OF THE BREW!",
+ "OH, ALL RIGHT. I'M GOING TO MAKE MYSELF A...THE BREW. JUST A MOMENT, OK?",
+ "IT'S A PROTECTING SPELL AGAINST VAMPIRES",
+ "I PUT IT THERE IN ORDER TO PRETEND THAT THE SKETCHER DIDN'T FORGET TO DRAW THE WINDOW YOU CAN SEE FROM OUTSIDE",
+ "ALL RIGHT, THE FIRST THING YOU MUST KNOW IS THE WAY TO DRASCULA'S CASTLE",
+ "THERE IS A CAVERN THAT GETS YOU STRAIGHT FROM THE CASTLE. IGOR, THE CRAZY ELVIS' FUN, TAKES IT TO GET TO THE VILLAGE EACH MORNING",
+ "BE CAREFUL THOUGH, THERE IS A VAMPIRE ALWAYS WATCHING OVER IT. YOU'LL HAVE TO GET RID OF HIM",
+ "THERE IS AN OLD WELL RIGHT BY THE CEMETERY CHURCH",
+ "IT WAS USED A LONG TIME AGO FOR WITCHCRAFT TRIALS",
+ "THEY THREW THE WITCHES IN THE WELL. IF THEY DROWNED THEY WERE REAL WITCHES. IF THEY DIDN'T, THEY WEREN'T",
+ "WE THREW ONE ONCE AND SHE DIDN'T DROWN, I GUESS SHE WASN'T A WITCH",
+ "ANYWAY. THERE IS YOUR BREW. HOWEVER, I ONLY GOT TO MAKE ENOUGH JUST FOR ONE PERSON",
+ "YOU'D BETTER SMOKE IT RIGHT BEFORE YOU FIGHT AGAINST DRASCULA",
+ "COME ON, RUN!",
+ "OH, JUST EXCUSES...!",
+ "ARE YOU JOHN HACKER? I'M DOCTOR VON BRAUN",
+ "LISTEN TO ME, THIS IS VERY IMPORTANT. IT'S ABOUT THE BREW",
+ "SHUT UP AND LET ME TALK. I JUST FOUND THIS BOOK ABOUT ANTI-VAMPIRE BREWS WARNING AGAINST MIXING THE JOINT WITH ANY ALCOHOLIC DRINK BEFORE YOU",
+ "ALCOHOL REACTS WHEN MIXED WITH BREW, SO THAT IT CANCELS OUT ITS EFFECTS JUST IN A FEW SECONDS",
+ "I'M SORRY, BUT I HAVE TO HANG UP RIGHT NOW. THE POLICE IS LOOKING FOR ME, THEY THINK I'M A PUSHER. STUPIDS!. ANYWAY, BYE AND GOOD LUCK SAVING THE WORLD!",
+},
+{
+ "",
+ "\250QUIEN DIABLOS LLAMA A ESTAS HORAS?",
+ "EH... NO, NO. YO SOY EL ENANO GANIMEDES... EL PROFESOR VON BRAUN YA... YA NO VIVE AQUI",
+ "\255NO, NO SE DONDE ESTA!",
+ "\255QUE TE VAYAS! ",
+ "IMBECIL. YA ES DEMASIADO TARDE, SIEMPRE LO ES",
+ "ESTOY TOTALMENTE DE ACUERDO",
+ "\250YO MIEDO?",
+ "ENTERATE CHAVAL: ESTAS HABLANDO CON EL UNICO QUE CONOCE EL SECRETO PARA ENFRENTARSE A LOS VAMPIROS",
+ "NO TODO EL MUNDO ES CAPAZ DE LUCHAR CON UN VAMPIRO. HAY QUE TENER UNAS CUALIDADES ESPECIALES",
+ "NO LAS TIENES",
+ "\250TE APUESTAS TODO TU DINERO A QUE NO?",
+ "ESTA BIEN. PASA",
+ "SI DE VERDAD ERES CAPAZ DE ENFRENTARTE A DRASCULA, DEBER PODER SOPORTAR TODOS LOS RUIDOS CHIRRIANTES Y VAMPIRICOS",
+ "\250QUEDA CLARO?",
+ "DE ACUERDO. ESPERA UN MOMENTO",
+ "POR FAVOR, PONTE EN EL CENTRO DE LA HABITACION",
+ "VEAMOS. \250DONDE HE PUESTO EL DISCO ESTE DE \"U\245AS ARRASCANDO UNA PIZARRA\"?",
+ "MUY BIEN. VAMOS ALLA",
+ "\250VES? ERES UN INUTIL, COMO TODOS LOS DEMAS",
+ "AHORA DAME EL DINERO QUE HAS PERDIDO Y VETE DE AQUI",
+ "Y NO VUELVAS HASTA QUE NO ESTES PREPARADO DEL TODO",
+ "\250Y QUE ES LO QUE QUIERES TU AHORA?",
+ "HE DE RECONOCERLO... TIENES APTITUDES PARA LUCHAR CON LOS VAMPIROS",
+ "POR CIERTO, TOMA TU DINERO. SE CUANDO ME HE EQUIVOCADO",
+ "AHORA VETE, QUE QUIERO DORMIR UN POCO",
+ "CUANDO ESTES DISPUESTO A ENFRENTARTE A ALGUN VAMPIRO, VUELVE Y TE AYUDARE EN LO QUE PUEDA",
+ "OH, ESO ES FACIL. LA LUZ DEL SOL O UN CRUCIFIJO Y LE HACES POLVO",
+ "CON EL QUE DEBES PONER ESPECIAL CUIDADO ES CON DRASCULA. SUS PODERES FRISISHNOSTICOS LE HACEN EL MAS PODEROSO DE LOS VAMPIROS",
+ "ESTARIAS PERDIDO A NO SER POR LA...",
+ "...\255POCION!",
+ "OH, CLARO. TIENES RAZON, SI SIGO DURMIENDO ASI A LO MEJOR TENGO PROBLEMAS DE COLUMNA CUANDO SEA VIEJO",
+ "BUENO, ADMITO QUE RESULTO MEJOR ADVERSARIO QUE YO, PERO MI PRINCIPAL HALLAZGO EN EL ESTUDIO DE TECNICAS ANTI-VAMPIROS FUE LO QUE ME CUBRIO LAS ESPALDAS",
+ "DESCUBRI UNA POCION DE INMUNIDAD. TE HACE INVULNERABLE ANTE CUALQUIER MORDEDURA DE VAMPIRO, O A SUS PODERES FRSISSHNOTICOS",
+ "NO, PERDONA LA TUVE EN SU DIA, PERO UNA POCION DE ESAS CARACTERISTICAS ES PELIGROSA. IMAGINATE SI CAYERA EN MANOS DE UN VAMPIRO",
+ "LE HARIA INMUNE A LOS AJOS, A LA LUZ DEL SOL... ASI QUE TUVE QUE DESHACERME DE LO QUE NO USE POR EL CIENTIFICO METODO DE TIRARLO A LA TAZA DEL WATER",
+ "TRANQUILO, ME ACUERDO PERFECTAMENTE DE COMO PREPARAR ESA POCION ",
+ "NECESITO AJOS, QUE DE ESO YA TENGO, PERO ME TENDRAS QUE CONSEGUIR ALGO DE CERA, NICOTINA, UN CHICLE, Y UN PAPEL DE FUMAR, O UNA SERVILLETA, O ALGO PARECIDO",
+ "\255AH! Y POR SUPUESTO, EL INGREDIENTE PRINCIPAL: UNAS HOJAS DE UNA EXTRA\245A PLANTA LLAMADA FERNAN",
+ "SE TRATA DE UNA PLANTA ENREDADERA CUYAS HOJAS PROPORCIONAN PODERES MAGICOS SI SE CORTAN CON UNA HOZ DE ORO",
+ "PUES YA SABES, EN CUANTO TENGAS ESAS CINCO COSAS ME LAS TRAES Y TE PREPARARE LA POCION",
+ "DESPUES ESTARAS LISTO PARA LUCHAR CON DRASCULA",
+ "RECUERDA: CERA, NICOTINA, UN CHICLE, UN PAPEL Y UNAS HOJAS DE FERNAN, LA PLANTA, CORTADAS CON UNA HOZ DE ORO",
+ "\255YA TE LO HE DICHO! FUE TODO GRACIAS A LA POCION",
+ "AH, MUY BIEN. VOY ENTONCES A PREPARARME EL PO... LA POCION. SOLO TARDO UN MOMENTO",
+ "ES UN SORTILEGIO DE PROTECCION CONTRA VAMPIROS",
+ "LO PUSE PARA DISIMULAR QUE EL DIBUJANTE SE OLVIDO DE PONER LA VENTANA QUE SE VE DESDE FUERA",
+ "BUENO, LO PRIMERO QUE DEBES SABER ES COMO SE VA AL CASTILLO DRASCULA",
+ "HAY UNA GRUTA QUE LLEVA DIRECTAMENTE AL CASTILLO Y QUE ESE LOCO FAN DE ELVIS, IGOR, USA PARA BAJAR AL PUEBLO POR LAS MA\245ANAS",
+ "PERO TEN CUIDADO, SIEMPRE ESTA PROTEGIDA POR UN VAMPIRO. TENDRAS QUE LIBRARTE DE EL",
+ "HAY UN VIEJO POZO AL LADO DE LA CAPILLA DEL CEMENTERIO",
+ "SE USABA ANTIGUAMENTE PARA JUZGAR CASOS DE BRUJERIA",
+ "SE TIRABA A LAS BRUJAS AL POZO. SI SE HUNDIAN ERAN BRUJAS. SI NO, NO",
+ "UNA VEZ TIRAMOS A UNA Y NO SE HUNDIO, ASI QUE NO SERIA BRUJA",
+ "A LO QUE VAMOS: TOMA TU POCION, PERO SOLO ME HA DADO PARA UNO",
+ "LO MEJOR ES QUE TE LO FUMES JUSTO ANTES DE ENFRENTARTE A DRASCULA",
+ "CORRE",
+ "\255EXCUSAS!",
+ "\250JOHN HACKER? SOY EL DOCTOR VON BRAUN",
+ "ESCUCHEME, ES MUY IMPORTANTE. ES SOBRE LA POCION",
+ "ME HE ENCONTRADO UN LIBRO SOBRE POCIONES Y DICE QUE NO DEBE USTED BEBER ALCOHOL UNA VEZ SE HAYA FUMADO LA POCION",
+ "EL ALCOHOL INGERIDO REACCIONA CON LAS SUSTANCIAS DE LA POCION Y ANULA SUS EFECTOS EN DECIMAS DE SEGUNDO",
+ "TENGO QUE COLGAR. LA POLICIA ME BUSCA. DICEN QUE TRAFICO CON DROGAS \255IGNORANTES! BUENO, ADIOS Y SUERTE SALVANDO AL MUNDO",
+},
+{
+ "WER ZUM TEUFEL KLINGELT UM DIESE UHRZEIT ?",
+ "aeH......NEIN, NEIN. ICH BIN HELGE SCHNEIDER...HERR PROFESSOR VON BRAUN ...aeH...WOHNT HIER NICHT MEHR",
+ "NEIN, ICH WEISS NICHT WO ER IST !",
+ "NUN GEH SCHON !",
+ "TROTTEL. ES IST SCHON ZU SPaeT, WIE IMMER",
+ "ICH BIN ABSOLUT EINVERSTANDEN",
+ "ICH UND DIE HOSEN VOLL ?",
+ "DAMIT DAS KLAR IST, KURZER : DU SPRICHST GERADE MIT DEM EINZIGEN DER DAS GEHEIMREZEPT GEGEN VAMPIRE HAT",
+ "NICHT JEDER KANN GEGEN EINEN VAMPIR ANTRETEN.MAN MUSS EIN PAAR GANZ BESONDERE EIGENSCHAFTEN BESITZEN",
+ "DU HAST SIE NICHT",
+ "WETTEN NICHT ? 100.000 MARK, DASS NICHT !",
+ "SCHON GUT, KOMM REIN",
+ "WENN DU DICH DRACULA WIRKLICH STELLEN WILLST WIRST DU ALLE DIESE VAMPIRTYPISCHEN SAUG-UND QUIETSCHGERaeUSCHE ERTRAGEN MueSSEN",
+ "IST DAS KLAR ?",
+ "O.K. WARTE MAL EINEN MOMENT",
+ "STELL DICH BITTE MAL IN DIE MITTE DES ZIMMERS",
+ "GUCKEN WIR MAL. WO IST DIESE PLATTE MIT\"FINGERNaeGEL KRATZEN AN DER TAFEL ENTLANG\" ?",
+ "SEHR GUT, GEHEN WIR DA HIN",
+ "SIEHST DU, DU BIST GENAUSO UNFaeHIG WIE ALLE ANDEREN !",
+ "JETZT GIB MIR DAS GELD,UM DAS WIR GEWETTET HABEN UND KOMM HER",
+ "UND KOMM ERST DANN WIEDER, WENN DU 100%IG VORBEREITET BIST",
+ "UND WAS WILLST DU JETZT ?",
+ "ICH MUSS ZUGEBEN, DASS DU DAS NoeTIGE TALENT ZUR VAMPIRJAGD HAST",
+ "ueBRIGENS, HIER IST DEIN GELD. ICH HABE MICH GEIRRT",
+ "UND JETZT GEH, ICH MoeCHTE MICH HINLEGEN",
+ "KOMM ZURueCK,WENN DU SO WEIT BIST, DICH EINEM VAMPIR GEGENueBERZUSTELLEN UND ICH WERDE DIR HELFEN",
+ "ACH, DAS IST GANZ EINFACH. EIN SONNENSTRAHL ODER EIN KRUZIFIX UND ER WIRD ZU STAUB",
+ "AM MEISTEN AUFPASSEN MUSST DU BEI DRASCULA..WEGEN SEINEN TRANSHYPNITISCHEN FaeHIGKEITEN IST ER DER GEFaeHRLICHSTE UNTER DEN VAMPIREN",
+ "DU WaeRST VERLOREN, ES SEI DENN DU HaeTTEST...",
+ "....DIE MISCHUNG! ",
+ "JA, STIMMT, DU HAST RECHT. WENN ICH WEITERHIN SO LIEGE WERDE ICH IM HOHEN ALTER WOHL RueCKENPROBLEME HABEN",
+ "NAJA, ICH GEBE ZU DASS ER der bessere von uns war, ABER DIE WICHTIGSTE ERKENNTNIS IN MEINEM ANTI-VAMPIR-STUDIUM WAR, MIR EINEN BODYGUARD ZUZULEGEN",
+ "ICH HABE EINE IMMUNITaeTSMISCHUNG GEFUNDEN. MIT DER KANN DIR KEIN EINZIGER VAMPIRBISS ETWAS ANHABEN, UND AUCH NICHT SEINE TRANSHYPNISIE.",
+ "NEIN, TUT MIR LEID, ICH HATTE SIE damals, ABER EINE MISCHUNG DIESER KONSISTENZ IST SEHR GEFaeHRLICH, UND STELL DIR MAL VOR, ES GERaeT IN VAMPIRHaeNDE",
+ "DAS WueRDE IHN IMMUN GEGEN KNOBLAUCH UND SONNENLICHT GEMACHT HABEN, DIE RESTE, DIE ICH NICHT MEHR FueR WISSENSCHAFTLICHE ZWECKE BRAUCHTE, landeten im klo",
+ "NUR DIE RUHE, ICH HABE DAS REZEPT KOMPLETT IM KOPF ",
+ "ICH BRAUCHE KNOBLAUCH,AH, HAB ICH SCHON, ABER DANN MUSST DU NOCH WACHS BESORGEN, NIKOTIN, KAUGUMMI UND EIN BLaeTTCHEN ODER EINE SERVIETTE ODER SO WAS",
+ "ACH KLAR ! UND DIE WICHTIGSTE ZUTAT : EIN PAAR BLaeTTER EINER SELTSAMEN PFLANZE DIE FREDDY HEISST",
+ "ES HANDELT SICH UM EINE TOPFBLUME DEREN BLaeTTER ZAUBERKRaeFTE HABEN, WENN MAN SIE MIT EINER GOLDSICHEL ABSCHNEIDET",
+ "ALSO, DU WEISST SCHON, SOBALD DU MIR DIESE FueNF ZUTATEN GEBRACHT HAST, BEREITE ICH DIR DIE MISCHUNG ZU",
+ "DANACH BIST DU FueR DEN KAMPF GEGEN DRASCULA GERueSTET",
+ "DENK DRAN : WACHS, NIKOTIN, EIN KAUGUMMI, EIN BLaeTTCHEN UND EIN PAAR BLaeTTER VON FREDDY, MIT EINER GOLDSICHEL ABGESCHNITTEN",
+ "HAB ICH DIR DOCH SCHON GESAGT ! NUR DANK DER MISCHUNG",
+ "OK. ALLES KLAR. ICH FANG DANN MAL AN EINEN ZU BAUEN...aeH VORZUBEREITEN. DAUERT AUCH NICHT LANGE",
+ "DAS IST EINE ZAUBERFORMEL, DIE VOR VAMPIREN SCHueTZT",
+ "DAS WAR ICH, DAMIT MAN NICHT MERKT, DASS DER ZEICHNER VERGESSEN HAT DAS FENSTER VON VORHIN ZU ZEICHNEN",
+ "ALSO, ZUERST MUSST DU WISSEN WIE MAN ZUM SCHLOSS VON DRASCULA KOMMT.",
+ "ES GIBT EINE GROTTE, DIE DIREKT ZUM SCHLOSS FueHRT, UND DURCH DIE IGOR, DIESER BEKLOPPTE ELVIS-FAN MORGENS IMMER ZUM DORF RUNTER GEHT",
+ "ABER PASS AUF, SIE WIRD PERMANENT VON EINEM VAMPIR BEWACHT, DEN DU ERSTMAL LOSWERDEN MUSST",
+ "ES GIBT DA EINEN ALTEN BRUNNEN BEI DER FRIEDHOFSKAPELLE",
+ "FRueHER WURDE ER FueR HEXENPROZESSE BENUTZT",
+ "MAN WARF DIE HEXEN IN DEN BRUNNEN. WENN SIE UNTERGINGEN WAREN SIE HEXEN, WENN NICHT, DANN NICHT",
+ "EINMAL WARFEN WIR EINE RUNTER, DIE NICHT UNTERGING, ALSO WAR SIE KEINE HEXE",
+ "WENN WIR LOSGEHEN, NIMMST DU DEINE MISCHUNG, ABER WIR HABEN NUR FueR EINE PERSON",
+ "AM BESTEN RAUCHST DU IHN DIR KURZ BEVOR DU DRACULA GEGENueBERSTEHST",
+ "LAUF !",
+ "BILLIGE AUSREDEN !",
+ "HEINZ HACKER ? ICH BIN DOKTOR VON BRAUN",
+ "HoeREN SIE ZU, ES IST SEHR WICHTIG. ES GEHT UM DIE MISCHUNG",
+ "ICH HABE EIN BUCH ueBER MISCHUNGEN GEFUNDEN UND DA STEHT DASS MAN KEINEN ALKOHOL TRINKEN DARF, SOBALD MAN DIE MISCHUNG GERAUCHT HAT",
+ "DER ALKOHOL REAGIERT IM MAGEN MIT DEN SUBSTANZEN DER MISCHUNG UND VERNICHTET IHRE WIRKUNG BINNEN WENIGER MILLISEKUNDEN",
+ "ICH MUSS AUFLEGEN. DIE POLIZEI IST HINTER MIR HER. DIE IDIOTEN HALTEN MICH FueR EINEN DROGEN-DEALER !ALSO, TSCHueSS UND VIEL GLueCK !",
+},
+{
+ "",
+ "QUI DIABLE APPELLE \267 CETTE HEURE-CI?",
+ "H... NON, NON. JE SUIS LE NAIN GANYM\324DE... LE PROFESSEUR VON BRAUN... N'HABITE DJ\267 L\267",
+ "NON, JE NE SAIS PAS O\353 IL EST!",
+ "VA-T'-EN!",
+ "IMBCIL! C'EST DJ\267 TROP TARD! C'EST TOUJOURS TROP TARD!",
+ "JE SUIS TOUT-\267-FAIT CONFORME",
+ "MOI PEUR?",
+ "RENSEIGNE-TOI, MON GARS: TU PARLES AVEC LE SEUL QUI CONNA\327T LE SECRET POUR CONFRONTER LES VAMPIRES",
+ "TOUT LE MONDE N'EST PAS CAPABLE DE LUTTER AVEC UN VAMPIRE. IL FAUT DES QUALITS SPCIALES",
+ "TU NE LES A PAS",
+ "EST-CE QUE TU PARIE TOUT L'ARGENT QUE TU AS \267 QUE C'EST NON?",
+ "\200A VA, ENTRE",
+ "SI EN V\220RIT\220 TU TE SENS CAPABLE DE CONFRONTER DRASCULA, IL FAUDRA QUE TU SUPPORTES TOUS LES BRUITS GRIN\200ANTS ET SU\200ANTS",
+ "C'EST CLAIR?",
+ "D'ACCORD. ATTENDS UN INSTANT",
+ "METS-TOI AU MILIEU DE LA CHAMBRE, S'IL TE PLA\327T",
+ "VOYONS! O\353 EST-CE QUE J'AI MIS LE DISQUE \"ONGLES GRATTANT UN TABLEAU\"?",
+ "TR\324S BIEN. ON Y VA",
+ "TU VOIS? TU ES UN INCAPABLE, COMME TOUS LES AUTRES",
+ "MAINTENANT DONNE-MOI L'ARGENT QUE TU AS PERDU ET VA-T'-EN",
+ "ET N'Y REVIENS \267 MOINS QUE TU SOIS COMPL\324TEMENT EN FORME",
+ "ET QUE VEUX-TU MAINTENANT?",
+ "JE DOIS LE RECONNA\327TRE... TU AS DES APTITUDES POUR LUTTER CONTRE LES VAMPIRES",
+ "EN FAIT, TIENS TON ARGENT. JE SAIS RECONNA\327TRE MES ERREURS",
+ "MAINTENANT VA-T'-EN, JE VEUX DORMIR UN PEU ",
+ "QUAND TU SOIS PR\322T \267 TE CONFRONTER AVEC UN VAMPIRE, REVIENS ET TU POURRAS COMPTER SUR MOI",
+ "OH! C'EST FACIL. AVEC LA LUMI\324RE DU SOLEIL OU UN CRUCIFIX TU LE R\220DUIT EN CENDRES",
+ "MAIS TU DOIS FAIRE SP\220CIALE ATTENTION AVEC DRASCULA. GR\266CE \267 SES POUVOIRS FRISYSHNOSTIQUES C'EST LE PLUS PUISSANT DES VAMPIRES",
+ "JE SERAIS PERDU SI CE N'EST PAS POUR LA...",
+ "...POTION!",
+ "OH, BIEN S\352R. TU AS RAISON, SI JE CONTINUE \267 DORMIR COMME \200\265, J'AURAI DES PROBL\324MES DE COLONNE DANS MA VIEILLESSE",
+ "bon, J'ACCEPTE QU'IL A \220T\220 MEILLEURE ADVERSAIRE QUE MOI, MAIS JE ME SUIS GARD\220 LE DOS GR\266CE \267 MA BONNE TROUVAILLE DANS L'\220TUDE DE TECHNIQUES ANTI-VAMPIRES",
+ "J'AI D\220COUVERT UNE POTION IMMUNOLOGIQUE QUI TE FAIT INVULN\220RABLE CONTRE N'IMPORTE QUELLE MORSURE DE VAMPIRE OU SES POUVOIRS FRSYSSHNOTIQUES",
+ "NON, EXCUSES-MOI. JE L'AI EUE, MAIS UNE POTION DE CES CARACT\220RISTIQUES EST DANGEREUSE. IMAGINE TOI SI ELLE TOMBAIT DANS LES MAINS D'UN VAMPIRE",
+ "IL DEVIENDRAIT IMMUNIS\220 AUX AILS, \267 LA LUMI\324RE DU SOLEIL. DONC, J'AI D\352 M'EN D\220BARRASSER DES EXC\220DENTS PAR LA SCIENTIFIQUE M\220THODE DE LES JETER AUX \220GOUTS",
+ "RESTE TRANQUILLE, JE ME SOUVIENS PARFAITEMENT DE LA PR\220PARATION DE CETTE POTION",
+ "il me faut D'AIL, MAIS J'EN AI D\220J\267. IL FAUDRA UN PEU DE CIRE, DE LA NICOTINE, UN CHEWING-GUM ET UN PAPIER \267 CIGARETTES, OU QUELQUE CHOSE PAREILLE",
+ "AH! ET CERTAINEMENT, L'INGR\220DIANT PRINCIPAL: LES FEUILLES D'UNE \220TRANGE PLANTE APPEL\220E FERNAN",
+ "IL S'AGIT D'UNE PLANTE GRIMPANTE DONT LES FEUILLES FOURNISSENT DES POUVOIRS MAGIQUES SI ON LES COUPE AVEC UNE FAUCILLE EN OR",
+ "TU LE SAIS D\220J\267. D\324S QUE TU AURAS CES CINQ TRUCS APPORTE-LES-MOI ET JE TE PR\220PARERAI LA POTION",
+ "APR\324S TU SERAS PR\322T POUR LUTTER CONTRE DRASCULA",
+ "RAPPELLE-TOI: DE LA CIRE, DE LA NICOTINE, UN CHEWING-GUM, UN PAPIER ET LES FEUILLES DE FERNAN, LA PLANTE, COUP\220ES AVEC UNE FAUCILLE EN OR",
+ "JE TE L'AI D\220J\267 DIT! TOUT A \220T\220 GR\266CE \267 LA POTION",
+ "AH! TR\324S BIEN! ALORS, JE VAIS ME PR\220PARER LE PO... LA POTION. JE N'AI QUE POUR UN MOMENT",
+ "C'EST UN SORTIL\324GE DE PROTECTION CONTRE-VAMPIRES",
+ "JE L'AI MIS POUR DISSIMULER, LE DESSINATEUR AYANT OUBLI\220 D'Y METTRE LA FEN\322TRE QU'ON VOIT DU DEHORS",
+ "EH BIEN, CE QUE TU DOIS SAVOIR D'ABORD C'EST LA FA\200ON D'ALLER AU CH\266TEAU DE DRASCULA",
+ "IL Y A UNE GROTTE QUI M\324NE DIRECTEMENT AU CH\266TEAU ET QU'IGOR, CE FOU FAN D'ELVIS, EN UTILISE POUR SE RENDRE AU VILLAGE LE MATIN",
+ "MAIS FAIT ATTENTION, ELLE TOUJOURS GARD\220E PAR UN VAMPIRE. TU DEVRAS T'EN D\220BARRASSER",
+ "IL Y A UN VIEUX PUITS \267 C\342T\220 DE LA CHAPELLE DU CIMETI\324RE",
+ "ON L'UTILISAIT JADIS POUR JUGER DES AFFAIRES DE SORCELLERIE",
+ "ON JETAIT LES SORCI\324RES AU PUITS. SI ELLES COULAIENT, ON \220TAIT S\352R; AUTREMENT, PAS",
+ "UNE FOIS ON A JET\220 UNE ET ELLE N'AS PAS COUL\220, DONC ELLE NE SERAIT PAS UNE SORCI\324RE",
+ "MAINTENANT GARDE \267 LA QUESTION QUI NOUS INT\220RESSE: TIENS TA POTION, MAIS ON NE M'A PAS DONN\220 QUE POUR UN SEULEMENT.",
+ "IL VAUDRA MIEUX QUE TU LA FUMES JUSTE AVANT DE CONFRONTER DRASCULA",
+ "COURS!",
+ "DES EXCUSES!",
+ "JHON HACKER? SUIS LE DOCTEUR VON BRAUN",
+ "\220COUTEZ-MOI. C'EST TR\324S IMPORTANT. C'EST SUR LA POTION",
+ "DANS UN LIVRE QUE J'AI TROUV\220 SUR LES POTIONS, IL DIT QUE VOUS NE DEVEZ PAS BOIR DE L'ALCOOL APR\324S AVOIR FUM\220 LA POTION ",
+ "L'ALCOOL AVAL\220 R\220AGIT AVEC LES INGR\220DIENTS DE LA POTION ET ANNULE SES EFFETS EN DIXI\324MES DE SECONDE",
+ "JE DOIS RACCROCHER. SUIS CHERCH\220 PAR LA POLICE. ILS DISENT QUE JE TRAFIQUE EN DROGUES -IGNORANTS! AU REVOIR ET BONNE CHANCE EN SAUVANT LE MONDE",
+},
+{
+ "",
+ "MA CHI BUSSA A QUESTE ORE?",
+ "EH...NO,NO. IO SONO IL NANNO GANIMEDI....IL PROFESSORE VON BRAUN NON ABITA QU\336 PI\353",
+ "NO, NON SO DOV'\324!",
+ "HO DETTO VIA!",
+ "IMBECILE. ORMAI TROPPO TARDE, SEMRE TARDE",
+ "SONO COMPLETAMENTE D'ACCORDO",
+ "IO, PAURA?",
+ "ASCOLTA BENE RAGAZZO: STAI PARLANDO CON L'UNICA PERSONA CHE CONOSCE IL SEGRETO PER VINCERE AI VAMPIRI",
+ "NON TUTTI QUANTI POSSONO LOTTARE CON UN VAMPIRO. SI DEVONO AVERE DELLE CARATTERISTICHE SPEZIALI",
+ "NO CE LE HAI",
+ "SICURO CHE NON SCOMMETI TUTTO IL TUO SOLDI!",
+ "VA BENE . AVANTI",
+ "SE DAVVERO SEI PRONTO PER LOTTARE CONTRO DRASCULA, DEVI POTERE SOPPORTARE TUTTI I RUMORI STRIDENTI E VAMPIRICI",
+ "TUTTO CHIARO?",
+ "D'ACCORDO. ASPETTA UN ATTIMO",
+ "PER FAVORE, METTETI NEL CENTRO DELLA CAMERA",
+ "DOV'\324 HO MESSO IL COMPACT DISC DI \"UNGHIE GRAFFIANDO UNA LAVAGNA\"",
+ "MOLTO BENE, ANDIAMO",
+ "VEDI? SEI UN INUTILE, COME TUTTI GLI ALTRI",
+ "ORA DAMI IL SOLDI CHE HAI PERSO, E VIA",
+ "E NON TORNARE FINO CHE NON SIA COMPLETAMENTE PRONTO",
+ "E COSA VUOI TU ADESSO?",
+ "DEVO AMMETTERLO... HAI LA STOFFA DI LOTTATORE PER VINCERE DRASCULA",
+ "EH..! PRENDI IL TUO SOLDI. SO QUANDO HO SBAGLIATO",
+ "ADESSO VATENE, VOGLIO DORMIRE UN P\343",
+ "QUANDO SIA DISPOSTO A UCCIDERE QUALCHE VAMPIRO, TORNA E TI AIUTER\343 ",
+ "QUELLO \324 FACILE. LA LUCE DEL SOLE O UN CROCIFISSO, E L'HAI SCHISCCIATO",
+ "CON CHI DEVI FARE MOLTA ATTENZIONE \324 CON DRASCULA. I SUOI POTERI FRISISHNOSTICI GLI FANNO IL PI\353 FORTE DEI VAMPIRI",
+ "NON POTREI FARE NULLA SE NON FOSSE PER LA .....",
+ "...POZIONE!",
+ "CERTO. HAI RAGIONE, SE CONTINUO DORMENDO COS\336 FORSE AVR\343 PROBLEMI DI SCHIENA QUANDO SIA VECCHIO",
+ "BENE, \324 VERO CHE FU MEGLIO LOTTATORE DI ME, MA IL MIO STUDIO SU TECNICHE ANTI-VAMPIRI GLI AIUT\343 MOLTISSIMO",
+ "HO SCOPERTO UNA POZIONE DI IMMUNUT\267 . TI FA INVULNERABILE AI MORSI DI VAMPIRI, O AI SUOI POTERI FRISISHNOTICI",
+ "NO, SCUSA, CE L'EBBI MOLTO TEMPO FA, MA UNA POZIONE COM'ERA LA MIA \324 PERICOLOSA. FIGURATI SE LA AVESSE UN VAMPIRO",
+ "GLI FAREBBE IMMUNE AGLI AGLII, ALLA LUCE DEL SOLE.... PER QUELLO L'HO SCARICATA NEL CESO",
+ "TRANQUILLO, MI RICORDO BENISSIMO DI COME RIFARLA",
+ "BISOGNO AGLII, CHE NE HO QU\326, DOVRAI PORTARMI UN P\220 DI CERA, NICOTINA, UNA GOMMA, E UNA CARTINA O UN TOVAGLIOLO, O QUALCOSA DEL GENERE",
+ "-AH! E COME NO, L'INGREDIENTE PRINCIPALE: DELLE FOGLIE DI UNA STRANA PIANTA CHIAMATA FERDINAN",
+ "\324 UNA PIANTA CONVOLVOLO, LE SUE FOGLIE PROPORZIONANO POTERI MAGICI SE SONO TAGLIATE DA UNA FALCE D'ORO",
+ "ALLORA, PORTAMI QUESTE CINQUE COSE E FAR\343 PER TE LA POZIONE",
+ "DOPO SAREI PRONTO PER UCCIDERE DRASCULA",
+ "RICORDA: CERA, NICOTINA, UNA GOMMA, UNA CARTINA E FOGLIE DI FERDINAN, LA PIANTA, TAGLIATE DA UNA FALCE D'ORO",
+ "TI L'HO GI\267 DETTO! FU TUTTO GRAZIE ALLA POZIONE",
+ "AH, MOLTO BENE. DUNQUE VADO A FARE LA CAN......LA POZIONE. SAR\267 UN ATTIMINO",
+ "\324 SOLTANTO UN SORTILEGIO DI PROTEZIONE CONTRO VAMPIRI",
+ "L'HO MESSO PER DISSIMULARE CHE IL DISEGNATORE HA DIMENTICATO METTERE LA FINESTRA CHE SI VEDE DA FUORI",
+ "BENE, PRIMA DEVI SAPERE COME ARRIVARE AL CASTELLO DRASCULA",
+ "C'\324 UNAGROTTA CHE VA AL CASTELLO E CHE UTILIZZA QUEL MATTO FAN DI ELVIS, IGOR, PER SCENDERE AL PAESE TUTTE LA MATTINE",
+ "MA FA ATTENZIONE, SEMPRE \220 PROTETTA DA UN VAMPIRO. DOVRAI LIBERARTI DI LUI",
+ "C'\220 UN VECCHIO POZZO ACCANTO ALLA CAPELLA DEL CIMITERO",
+ "SI UTILIZZAVA MOLTO TEMPO FA PER GIUDICARE CASI DI STREGONERIA",
+ "SI BUTTAVANO DENTRO ALLE STREGE. SE SI AFFONDAVANO ERANO STREGHE. SE NO, NO",
+ "UNA VOLTA BUTTAMMO UNA E GALLEGGI\220, DUNQUE NON SAREBBE UNA STREGA",
+ "ORA BEVE LA POZIONE. PECCATO CI SIA SOLTANTO PER UNO",
+ "SAR\265 MEGLIO FUMARLO PROPRIO PRIMA DELLA LOTTA CONTRO DRASCULA",
+ "CORRI1",
+ "SCUSE!",
+ "JOHN HACKER? SONO IL DOTTORE VON BRAUN",
+ "SENTA, \220 MOLTO IMPORTANTE, \220 SULLA POZIONE",
+ "HO TROVATO UN LIBRO SU POZIONI E DICE CHE NON SI DEVE BERE ALCOL DOPO AVERE FUMATO LA POZIONE",
+ "L'ALCOL BEVUTO FA REAZIONE CON LE SOSTANZE DELLA POZIONE E ANNULLA I SUOI EFFETTI IN DECIME DI SECONDO",
+ "DEVO RIATTACARE. LA POLIZIA MI CERCA. DICONO CHE TRAFFICO DROGHE -IGNORANTI! BENE, ALLORA ADIO E IN BOCA IL LUPO",
+},
+};
+
+
+const char *_textsys[][4] = {
+{
+ "PRESS 'DEL' AGAIN TO RESTART",
+ "PRESS 'ESC' AGAIN TO EXIT",
+ "SPEECH ONLY",
+ "TEXT AND SPEECH",
+},
+{
+ "PULSA DE NUEVO SUPR PARA EMPEZAR",
+ "PULSA DE NUEVO ESC PARA SALIR",
+ "SOLO VOCES",
+ "VOZ Y TEXTO",
+},
+{
+ "BETaeTIGEN SIE ERNEUT entf UM ANZUFANGEN",
+ "BETaeTIGEN SIE ERNEUT ESC UM ZU BEENDEN",
+ "NUR STIMMEN",
+ "STIMME UND TEXT",
+},
+{
+ "APPUYEZ \267 NOUVEAU SUR SUPR POUR COMMENCER",
+ "APPUYEZ \267 NOUVEAU SUR ESC POUR SORTIR",
+ "SEULEMENT DES VOIX",
+ "VOIX ET TEXT",
+},
+{
+ "PREMI DI NUOVO SUPR PER COMINZIARE",
+ "PRMI DI NUOVO ESC PER USCIRE",
+ "SOLO SUONI",
+ "SUONI E TESTO",
+},
+};
+
+
+const char *_texthis[][5] = {
+{
+ "",
+ "A long time ago, it seems that Drascula killed Von Braun's wife, and then, as he intended to face the count, Von Braun started to investigate all he found vampires.",
+ "When he thought he was ready, he came up to the castle and had a very violent encounter with Drascula.",
+ "Nobody knows exactly what happened there. Although Von Braun lost, Drascula could not kill him.",
+ "Von Braun felt humiliated by his defect, run away from the castle and has never dared to face Drascula ever again.",
+},
+{
+ "",
+ "",
+ "",
+ "",
+ ""
+},
+{
+ "",
+ "",
+ "",
+ "",
+ ""
+},
+{
+ "",
+ "",
+ "",
+ "",
+ ""
+},
+{
+ "",
+ "",
+ "",
+ "",
+ ""
+},
+};
+
+
+} // End of namespace Drascula
diff --git a/engines/drascula/texts.h b/engines/drascula/texts.h
deleted file mode 100644
index ab647f63ae..0000000000
--- a/engines/drascula/texts.h
+++ /dev/null
@@ -1,761 +0,0 @@
-#define TEXT1 "ITS THE SECOND BIGGEST DOOR I'VE SEEN IN MY LIFE"
-#define TEXT2 "NOT REALLY"
-#define TEXT3 "THE CHURCH IS ALL BOARDED UP, IT MUST HAVE BEEN ABANDONED SEVERAL YEARS AGO"
-#define TEXT4 "I HAVEN'T OPENED IT"
-#define TEXT5 "WHAT SHOULD I DO, SHOULD I PULL IT OFF?"
-#define TEXT6 "HI THERE DOOR, I'M GOING TO MAKE YOU A DOOR-FRAME"
-#define TEXT7 "IT'S TOO MUCH FOR ME"
-#define TEXT8 "THERE'S A WINDOW STOPPING THE GAME FROM WORKING PROPERLY"
-#define TEXT9 "I CAN'T"
-#define TEXT10 "YES, THAT'S DONE"
-#define TEXT11 "WHY?"
-#define TEXT12 "HI WINDOW, ARE YOU DOING ANYTHING TONIGHT?"
-#define TEXT13 "NOT WITHOUT PERMISSION FROM THE TOWN HALL"
-#define TEXT14 "IF ONLY THIS WINDOW WASN'T BOARDED UP..."
-#define TEXT15 "YOO-HOO WINDOW!"
-#define TEXT16 "HI THERE"
-#define TEXT17 "LIKE MICROCHOF'S"
-#define TEXT18 "I CAN'T REACH"
-#define TEXT19 "IT'S ALRIGHT WHERE IT IS"
-#define TEXT21 "ITS A COFFIN IN THE SHAPE OF A CROSS"
-#define TEXT22 "NO THANKS"
-#define TEXT23 "HI DEAD MAN. NO, DON'T GET UP FOR MY SAKE"
-#define TEXT24 "YES, JUST LIKE IN POLTERGEIST"
-#define TEXT27 "I'LL BE BACK IN FIFTEEN MINUTES"
-#define TEXT28 "FORBIDDEN TO PUT UP POSTERS"
-#define TEXT29 "IT'S UNCLE EVARISTO'S TOMB"
-#define TEXT30 "ITS LOCKED"
-#define TEXT31 "I'VE GOT ONE"
-#define TEXT32 "YOO HOO, UNCLE EVERISTO!"
-#define TEXT33 "THERE'S NO REPLY"
-#define TEXT34 "IT'S NOT WELL PARKED"
-#define TEXT35 "IT'S A DOOR"
-#define TEXT36 "A DRAWER IN THE TABLE"
-#define TEXT37 "A SUSPICIOUS WARDROBE"
-#define TEXT38 "HI WARDROBE, HOW ARE YOU?"
-#define TEXT41 "IT'S AN ANCIENT CANDELABRUM"
-#define TEXT42 "IT MUST HAVE BEEN HERE EVER SINCE YULE BRINNER HAD HAIR ON HIS HEAD"
-#define TEXT43 "NO, ITS A RELIC"
-#define TEXT44 "ITS A NICE ALTARPIECE"
-#define TEXT46 "HA, HA, HA"
-#define TEXT48 "NO"
-#define TEXT50 "HA, HE, HI, HO, HU, GREAT!"
-#define TEXT54 "I CAN'T SEE ANYTHING IN PARTICULAR"
-#define TEXT55 "IT'S FERNAN, THE PLANT"
-#define TEXT56 "IT'S ONE OF THE FENCES SPIKES"
-#define TEXT57 "HEY! THERE'S A PACKET OF MATCHES UNDER HERE"
-#define TEXT58 "LOOK! A PACKET OF KLEENEX, AND ONE'S STILL UNUSED"
-#define TEXT59 "THERE ISN'T ANYTHING ELSE IN THE BUCKET"
-#define TEXT60 "IT'S A BLIND MAN WHO CAN'T SEE"
-#define TEXT65 "THAT'S A GREAT DEAL OF MONEY"
-#define TEXT100 "THERE IS NOTHING SPECIAL ABOUT IT"
-#define TEXT101 "IT'S NOT UNUSUAL"
-#define TEXT102 "HEY, WHAT'S UP MAN?"
-#define TEXT103 "HI"
-#define TEXT104 "NOTHING NEW?"
-#define TEXT105 "HOW IS THE FAMILY?"
-#define TEXT106 "THAT IS JUST LIKE YOU!"
-#define TEXT107 "BUT HOW DO I GET THAT?"
-#define TEXT108 "MY RELIGION DOES NOT ALLOW ME"
-#define TEXT109 "IT'D BE BETTER NOT"
-#define TEXT110 "YEAH, SURE MAN!"
-#define TEXT111 "NO WAY"
-#define TEXT112 "IMPOSSIBLE"
-#define TEXT113 "THIS WILL NOT OPEN"
-#define TEXT114 "I CAN'T DO IT BY MYSELF"
-#define TEXT115 "I COULD DO IT, BUT I JUST FEEL A LITTLE LAZY"
-#define TEXT116 "I DO NOT SEE THE REASON"
-#define TEXT117 "IT'S A QUITE NICE BRAIN"
-#define TEXT118 "AND SO BRAIN, WHAT ARE YOU UP TONIGHT?"
-#define TEXT119 "NO, IT MUST BE KEPT SOMEWHERE AWAY FROM THE MUTANT ACTION OF THE ATMOSPHERE"
-#define TEXT120 "HE IS VERY STIFF, JUST LIKE MY BOSS"
-#define TEXT121 "A VERY SHARP STICK"
-#define TEXT122 "YOU FAITHFUL SHARP-PAINTED STICK, NOBLE TRANSILVAAANIAN OAK TREE"
-#define TEXT123 "DAMN, I HAVE TO CUT MY NAILS!"
-#define TEXT124 "B.J. IS IN THERE... SHE IS A REALLY HOT CHICK!"
-#define TEXT125 "IT IS FIRMLY LOCKED"
-#define TEXT126 "\"SAVE AWAY LOCKS LTD.\""
-#define TEXT127 "IT IS THE TYPICAL SKELETON YOU FIND IN THE DUNGEONS OF ALL THE GAMES"
-#define TEXT128 "IT IS COMMONLY USED TO COMMUNICATE ELECTRICITY TO THE MACHINES CONNECTED TO IT"
-#define TEXT129 "IT IS ABSOLUTELY HAND MADE BECAUSE THE JAPANESE MAKE THEM POCKET SIZE"
-#define TEXT130 "I HAVE ONLY SEEN IN MY LIFE ANOTHER THING AS UGLY AS THIS ONE"
-#define TEXT131 "FORGET IT. I AM NOT GOING TO TELL HIM ANYTHING IN CASE HE GETS MAD"
-#define TEXT132 "IT SEEMS QUITE RATIONAL"
-#define TEXT133 "IT IS A PICTURE OF PLATO WRITING HIS LOST DIALOGUE"
-#define TEXT134 "I AM NOT ONE OF THOSE WHO TALKS TO POSTERS"
-#define TEXT135 "THAT'S A VERY CUTE DESK"
-#define TEXT136 "IT IS A VAMPIRES HUNTER'S DIPLOMA OFFICIALLY APPROVED BY OXFORD UNIVERSITY"
-#define TEXT137 "IT'S A DARK NIGHT WITH FULL MOON"
-#define TEXT138 "IT SEEMS LIKE THESE SCREWS ARE NOT MUCH TWISTED"
-#define TEXT139 "DON'T LOOK NOW, BUT I THINK THAT A HIDDEN CAMERA IS FOCUSING ON ME"
-#define TEXT140 "THAT'S A VERY MODERN STICK DETECTOR"
-#define TEXT141 "NO. THE LABORATORY IS ON THE SECOND FLOOR"
-#define TEXT142 "A NICE BEDSIDE TABLE"
-#define TEXT143 "IT'S A LOT OF MONEY THAT CAN'T BE MISSING IN ANY VALUABLE ADVENTURE"
-#define TEXT144 "IF I WERE A RICH MAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU"
-#define TEXT145 "THOSE ARE STRANGE LEAVES. THEY MUST HAVE BROUGHT THEM FROM SOUTH AMERICA OR AROUND THERE"
-#define TEXT146 "I DON'T THINK THEY WOULD ANSWER ME"
-#define TEXT147 "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY GET ALL THE BEAUTY WITHIN IT"
-#define TEXT148 "I ONLY PRAY BEFORE I GO TO BED"
-#define TEXT149 "HEY, THIS PIKE SEEMS A LITTLE BIT LOOSE!"
-#define TEXT150 "I HOPE YOU WON'T COMPLAIN ABOUT GETTING NO CLUES FROM ME"
-#define TEXT151 "IT'S A QUITE CONVENTIONAL PIKE"
-#define TEXT152 "THEY ARE CUTE, THOUGH THEY ARE COVERED WITH A LITTLE BIT OF SHIT"
-#define TEXT153 "NO, THEY WON'T HEAR ME. HA,HA,HA THIS IS GREAT!"
-#define TEXT154 "\"SLEEPING BEAUTY\" FROM CHAIKOSKY, OR CHOIFRUSKY, OR WHATEVER IT IS"
-#define TEXT155 "VERY TEMPTING"
-#define TEXT156 "NO, I'M NOT ONE OF THOSE WHO PUT USED BUBBLE GUMS IN THEIR MOUTH"
-#define TEXT157 "THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER MAY BE"
-#define TEXT158 "TOBACCO MANUFACTURERS WARN ABOUT HEALTH BEING SERIOUSLY DAMAGED BY SANITARY AUTHORITIES"
-#define TEXT159 "AN ABSOLUTELY NORMAL CANDLE, INCLUDING WAX AND EVERYTHING"
-#define TEXT160 "THESE TWO SHINY COINS DO REALLY GLITTER!"
-#define TEXT161 "THIS SHINY COIN DOES REALLY GLITTER!"
-#define TEXT162 "WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE'S BITES"
-#define TEXT163 "NO, IT'S IS NOT THE RIGHT MOMENT YET"
-#define TEXT164 "THERE IS A ONE THOUSAND BILL AND A COUPLE COINS"
-#define TEXT165 "IT SAYS \"PLEASE, DO NOT THROW FOOD TO THE PIANIST\""
-#define TEXT166 "OMELET, 200. FRIED FISH, 150, MAYONNAISE POTATOES, 225"
-#define TEXT167 "BEST BURGERS ON THIS SIDE OF THE DANUBE, ONLY FOR 325!"
-#define TEXT168 "THAT'S A NICE SKULL WITH A VERY PENETRATING LOOK, HA, HA, HA, HA, THAT WAS GOOD!"
-#define TEXT169 "HI SKULL, YOU REMIND ME OF UNCLE HAMLET"
-#define TEXT170 "I HAVE THE HABIT OF NOT TOUCHING THINGS THAT HAVE BEEN ALIVE"
-#define TEXT171 "IT'S A BIN"
-#define TEXT172 "IT'S A BET FOR TONIGHT'S GAME"
-#define TEXT173 "I WONDER WHAT THERE IS BEHIND THAT"
-#define TEXT174 "HEY, THAT CURTAIN IS NOT MOVING!"
-#define TEXT175 "MAN, THIS CASTLE IS REALLY GLOOMY"
-#define TEXT176 "I CAN'T, HE IS TOO FAR AWAY TO HEAR ME"
-#define TEXT177 "IT'S THE TYPICAL TRANSILVANIAN FOREST, WITH TREES"
-#define TEXT178 "MAN YOU REALLY SAY STUPID THINGS, AND THIS IS TOO DARK!"
-#define TEXT179 "GARCIA, CANDY STORE. SWEETS AND BUBBLE GUM"
-#define TEXT180 "A VERY NICE DOOR"
-#define TEXT181 "IT'S CLOSED"
-#define TEXT182 "A COMPLETELY LOCKED BARREL"
-#define TEXT184 "AREN'T THESE BUGS REALLY CUTE?"
-#define TEXT185 "BSSST, PUSSYCAT... LITTLE CAT"
-#define TEXT186 "THERE IS NO ANSWER"
-#define TEXT187 "THE MOON IS A SATELLITE THAT TURNS AROUND THE EARTH WITH A REVOLUTION PERIOD OF 28 DAYS"
-#define TEXT188 "HI, LOONY MOON"
-#define TEXT189 "IT'S TOTALLY BLOCKED UP WITH PLANKS"
-#define TEXT190 "IT'S IMPOSSIBLE. NOT EVEN THAT TOUGH GUY FROM TV COULD OPEN THIS"
-#define TEXT191 "HEY! THE SHADOW OF THAT CYPRESS LOOKS PROLONGED TO ME!"
-#define TEXT192 "YOU, BARTENDER...!!"
-#define TEXT193 "I WOULD LIKE TO HAVE A ROOM PLEASE"
-#define TEXT194 "DO YOU KNOW WHERE I CAN FIND THE SO CALLED DRASCULA?"
-#define TEXT195 "YES, SO WHAT?"
-#define TEXT196 "SO?"
-#define TEXT197 "IS...THAT RIGHT?"
-#define TEXT198 "GOOD QUESTION. NOW, LET ME TELL YOU MY STORY. LOOK..."
-#define TEXT199 "IT'S JUST FIVE MINUTES"
-#define TEXT200 "I'M JOHN HACKER AND I REPRESENT A BRITISH PROPERTY COMPANY"
-#define TEXT201 "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 SELLING"
-#define TEXT202 "I THINK I'M GOING BACK TO MY MUM'S TOMORROW FIRST THING IN THE MORNING"
-#define TEXT203 "BEAUTIFUL NIGHT, HUH?"
-#define TEXT204 "NO, NOTHING"
-#define TEXT205 "YOU...PIANIST...!!!!"
-#define TEXT206 "BEAUTIFUL NIGHT"
-#define TEXT207 "AND IT'S NOT EVEN COLD OR ANYTHING"
-#define TEXT208 "ALL RIGHT, I'LL JUST LET YOU GO ON PLAYING"
-#define TEXT209 "WELL THEN"
-#define TEXT210 "HI BOSS, HOW ARE YOU?"
-#define TEXT211 "AND HOW IS THE FAMILY?"
-#define TEXT212 "THIS IS QUITE GROOVY, HUH?"
-#define TEXT213 "I'D BETTER NOT SAY ANYTHING"
-#define TEXT214 "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!"
-#define TEXT215 "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"
-#define TEXT216 "AREN'T I JUST A FUNNY GUY, HUH?. BY THE WAY, WHERE AM I?"
-#define TEXT217 "YES"
-#define TEXT218 "SHOOT...!"
-#define TEXT219 "OH, SURE...OF COURSE!"
-#define TEXT220 "WELL, THANKS VERY MUCH FOR YOUR HELP. I WON'T BOTHER YOU ANYMORE IF YOU PLEASE TELL ME WHERE THE DOOR IS..."
-#define TEXT221 "IT'S BECAUSE THE KNOCK MUST HAVE AFFECTED MY BRAIN...I CAN'T SEE A THING..."
-#define TEXT222 "WELL...THAT DOESN'T MATTER. I ALWAYS CARRY AN SPARE ONE"
-#define TEXT223 "WOW, WHAT A HOT CHICK!! I DIDN'T NOTICE!, BUT OF COURSE, I WASN'T WEARING MY GLASSES"
-#define TEXT224 "HEY..."
-#define TEXT225 "AND ALL THIIIISSS???"
-#define TEXT226 "DON'T WORRY B.J. HONEY, I'LL SAVE YOU FROM FALLING INTO HIS CLUTCHES..."
-#define TEXT227 "YOU REALLY GOT ME MAD MAN..."
-#define TEXT228 "AHHH A WEREWOLF!! DIE YOU DAMNED EVIL!"
-#define TEXT229 "YES, WELL..."
-#define TEXT230 "YES, WELL...I THINK I'LL JUST GO ON MY WAY. EXCUSE ME"
-#define TEXT231 "WHAT?"
-#define TEXT232 "TO TELL YOU THE TRUTH...ON SECOND THOUGHTS...I DON'T REALLY THINK SO"
-#define TEXT233 "AND SO TELL ME YOU ERUDITE PHILOSOPHER, IS THERE ANY RELATIONSHIP CAUSE-AND-EFFECT BETWEEN SILLY AND BILLY?"
-#define TEXT234 "OK, OK, FORGET IT. I DON'T EVEN KNOW WHU I SAID ANYTHING ABOUT IT"
-#define TEXT235 "WHAT ARE YOU DONIG HERE PHILOSPOZING INSTEAD OF BEING EATING SOME PEOPLE"
-#define TEXT236 "HOW COME?"
-#define TEXT237 "HEY, COULD YOU SAY AGAIN ALL THAT ABOUT PRE-EVOLUTIONARY RELATIONSHIPS?"
-#define TEXT238 "YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT NEFORE. I DIDN'D GET IT VERY WELL, YOU KNOW"
-#define TEXT239 "NO, I'D RATHER NOT SAY ANYTHING, IN CASE HE GETS ANGRY OR SOMETHING..."
-#define TEXT240 "HELLO?"
-#define TEXT241 "YES, WHAT'S UP?"
-#define TEXT242 "WELL, NOW THAT YOU MENTION IT, I'LL TELL YOU THAT..."
-#define TEXT244 "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?"
-#define TEXT245 "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END UP SOON WITH THE GAME?. WELL, MAYBE NOT"
-#define TEXT246 "IT'S EMPTY!"
-#define TEXT247 "WHY DID YOU TAKE MY ONLY LOVE, B.J. , AWAY FROM ME?. LIFE HAS NO MEANING FOR WITHOUT HER"
-#define TEXT248 "HER BRAIN?\?!!"
-#define TEXT249 "TO TELL YOU THE TRUTH, I THINK I HAD JUST ENOUGH WITH YOUR OF YOUR LITTLE MONSTER"
-#define TEXT250 "OH PLEASE, HOLLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!!"
-#define TEXT251 "YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL CAME AND RESCUE ME!"
-#define TEXT252 "WHAT A SHIT OF GAME IS THIS IN WHICH THE PROTAGONIST DIES!"
-#define TEXT253 "HEY, WAIT A SECOND!, WHAT ABOUT MY LAST WISH?"
-#define TEXT254 "HA. HA, I'M NOW IMMUNIZED AGAINST YOU DAMNED EVIL!. THIS CIGARETTE IS AN ANTI-VAMPIRE BREW THAT VON BRAUN GAVE TO ME"
-#define TEXT255 "YES SURE, BUT YOU'LL NEVER GET ME TO GIVE YOU THE RECIPE"
-#define TEXT256 "APART FROM CREATING TORTURE, I CAN ALSO STAND IT."
-#define TEXT257 "OH, NO PLEASE! I'LL TALK, BUT PLEASE, DON'T DO THAT TO ME!"
-#define TEXT258 "ALL RIGHT THEN. I TOLD YOU WHAT YOU WANTED TO KNOW. NOW SET B.J. AND ME FREE AND LEAVE US ALONE!"
-#define TEXT259 "WHAT ARE YOU DOING HERE B.J.?. WHERE IS DRASCULA?"
-#define TEXT260 "WHAT A MEAN GUY!. JUST BECAUSE HE BELONGS TO THE NOBILITY HE THINKS HE IS ENTITLED TO SLEEP WITH ANYBODY HE FEELS LIKE"
-#define TEXT261 "DOWN WITH ARISTOCRATIC DESPOTISM!!"
-#define TEXT262 "POOR PEOPLE OF THE WORLD FOR EVER..!!"
-#define TEXT263 "AND AS I CAN SEE HE HAS CHAINED YOU UP WITH LOCKS AND ALL THAT STUFF, HUH?"
-#define TEXT264 "WELL, ALL RIGHT. DO YOU HAVE A HAIRPIN OVER THERE?"
-#define TEXT265 "ALL RIGHT, OK, DON'T GET MAD. I'LL THINK ABOUT SOMETHING"
-#define TEXT266 "YOU...BARTENDER!!"
-#define TEXT267 "HOW IS THE GAME GOING?"
-#define TEXT268 "WHO?"
-#define TEXT269 "CAN'T YOU SEE DRASCULA IS HERE?"
-#define TEXT270 "THEN, LET'S END UP WITH HIM, RIGHT?"
-#define TEXT271 "GIVE ME A SCOTCH ON THE ROCKS"
-#define TEXT272 "NOTHING, I JUST FORGOT WHAT I WAS GOING TO SAY..."
-#define TEXT273 "EITHER YOU GET ME A SCOTCH ON THE ROCKS OR I'LL PLAY THE PIANO UNTIL THE GAME IS OVER"
-#define TEXT274 "WHEN IS THE MATCH GOING TO BE OVER?"
-#define TEXT275 "GOOD EVENING"
-#define TEXT276 "AND SO IGOR, HOW ARE YOU FEELING...A LITTLE HUMPED...?. HA, HA, HA, THAT WAS FUNNY!"
-#define TEXT277 "WHAT ARE YOU SUPPOSED TO BE DOING?"
-#define TEXT278 "WELL, NO"
-#define TEXT279 "THEN WEAR GLASSES"
-#define TEXT280 "WHAT IS ALL THAT ABOUT THE SUPERNATURAL ORGY?"
-#define TEXT281 "OK, OK, STOP IT. I THINK I CAN GET THE PICTURE"
-#define TEXT282 "COULDN'T YOU TELL ME WHERE DRASCULA IS?"
-#define TEXT283 "OH...PLEASE...COME ON...!"
-#define TEXT284 "WHY NOT?"
-#define TEXT285 "OH...BUT DIES HE SLEEP AT NIGHT?"
-#define TEXT286 "WELL, I HOPE YOU GET LUCKY"
-#define TEXT287 "I HAVE TO TALK TO HIM..."
-#define TEXT288 "YOOUUU...SKELETOOOONN..!!!"
-#define TEXT289 "GOOD HEAVENS!, IT'S A DEAD MAN TALKING!"
-#define TEXT290 "TELL HOW DID YOU GET TO END UP HERE"
-#define TEXT291 "AND WHY WOULD DRASCULA WANT TO CREATE A MONSTER?"
-#define TEXT292 "WHAT'S YOUR NAME, MY SKELETON FRIEND?"
-#define TEXT293 "HEY, DON'T YOU WANT ANYTHING TO EAT?"
-#define TEXT294 "I BET YOUR STOMACH IS PRETTY EMPTY...HA, HA,HA!"
-#define TEXT295 "THE THING IS THAT I DON'T FEEL LIKE TALKING RIGHT NOW"
-#define TEXT296 "I HOPE SOMEONE F...(WHISTLE) YOU...,AND YOUR F...(WHISTLE) SON OF (WHISTLE TWICE)"
-#define TEXT297 "I REALLY LOVED HER. I KNOW SHE WASN'T MUCH OF A WONDER, BUT NOBODY'S PERFECT, RIGHT?"
-#define TEXT298 "BESIDES. SHE REALLY HAD ONE OF THOSE GREAT BODIES THAT YOU NEVER FORGET..."
-#define TEXT299 "I'LL NEVER BE THE SAME AGAIN. I WILL SHUT MYSELF AWAY IN A MONASTERY, AND WILL LET MY LIFE JUST FLOW..."
-#define TEXT300 "NOTHING WILL GET ME OUT OF THIS MYSTERY BECAUSE..."
-#define TEXT301 "WHOSE?. WHOSE?"
-#define TEXT302 "I WANT TO BECOME A PIRATE"
-#define TEXT303 "I WANT TO BECOME A PROGRAMMER"
-#define TEXT304 "TELL ME SOMETHING ABOUT PELAYO"
-#define TEXT305 "I'LL JUST GO ON PLAYING, AND I'LL FORGET I SAW YOU"
-#define TEXT306 "WHOSE STUPID IDEA COULD THIS BE?"
-#define TEXT307 "IT'S LIKE MY GRANDMOTHER'S HANDBAG "
-#define TEXT308 "JESUS, AREN'T I JUST REALLY COOL MAN...!"
-#define TEXT309 "THE MORE I SEE MYSELF, THE MORE I LOVE ME"
-#define TEXT310 "HOW DO I LOCK MYSELF THEN?"
-#define TEXT311 "I'LL HAVE TO OPEN ME FIRST, RIGHT?"
-#define TEXT312 "I'M ALL RIGHT WHERE I AM"
-#define TEXT313 "I GOT ME"
-#define TEXT314 "HI, MYSELF!"
-#define TEXT315 "I'LL WEAR THEM WHEN THE RIGHT TIME COMES"
-#define TEXT316 "I CAN'T SEE ANYTHING SPECIAL ABOUT IT"
-#define TEXT317 "IT'S ALL RIGHT WHERE IT IS"
-#define TEXT318 "AND WHAT FOR?"
-#define TEXT319 "I CAN'T"
-#define TEXT320 "HI, YOU!"
-#define TEXT321 "IT'S UNCLE DESIDERIO'S PANTHEON!"
-#define TEXT322 "YOOUU...UNCLE DESIDERIOOOO!!"
-#define TEXT323 "NO, I DON'T WANT TO CUT MYSELF AGAIN"
-#define TEXT324 "AHHH,,,EXCUS...."
-#define TEXT325 "JAMM. AHH..."
-#define TEXT326 "YES...WOF, WOF"
-#define TEXT327 "LOOK, THERE'S A PIECE OF BUBBLE GUM STUCK HERE"
-#define TEXT328 "THIS IS THE PORTABLILINE I GOT LAST CHRISTMAS"
-#define TEXT329 "IT'S VERY HIGH!"
-#define TEXT330 "COME OUT TO THE BALCONY MY JULIET!!"
-#define TEXT331 "YOU ARE THE LIGHT THAT ILLUMINATES MY WAY!"
-#define TEXT332 "HEY, DOOR!, WHAT'S THE MATTER?"
-#define TEXT333 "YOOOUU, CIGARETTE SPENDING MACHINEEE!"
-#define TEXT334 "IT'S A CIGARETTE SPENDING MACHINE"
-#define TEXT335 "I HAVE ANOTHER COIN INSIDE"
-#define TEXT336 "NO, I JUST DECIDED TO QUIT SMOKING AND DRINKING ALCOHOL"
-#define TEXT337 "I WILL DEVOTE MYSELF TO WOMEN FROM NO ON"
-#define TEXT338 "THIS IS A TRICK! NOTHING CAME OUT!"
-#define TEXT339 "AT LAST!"
-#define TEXT340 "JUST A TRUNK"
-#define TEXT341 "HELLO TRUNK, YOUR NAME IS JUST LIKE MY COUSIN FRANK..."
-#define TEXT342 "I'VE FOUND B.J.'S HANDBAG!"
-#define TEXT343 "OH MY GOD! DON'T GET MY IMAGE REFLECTED! I'M A VAMPIRE!"
-#define TEXT344 "OH...JESUS, IT'S JUST A DRAWING!"
-#define TEXT345 "LITTLE MIRROR, TELL ME, WHO IS THE MOST BEAUTIFUL IN THE WHOLE KINGDOM?"
-#define TEXT346 "HE WON'T OPEN"
-#define TEXT347 "ALL RIGHT. I GOT THE EAR-PLUGS ON"
-#define TEXT348 "IT'S A VAMPIRE'S HUNTER DIPLOMA, OFFICIALLY APPROVED BY OXFORD UNIVERSITY"
-#define TEXT349 "NOT YET. THERE ARE STILL SOME INGREDIENTS MISSING. IT'S NOT WORTH WAKING HIM UP"
-#define TEXT350 "BUT I DON'T HAVE MONEY"
-#define TEXT351 "IT'S A BRITISH LAMP"
-#define TEXT352 "HELP ME OUT HERE BARTENDER!!"
-#define TEXT353 "A VAMPIRE CAME IN AND TOOK MY GIRLFRIEND AWAY!!"
-#define TEXT354 "BUT, AREN'T YOU GOING TO HELP ME!!??"
-#define TEXT355 "DEAD?, WHAT DO YOU MEAN DEAD?"
-#define TEXT356 "AAHH...."
-#define TEXT357 "A VAMPIRE HAS KIDNAPPED THE GIRL IN ROOM 501"
-#define TEXT358 "BUT YOU HAVE TO HELP ME OUT!"
-#define TEXT359 "CAN'T YOU PLAY ONE FROM BLUR?"
-#define TEXT360 "HOW CAN YOU STAY HERE ALL DAY PLAYING THE SAME SONG ALL THE TIME?"
-#define TEXT361 "AND THEN, HOW CAN YOU HEAR ME?"
-#define TEXT362 "PLEASE, LEND ME THE ERA-PLUGS"
-#define TEXT363 "COME ON, I'LL GIVE THEM BACK TO YOU RIGHT AWAY"
-#define TEXT364 "COOOMEE OONNN..."
-#define TEXT365 "WELL GOODBYE, I HAVE TO KILL A VAMPIRE"
-#define TEXT367 "WHAT'S YOUR LANGUAGE, TRASILVANIAN?"
-#define TEXT368 "WHO IS UNCLE DESIDERIO?"
-#define TEXT369 "BUT, WHAT'S THE MATTER WITH THAT DRASCULA?"
-#define TEXT370 "WHO IS THAT GUY NAMED VON BRAUN?"
-#define TEXT371 "AND WHY DOESN'T HE DO IT?"
-#define TEXT372 "AND WHERE CAN I FIND VON BRAUN?"
-#define TEXT373 "WELL, THANKS AND GOODBYE. HOPE YOU SLEEP IT OFF JUST FINE"
-#define TEXT374 "WE'D BETTER CALL FIRST"
-#define TEXT375 "ARE YOU PROFESSOR BRAUN?"
-#define TEXT376 "AND COULD YOU TELL ME WHERE I CA...?"
-#define TEXT377 "I DON'T BELIEVE HE IS GANIMEDES THE DWARF"
-#define TEXT378 "PROFESSOR!!"
-#define TEXT379 "PLEASE HELP ME!. THE LIFE OF MY GIRLFRIEND DEPENDS ON YOU!!"
-#define TEXT380 "WELL, ALL RIGHT. I DON'T NEED YOUR HELP"
-#define TEXT381 "ALL RIGHT. I'M LEAVING"
-#define TEXT382 "DON'T DE AFRAID. WE WILL BEAT DRASCULA TOGETHER"
-#define TEXT383 "THEN WHY DON'T YOU HELP ME?"
-#define TEXT384 "I GOT THEM"
-#define TEXT385 "YES, I GOT THEM!!"
-#define TEXT386 "ALL RIGHT"
-#define TEXT387 "AHH....YES"
-#define TEXT388 "I HAVE COME TO GET INTO THAT CABIN AGAIN"
-#define TEXT389 "I AM READY TO FACE YOUR TEST"
-#define TEXT390 "ALL RIGHT OLD MAN. I CAME FOR MY MONEY"
-#define TEXT391 "NO, NOTHING. I WAS JUST LEAVING"
-#define TEXT392 "SORRY..."
-#define TEXT393 "DO YOU LIKE THIS BOOK?. IT HAS SOME SCORES FROM TCHAIKOWSKY"
-#define TEXT394 "HOW CAN I KILL A VAMPIRE?"
-#define TEXT395 "HAS ANYBODY TOLD YOU THAT SLEEPING IN A BAD POSITION IS NOT GOOD FOR YOU?"
-#define TEXT396 "THAT'S WHAT MY MUM ALWAYS TELL ME"
-#define TEXT397 "WHY WOULDN'T DRASCULA KILL YOU?"
-#define TEXT398 "AND WHAT WAS IT?"
-#define TEXT399 "GREAT! YOU HAVE AN IMMUNIZING BREW"
-#define TEXT400 "SO?"
-#define TEXT401 "ALL RIGHT"
-#define TEXT402 "CAN YOU REPEAT WHAT I NEED FOR THAT BREW"
-#define TEXT403 "WELL, I'LL RUSH OUT TO GET IT"
-#define TEXT404 "HEY, WHAT HAPPENED WITH THE PIANIST?"
-#define TEXT405 "I HAVE ALL THE INGREDIENTS OF THAT BREW"
-#define TEXT406 "JUST A QUESTION. WHAT IS ALL THAT ABOUT THE ALUCSARD ETEREUM?"
-#define TEXT407 "HELLO, HELLO..."
-#define TEXT408 "AND WHERE IS THAT CAVERN?"
-#define TEXT409 "WHAT HAPPENS? DIDN'T YOU HAVE TO GO TO THE COURT?"
-#define TEXT410 "...BUT... IF I MEET MORE VAMPIRES?"
-#define TEXT411 "IT'S A VAMPIRE THAT DOESN'T LET ME COME THROUGH"
-#define TEXT412 "HE LOOKS LIKE YODA, BUT A LITTLE TALLER"
-#define TEXT413 "HEY YODA, IF YOU JUST LET ME GO ON MY WAY, I'LL GIVE YOU A PENNY"
-#define TEXT414 "OK, OK, YOU GET MAD ABOUT NOTHING MAN"
-#define TEXT415 "HAS ANYBODY TOLD YOU THAT YOU LOOK LIKE YODA?"
-#define TEXT416 "HI VAMPIRE, IT'S A BEAUTIFUL NIGHT, HUH?"
-#define TEXT417 "ARE YOU A VAMPIRE OR AN OIL PAINTING?"
-#define TEXT418 "I'D BETTER NOT SAY ANYTHING, IN CASE YOU GET MAD"
-#define TEXT419 "IT'S LOCKED"
-#define TEXT420 "THE MAGPIE WOULD STICK OUT MY EYES IF I TRIED!"
-#define TEXT421 "OH MY GOD. IT'S LOCKED...THAT'S SCARY, HUH?"
-#define TEXT422 "THE HINGES ARE RUSTY"
-#define TEXT423 "THERE IS ONLY ONE CAN OF FLOUR IN THERE"
-#define TEXT424 "THAT TOOK AWAY THE RUST"
-#define TEXT425 "I HAVE FOUND A PINE STICK"
-#define TEXT426 "I'LL TAKE THIS THICKER ONE"
-#define TEXT427 "WELL, I THINK I CAN GET RID OF THIS STUPID DISGUISE"
-#define TEXT428 "\"PASSAGE TO TOWERS CLOSED FOR REPAIRS. PLEASE USE MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\""
-#define TEXT429 "...HE IS PALE, HE HAS FANGS AND WEARS A TOUPE AND HE SURE IS DRASCULA!"
-#define TEXT430 "IT'S B.J.! ARE YOU ALL RIGHT B.J.?"
-#define TEXT431 "YES, I KNOW SHE IS STUPID, BUT I'M SO LONELY"
-#define TEXT432 "YOU DON'T HAVE A KEY AROUND THERE, DO YOU?"
-#define TEXT433 "I BET YOU DON'T HAVE A PICKLOCK AROUND!"
-#define TEXT434 "GIVE ME A HAIRPIN, I'M GOING TO PLAY MCGYVER HERE!"
-#define TEXT435 "DON'T GO ANYWHERE. I'LL BE RIGHT BACK"
-#define TEXT436 "SHOOT! IT'S BROKEN!"
-#define TEXT437 "OLEEEE! I EVEN SHAVED DUDE!"
-#define TEXT438 "YES, DARLING?"
-#define TEXT439 "HE'S NOT ARRIVED YET"
-#define TEXT440 "THE PIANIST IS NOT HERE"
-#define TEXT441 "A TRANSYLVANIAN SCOTCH ON THE ROCKS"
-#define TEXT442 "I DON'T HAVE A ROOM YET"
-#define TEXT443 "IT LOOKS LIKE HE GOT STUCK IN THE BATH AND DECIDED TO RUN A BAR"
-#define TEXT444 "HE WAS DRUNK AS A SAILOR"
-#define TEXT445 "THAT HAIR...REMINDS ME OF SOMEBODY"
-#define TEXT446 "IT'S A RAW-BONED SKELETON"
-#define TEXT447 "LOOK! THERE'S MIGUEL BOSE!"
-#define TEXT448 "HE'S ASLEEP. IT'D BE A SHAME WAKING HIM UP"
-#define TEXT449 "HE'S UGLIER THAN EMILIO DE PAZ"
-#define TEXT450 "A PINE-WOODEN COFFIN"
-#define TEXT451 "HE IS GOING TO CUT ME IN LITTLE SLICES. JUST LIKE A SAUSAGE"
-#define TEXT452 "I DON'T LIKE PENDULAE. I'D RATHER PREFER ARTICHOKES"
-#define TEXT453 "I CAN'T MAKE IT. I'M HANDCUFFED"
-#define TEXT454 "IT'S OBVIOUSLY A SECRET DOOR"
-#define TEXT455 "THEY IGNORE ME"
-#define TEXT456 "COME ON..!"
-#define TEXT457 "WHEN I READ THE SCRIPT IT WAS SUPPOSED TO MOVE, BUT THE BUDGET GOT CRAZY AND THEY COULDN'T AFFORD TO PAY THE GYM, SO THAT I NEVER GOT TOUGH. END OF STORY"
-#define TEXT458 "IT SEEMS A LITTLE LOOSE FROM THE WALL"
-#define TEXT459 "I DON'T THINK IS GOING TO HELP ME ANYWAY. IT'S TOO WET TO LIGHT IT"
-#define TEXT460 "TO WEST WING? NO WAY! NOBODY KNOWS WHAT YOU CAN FIND THERE!!"
-#define TEXT461 "SHE'S GOT NICE TRANSILVANIAN REASONS"
-#define TEXT463 "IT'S A SHAME THERE ISN'T A ROASTED LAMB IN THERE"
-#define TEXT464 "LAST TIME I OPENED AN OVEN I BLEW UP THE HOUSE"
-#define TEXT465 "THAT'S THE TRANSILVANIAN FOOTBALL BADGE"
-#define TEXT466 "WHAT FOR? TO PUT IT ON MY HEAD"
-#define TEXT467 "I DON'T THINK THESE TOWERS ARE THE OPENING KIND"
-#define TEXT468 "I DON'T WANT TO KNOW WHAT KIND OF FOOD IS IN THERE!"
-#define TEXT469 "IT LOOKS IMPRESSIONIST TO ME..."
-#define TEXT470 "THE NIGHT IS FALLING OVER ALL OF US...THAT'S SCARY, ISN'T IT?"
-#define TEXT471 "IT'S STUCK!"
-#define TEXT472 "IT'S THE KING. YOU DIDN'T IMAGINE THAT, DID YOU!"
-#define TEXT473 "NO, I ALREADY HAVE ONE AT HOME TO FEED"
-#define TEXT474 "A SHELF WITH BOOKS AND SOME OTHER THINGS"
-#define TEXT475 "BUT WHO CAN I CALL AT THIS TIME?"
-#define TEXT476 "\"HOW TO MAKE THE TAX RETURN FORMS\". HOW INTERESTING!"
-#define TEXT477 "I ALREADY HAVE ONE AT HOME. I THINK IT'S A WORLDWIDE BEST SELLER"
-#define TEXT478 "A COMPLETELY NORMAL KEY"
-#define TEXT479 "I THINK SHE IS NOT FROM AROUND HERE"
-#define TEXT480 "HEY, THEY'RE FANG-LIKE FRENCH FRIES! I LOVE IT!"
-#define TEXT481 "I DON'T THINK THIS IS THE RIGHT TIME TO EAT THAT CRAP KNOWING THAT MY GIRLFRIEND HAS BEEN KIDNAPPED BY THE MOST EVIL PERSON EVER ON EARTH"
-#define TEXT482 "I'M HAVING A GREAT TIME KILLING VAMPIRES WITH THIS THING!"
-#define TEXT483 "LET'S SEE IF ANOTHER ONE COMES SOON!"
-#define TEXT484 "NO, IT HAS TO BE WITH A DIRTY AND STINKY VAMPIRE, JUST LIKE THE ONE I KILLED BEFORE"
-#define TEXT485 "THIS IS THE ONE AND ONLY WIG ELVIS USED WHEN HE GOT BALD"
-#define TEXT486 "IT'S FLOUR, BUT DON'T ASK ME ANY COMMERCIAL NAMES"
-#define TEXT487 "MAYBE ANOTHER TIME, OK?"
-#define TEXT488 "THAT'S A GREAT AXE, IT'S A SHAME THERE IS NO VAMPIRE'S HEAD AROUND HERE, HUH?"
-#define TEXT489 "NO. I'M REALLY A GOOD PERSON"
-#define TEXT490 "IT'S MARGARET'S THATCHER DEODORANT...HA, HA, HA...!!"
-#define TEXT491 "THAT'S A PRETTY CUTE CLOAK"
-#define TEXT493 "JUST LIKE ALL BRANCHES FROM ANY TREE IN THE WORLD, THERE IS NOTHING SPECIAL."
-#define TEXT494 "HEY, THAT'S AMAZING! A ROPE WITHIN THIS TYPE OF ADVENTURE!"
-#define TEXT495 "I WONDER WHAT WE COULD USE IT FOR..."
-#define TEXT496 "A ROPE TIED TO A BRANCH OR THE OTHER WAY AROUND, HOWEVER YOU WANT TO PUT IT..."
-#define TEXT497 "IT LOOKS LIKE THIS MAGPIE IS EVIL-MINDED"
-#define TEXT498 "FORGET IT, I'M NOT SAYING ANYTHING IN CASE HE GETS MAD"
-#define TEXT499 "SHE LOOKS DEAD, BUT SHE REALLY ISN'T, HUH?"
-#define TEXT500 "NO ANIMAL WAS HARMED DURING THE PRODUCTION OF THIS GAME"
-#define TEXTD56 "HI BLIND MAN. HOW IT'S GOING?"
-#define TEXTD57 "HOW DO YOU KNOW I'M A FOREIGNER?"
-#define TEXTD58 "YOU LOOK BLIND. YOU'RE WEARING DARK GLASSES LIKE STEVIE WONDER"
-#define TEXTD59 "LOOK, I'M SORRY, I DIDN'T KNOW YOU COULD SEE"
-#define TEXTD60 "BUT HAVEN'T YOU JUST TOLD ME YOU WEREN'T BLIND"
-#define TEXTD61 "BUT IF YOU CAN'T SEE"
-#define TEXTD62 "OOOOKAY. SORRY. IN THAT CASE, HI THERE SIGHTLESS PERSON"
-#define TEXTD63 "I'M JOHN HACKER. YOU MUST BE ONE OF THOSE CHARACTERS WHO WILL HELP ME OUT IN EXCHANGE FOR AN OBJECT. AREN'T YOU? EH? AREN'T YOU?"
-#define TEXTD64 "UUUUM, EXCUSE ME FOR ASKING BLIN... SIGHTLESS PERSON! BUT WHAT SORT OF JOB IS THAT, TO GIVE SICKLES IN EXCHANGE FOR MONEY WHILE YOU PLAY THE ACCORDION?"
-#define TEXTD65 "AH YES, I SUPPOSE THAT'S TRUE. GOODBYE SIGHTLESS PERSON... BLIND MAN"
-#define TEXTD66 "HERE IS THE LARGE AMOUNT OF MONEY YOU ASKED ME FOR"
-#define TEXTD67 "YOU BETTER HAVE HAD"
-
-#define TEXTD68 "HI THERE FOREIGNER"
-#define TEXTD69 "AND HOW DO YOU KNOW I'M BLIND?"
-#define TEXTD70 "AND I'M NOT KIDDING YOU BUT YOUR'S ARE LIKE WOODY ALLEN'S"
-#define TEXTD71 "NO, I CAN'T SEE"
-#define TEXTD72 "AND I'M NOT"
-#define TEXTD73 "OH OF COURSE. JUST COS I CAN'T SEE, YOU ACCUSE ME OF BEING BLIND"
-#define TEXTD74 "HI THERE FOREIGNER! WHAT ARE YOU DOING IN TRANSYLVANIA?"
-#define TEXTD75 "THAT'S RIGHT, FOREIGNER. IN EXCHANGE FOR A LARGE SUM OF MONEY I'LL GIVE YOU A SICKLE FOR WHEN YOU MIGHT NEED IT"
-#define TEXTD76 "SHHHH, I'M A SICKLES TRADER, THAT'S WHY I HAVE TO HIDE"
-#define TEXTD77 "BECAUSE YOU TOLD ME BEFORE, DIDN'T YOU?"
-#define TEXTD78 "THANKS FOREIGNER. HERE'S THE SICKLE IN EXCHANGE. YOU'LL FIND IT REALLY USEFUL LATER ON, HONESTLY"
-
-#define TEXTB1 "I'M HERE, DRINKING"
-#define TEXTB10 "FROM TIME TO TIME HE COMES DOWN TO THE VILLAGE AND TAKES SOMEONE WITH HIM."
-#define TEXTB11 "A LITTLE WHILE AFTER WE JUST A FEW FOUND BODY PARTS. I THINK HE IS DEALING WITH ORGANS OR SOMETHING LIKE THAT"
-#define TEXTB12 "THE ONLY PERSON IN THE VILLAGE WHO KNOWS HOW TO END UP WITH DRASCULA IS A CULTIVATED PERSON"
-#define TEXTB13 "HE LIVES IN A LOG-CABIN OUT OF TOWN, EVER SINCE DRASCULA BEAT HIM UP"
-#define TEXTB14 "HE IS THE ONLY ONE WHO COULD HELP US WITH DRASCULA, AND HE DOESN'T WANT TO HEAR ABOUT US. HOW DO YOU LIKE THAT?"
-#define TEXTB2 "THEY ARE ALL DEAD, THANKS. BURPP..."
-#define TEXTB3 "YES, SURE..."
-#define TEXTB4 "SHE FEELS ATTRACTED TO UNCLE DESIDERIO"
-#define TEXTB5 "EVEN BETTER, UNCLE DESIDERIO'S DEAD BODY"
-#define TEXTB6 "MY UNCLE. HE WENT TO CASTLE AND NEVER CAME BACK"
-#define TEXTB7 "WELL, HE CAME BACK JUST A LITTLE. IF ONLY VON BRAUN HADN'T SCREWED THINGS UP MY UNCLE WOULD BE DRINKING WITH US NOW"
-#define TEXTB8 "NOTHING..."
-#define TEXTB9 "WELL, YES !. THAT MEAN MAN HAS TERRIFIED US ALL"
-
-#define TEXTBJ1 "ARE YOU ALL RIGHT? HEY, COME ON, WAKE UP! CAN YOU HEAR ME? ARE YOU DEAD?"
-#define TEXTBJ10 "OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEEPED ON YOUR GLASSES BY ACCIDENT"
-#define TEXTBJ11 "YOU REALLY LOOK GOOD WITH THOSE GLASSES. I KNOW HE'S NOT FERNANDO LANCHA, BUT I FIND HIM ATTRACTIVE..."
-#define TEXTBJ12 "YES, YES, I DO... COME ON, HOLD ME AND KISS ME TIGHT"
-#define TEXTBJ13 "OH JHONNY, HONEY, THANKS GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO SEE THE FOOTBALL GAME"
-#define TEXTBJ14 "YES, IT'S TRUE. PLEASE, SET ME FREE"
-#define TEXTBJ15 "NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO LIBERATE WHILE YOU LET ME DOWN"
-#define TEXTBJ16 "JOHNNY, IS THAT YOU? OH, GOD, GREAT! I KNEW YOU'D COME!"
-#define TEXTBJ17 "YOU DON'T EVEN KNOW HOW MUCH THAT EVIL DRASCULA HAS MADE ME SUFFER"
-#define TEXTBJ18 "FIRSTLY HE BROUGHT ME FLYING OVER HER AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT EVEN A MIRROR OR ANYTHING"
-#define TEXTBJ19 "I'M TELLING YOU! AND THE WORSE PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE"
-#define TEXTBJ2 "NO, MY NAME IS BILLIE JEAN, BUT YOU CAN CALL ME B.J. IT'S SHORTER"
-#define TEXTBJ20 "JHONNY HONEY, WHERE ARE YOU?"
-#define TEXTBJ21 "I'M READY TO LEAVE DEAR"
-#define TEXTBJ22 "WAIT, I'M GOING TO TAKE A LOOK... NO DARLING, I'M SORRY"
-#define TEXTBJ23 "THERE YOU GO..."
-#define TEXTBJ24 "\"DEAR JOHNNY\""
-#define TEXTBJ25 "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"
-#define TEXTBJ26 "AND HE HAS ALSO RESCUED ME FROM DRASCULA. HE HAS ASKED ME TO MARRY HIM, AND I HAVE ACCEPTED"
-#define TEXTBJ27 "BYE JHONNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS ITS OWN WAYS"
-#define TEXTBJ28 "I HOPE THERE WON'T BE HARD FEELINGS BETWEEN US. REMEMBER THAT I STILL LOVE YOU, BUT ONLY AS A FRIEND"
-#define TEXTBJ3 "HA, HA...! THAT WAS A GOOD ONE!"
-#define TEXTBJ4 "WELL, JHONNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS STRONG NOISE DOWN THE CORRIDOR"
-#define TEXTBJ5 "I DIDN'T PAY ATTENTION AT FIRST, BUT AFTER ABOUT TWO HOURS OR SO I COULDN'T SLEEP AND WENT OUT FOR A WALK"
-#define TEXTBJ6 "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"
-#define TEXTBJ7 "I WAS GOING TO GIVE YOU THE KISS OF LIFE BUT IT WASN'T NECESSARY BECAUSE YOU STARTED TO TALK"
-#define TEXTBJ8 "YOU SAID SOMETHING ABOUT A SCARECROW. I WAS VERY SCARED, YOU KNOW. IT'S A REAL SHOCK WHEN A DEAD PERSON STARTS TALKING RIGHT?"
-#define TEXTBJ9 "ISN'T THAT RIGHT? WELL, THEN I MANAGED TO BRING YOU TO MY ROOM THE BEST WAY I COULD. I PUT YOU IN BED... AND THAT'S ALL... HA, HA, HA..."
-
-#define TEXTD1 "HEY IGOR, HOW IS EVERYTHING GOING?"
-#define TEXTD10 "THE TIME HAS COME! TURN ON THE ALKALINE BATTERIES' SWITCH"
-#define TEXTD11 "DAMNED IT! WHAT WENT WRONG?"
-#define TEXTD12 "ARE YOU SURE YOU CHECKED IT ALL AND THERE WAS NOTHING MISSING? YOU'VE BEEN LATELY MESSING AROUND WITH THAT STUFF ABOUT TAXES AND I DON'T KNOW MAN..."
-#define TEXTD13 "YOU STUPID THING! YOU FORGOT TO CONNECT THE INDIFIBULATOR. THE SCREWS HAVE PROBABLY MAGNETIZED AND HIS BRAIN BURNT"
-#define TEXTD14 "YOU ARE DEAD, YOU ARE DEAD...WAIT TILL I GET YOU!"
-#define TEXTD15 "SHUT UP! I'LL GET ANOTHER BRAIN TOMORROW AND THEN WE WILL REPEAT THE EXPERIMENT"
-#define TEXTD16 "THIS TIME I'LL GET A WOMAN'S BRAIN. SHINY AND NOT USED YET...HA, HA, HA, GOODIE ONE!"
-#define TEXTD17 "SO WHAT? I'M THE BAD GUY, RIGHT? SO I CAN BE AS FULL OF MACHISMO AS I WANT, ALL RIGHT? AND IF YOU SAY SOMETHING AGAIN I'LL TURN YOUR HUMP BACK TO FRONT!"
-#define TEXTD18 "HA, HA, HA. YOU FELL TOOO!! NOW YOU ARE GOING TO PAY FOR DARING TO FIGHT AGAINST ME! IGOR, TAKE HIM TO THE PENDULUM OF DEATH!"
-#define TEXTD19 "AND SO, TELL ME , YOU STUPID HUMAN. HOW COME YOU WANT TO DESTROY ME?"
-#define TEXTD2 "IT'S ALWAYS THE SAME STORY EVERYTIME THERE'S A GOOD GAME ON THE SATELLITE! ANYWAY, WE'LL GO WATCH IT IN THE BAR, AS USUAL"
-#define TEXTD20 "THAT'S BEAUTIFUL!. IF IT WASN'T BECAUSE IT MAKES ME LAUGH, I WOULD CRY"
-#define TEXTD21 "OUR GIRLFRIEND'S BRAIN TO HELP ME CONQUERING THE WORLD"
-#define TEXTD22 "YES, SURE! I'LL TAKE IT FROM HER AND GIVE IT TO MY FRUSKYNSTEIN. THE WORLD WILL BE MINE WITH IT, HA, HA"
-#define TEXTD23 "WHAT!? YOU'RE DEAD, MAN! I'M GOING TO...YOU REALLY GOT ME ANGRY MAN...COME ON, PREPARE TO DIE!"
-#define TEXTD24 "HA, HA, HA. NOT EVEN IN YOUR WILDEST DREAMS!"
-#define TEXTD25 "YES, ISN'T IT? HA, HA"
-#define TEXTD26 "ALL RIGHT, ALL RIGHT. BUT DO IT QUICKLY, OK?"
-#define TEXTD27 "PUT THAT CIGARETTE OUT NOW! I CAN'T STAND YOU ANYMORE!"
-#define TEXTD28 "AND SO, DOES THAT BREW HAVE THE OPPOSITE EFFECT?"
-#define TEXTD29 "WELL, WE'LL SEE THAT"
-#define TEXTD3 "IGOR LISTEN CAREFULLY MAN, WE ARE GOING TO START WITH PHASE NUMBER ONE OF MY PLAN TO CONQUER THE WORLD"
-#define TEXTD30 "OK, LET'S SEE IT. IGOR, BRING ME THE CD \"SCRATCHING YOUR NAILS ALL OVER THE BLACKBOARD\""
-#define TEXTD31 "NO WAY. THE GIRL STAYS WITH ME. YOU RE STAYING THERE UNTIL THE PENDULUM CUTS YOU INTO THIN SLICES. HA, HA, HA"
-#define TEXTD32 "MAN I'M I JUST BAD... COME ON IGOR, LET'S MAKE THE BREW AND CONQUER THE WORLD"
-#define TEXTD33 "WHAT HAPPENS NOW?"
-#define TEXTD34 "YES, WHAT?...OH, DAMNED, THE GAME!"
-#define TEXTD35 "I FORGOT ABOUT THAT. GET THE GIRL AND LET'S GO AND WATCH IT. WE CAN CONQUER THE WORLD LATER"
-#define TEXTD36 "THANKS MAN, I WAS THIRSTY"
-#define TEXTD37 "OH, THE CRUCIFIX!!...THE CRUCIFIX...!"
-#define TEXTD38 "I DIDN'T NOTICE ABOUT THAT BEAUTIFUL CRUCIFIX!"
-#define TEXTD39 "LEAVE ME ALONE!, I'M WATCHING THE GAME"
-#define TEXTD4 "FIRST WE'LL CAPTURE ONE OF THE LIGHTNINGS AND WE'LL DEMAGNETIZE IT WITH OUR INDIFIBULATOR. THE ELECTRICITY WILL COME THROUGH TO MY MONSTER AND HE'LL GET ALIVE!"
-#define TEXTD5 "IF EVERYTHING WORKS OUT ALL RIGHT, THIS WILL BE THE BEGINNING OF A GREAT ARMY THAT WILL CONQUER THE WORLD FOR ME. HA, HA"
-#define TEXTD6 "THE MONSTERS WILL DESTROY ALL THE ARMY'S WEAPONS IN THE WORLD, MEANWHILE, WE'LL BE SAFE IN THE PIECES OF LAND I BOUGHT IN GIBRALTAR"
-#define TEXTD7 "WE'LL SET UP A COUP. GOVERNMENTS ALL OVER THE WORLD WILL BE UNCOVERED AND THEIR COUNTRIES WILL SURRENDER TO ME!"
-#define TEXTD8 "I'LL BECOME THE FIRST BAD GUY IN HISTORY TO MAKE IT ! HA, HA!"
-#define TEXTD9 "I'M NOT TALKING TO YOU, IDIOT! I'M JUST GIVING YOU THE PLOT. ALL RIGHT, EVERYTHING READY?"
-
-#define TEXTE1 "YOU... HEY YOU!"
-#define TEXTE10 "YEAH, IT'S YOU"
-#define TEXTE11 "WHY DO ALL ADVENTURE GAMES END UP WITH A SUNRISE OR A SUNSET?"
-#define TEXTE12 "DO ALL THESE NAMES BELONG TO THE CREATORS OF THE GAME?"
-#define TEXTE13 "AREN'T THEY ASHAMED TO BE SEEN BY EVERYBODY?"
-#define TEXTE14 "JESUS, THAT EMILIO DE PAZ IS EVERYWHERE!!"
-#define TEXTE15 "REALLY?"
-#define TEXTE16 "YES"
-#define TEXTE17 "WELL, DON'T MAKE A FUSS ABOUT IT"
-#define TEXTE18 "HEY WEREWOLF, BY THE WAY..."
-#define TEXTE19 "DIDN'T YOU FALL OFF A WINDOW AND GOT BADLY HURT"
-#define TEXTE2 "DON'T GIVE ME THAT CRAP ABOUT A DEAD BODY OK?"
-#define TEXTE20 "IF AT LEAST IT WASN'T ALWAYS THE SAME ONES..."
-#define TEXTE21 "HE'S BEEN OUT FOUR TIMES ALREADY"
-#define TEXTE22 "I'D LIKE TO BE A MODEL"
-#define TEXTE23 "ALL RIGHT, AND WHAT ARE YOU GOING TO DO?"
-#define TEXTE3 "I'M ALIVE. IT'S JUST THAT I'M STARVING"
-#define TEXTE4 "WELL, YOU SEE. I WAS THE DRUNKARD OF THE VILLAGE, JUST KEEPING UP WITH THE FAMILY TRADITION, YOU KNOW? ONE NIGHT DRASCULA KIDNAPPED ME TO TAKE MY ORGANS AWAY"
-#define TEXTE5 "SINCE ALCOHOL STILL KEEPS ME QUITE YOUNG, I'M HERE LIKE A SCRAP YARD. EVERYTIME HE NEEDS SOMETHING FOR THE MONSTER HE IS MAKING, HE COMES AND TAKES IT FROM ME"
-#define TEXTE6 "IT HURT AT FIRST, BUT I DON'T CARE ANYMORE"
-#define TEXTE7 "I DON'T KNOW. I GUESS IT'S HIS GRADUATE PROJECT"
-#define TEXTE8 "I'M DESIDERIO, AND I CAN HELP YOU IN ANYTHING YOU NEED"
-#define TEXTE9 "THE TRUTH IS THAT I DON'T REALLY FEEL LIKE IT, BUT THANKS VERY MUCH ANYWAY SIR"
-
-#define TEXTI1 "MASTER, I THINK THIS IS NOT WORKING"
-#define TEXTI10 "YES, MY MASTER"
-#define TEXTI11 "MASTER"
-#define TEXTI12 "DO YOU KNOW WHAT TIME IS IT?"
-#define TEXTI13 "WHAT? OH, THAT SCARED ME!. YOU ARE THE \"NIGHT-CLEANING GUY\", RIGHT?"
-#define TEXTI14 "I'M IGOR, THE VALET. YOU CAN START WITH THE BALL ROOM. THERE'S BEEN A SUPER NATURAL ORGY YESTERDAY AND IT LOOKS LIKE SHIT"
-#define TEXTI15 "IF YOU NEED ANYTHING, JUST BUY IT"
-#define TEXTI16 "IT'S THE TAX RETURN APPLICATION FORM, CAN'T YOU SEE IT?"
-#define TEXTI17 "NEITHER DO I. FIRST OF ALL THE NUMBERS ARE VERY SMALL AND ALSO I CAN'T SEE MUCH AT THIS DISTANCE."
-#define TEXTI18 "NO WAY! THEY MAKE ME LOOK UGLY"
-#define TEXTI19 "OH, WELL. IT'S JUST LIKE A CRAZY PARTY THAT THE MASTER ORGANIZES WITH HIS FRIENDS EACH TIME SOME IDIOT COMES ALONG TRYING TO KILL HIM"
-#define TEXTI2 "I AM POSITIVE, MASTER"
-#define TEXTI20 "THEY TAKE HIS EYES OUT. THEN, POUR SOME LEMON JUICE SO THAT IT ITCHES TO DEATH, AND THEN..."
-#define TEXTI21 "NO"
-#define TEXTI22 "WHAT DO YOU MEAN WHY NOT? DO YOU KNOW WHAT TIME IT IS?"
-#define TEXTI23 "YES, IT'S WINTER"
-#define TEXTI24 "SEE YOU LATER"
-#define TEXTI25 "DON'T EVEN THINK ABOUT IT!"
-#define TEXTI26 "WELL, THAT'S ENOUGH FOR TODAY. I'M GOING TO HAVE SUPPER"
-#define TEXTI27 "MAN, I ALWAYS FORGET TO LOCK IT, RIGHT?"
-#define TEXTI28 "THE HELL WITH IT!"
-#define TEXTI29 "WHAT? OH, YOU SCARED ME MASTER, I THOUGHT YOU WERE ASLEEP"
-#define TEXTI3 "I'M SORRY MASTER"
-#define TEXTI30 "OH, BY THE WAY, I TOOK THE LIVING-ROOM KEYS SO THAT YOU CAN WATCH THE EARLY MORNING CARTOONS WITHOUT WAKING ME UP"
-#define TEXTI31 "YOU'VE GOT ANOTHER COLD MASTER? DAMN IT! I TOLD YOU TO GET SOME HEATING IN HERE..."
-#define TEXTI32 "ALL RIGHT, JUST TAKE YOUR ASPIRIN AND GO TO BED TO SWEAT FOR A WHILE. GOOD NIGHT"
-#define TEXTI4 "ARE YOU GOING TO BRING HERE ANOTHER CRAZY SCIENTIST? I'LL TELL YOU THAT THE LABORATORY IS ALREADY PACKED UP, AND BESIDES, THEY'RE ALL OUT OF DATE"
-#define TEXTI5 "HUSH MASTER, THE FEMINIST COULD HEAR YOU"
-#define TEXTI6 "DAMNED IT!"
-#define TEXTI7 "I DIDN'T EXPECT YOU SO SOON, MASTER"
-#define TEXTI8 "QUITE BAD MASTER. THERE MUST BE SOME PROBLEMS WITH THE SATELLITE AND I JUST CAN'T RECEIVE ANYTHING. BESIDES THERE ARE SOME INTERFERENCES BECAUSE OF THE STORM"
-#define TEXTI9 "WHAT DO I KNOW, MASTER?"
-
-#define TEXTL1 "ARE YOU GOING TO LET OURSELVES BE GUIDED BY PRIMITIVE INSTINCTS JUST BECAUSE WE BELONG TO DIFFERENT RACES AND THE SOCIAL SITUATION IS TELLING US TO DO SO?"
-#define TEXTL10 "PUKE! HUNTING AS A WAY TO SURVIVE IS AN INCOMPATIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN"
-#define TEXTL11 "IT JUST HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO BETHINK AND GET TO THE ABOVE MENTIONED THOUGHT"
-#define TEXTL12 "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"
-#define TEXTL13 "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"
-#define TEXTL14 "IT DOESN'T REALLY GET TO ME AT ALL"
-#define TEXTL15 "WHAT?"
-#define TEXTL16 "I DON'T KNOW WHAT YOU'RE TALKING ABOUT, YOU EPHEMERAL CREATURE"
-#define TEXTL17 "I'M NOT INTERESTED"
-#define TEXTL18 "I DON'T KNOW ABOUT THE OTHER GAMES, BUT WE COULD USE THIS BEAUTIFUL SCREEN"
-#define TEXTL2 "AREN'T WE TIED BY SENSE WHICH IS THE MOST POWERFUL WEAPON AS WELL AS THE MOST PRECIOUS GIFT?"
-#define TEXTL20 "I'D CARE..."
-#define TEXTL21 "NO. IT'S JUST THE SON, THE FATHER, THE GRANDFATHER AND A FRIEND, WHO ARE CALLED LIKE THAT"
-#define TEXTL22 "BUT, IT IS GOING TO LOOK LIKE THE GAME WAS MADE BY FIVE PEOPLE"
-#define TEXTL23 "THESE ARE PROMISING GUYS"
-#define TEXTL24 "THAT'S A GOOD ONE! A GOOD ONE!"
-#define TEXTL25 "PLEASE, CALL ME CONSTANTINO"
-#define TEXTL26 "IT WASN'T ME MAN. IT WAS \"EL COYOTE\", MY TWIN"
-#define TEXTL27 "JESUS, THESE ARE REALLY LONG CREDIT TITLES"
-#define TEXTL28 "I STOPPED COUNTING A LONG TIME AGO"
-#define TEXTL29 "WHAT WILL BECOME OF YOU NOW, DESIDERIO?"
-#define TEXTL3 "OH, IF WE ALL LET OUR THOUGHTS GUIDE OUR WAY IN LIFE WITHOUT LEAVING SOME ROOM FOR FEELINGS WHICH LET OUR PRE-EVOLUTIVE INSTINCTS COME OUT!"
-#define TEXTL30 "BUT, YOU SHOULD LOSE SOME WEIGHT"
-#define TEXTL31 "I'LL JUST RETIRE TO THE TIBET AND THINK ABOUT THE MEANING OF LIFE"
-#define TEXTL4 "ANSWER ME, EPHEMERAL CREATURE. WOULDN'T WE ALL BE HAPPIER WITH THOSE EMOTIONAL BOUNDINGS?"
-#define TEXTL5 "YOU ARE NOT GETTING THROUGH"
-#define TEXTL6 "THIS IS A VERY CLEAR EXAMPLE, YOU SEE?: YOU WANT TO GET THROUGH AND GO AHEAD WITH YOUR ADVENTURE, AND I WON'T LET YOU DO THAT"
-#define TEXTL7 "WILL THAT BE A CONTROVERSIAL POINT BETWEEN US THAT HAVE JUST MET?"
-#define TEXTL8 "WELL THEN"
-#define TEXTL9 "WELL, THAT DEPENDS ON WHAT WE TAKE A RELATIONSHIP FOR. SOME AUTHORS DEFEND..."
-
-#define TEXTP1 "HI"
-#define TEXTP10 "I'M A CONSERVATOIRE PIANIST AND THE BARTENDER WON'T BUY MORE SCORES FOR ME"
-#define TEXTP11 "OH GOD, I REALLY LOVE CLASSIC MUSIC!"
-#define TEXTP12 "IT'S BECAUSE I'M WEARING EAR-PLUGS"
-#define TEXTP13 "IT'S BECAUSE I CAN LIP-READ"
-#define TEXTP14 "NOOO"
-#define TEXTP15 "NO! I'M NOT TAKING THIS ANY LONGER!"
-#define TEXTP16 "NO WAYYYYY!"
-#define TEXTP17 "WHAT? OF COURSE I'M INTERESTED"
-#define TEXTP18 "THANKS GOD! I CAN PLAY A DIFFERENT SONG NOW!"
-#define TEXTP19 "I GUESS YOU CAN KEEP MY EAR-PLUGS"
-#define TEXTP2 "YES SIR. IT'S BEAUTIFUL"
-#define TEXTP3 "NO, NO. HE WON'T DO IT"
-#define TEXTP4 "ALL RIGHT THEN"
-#define TEXTP5 "REALLY?"
-#define TEXTP6 "SO?"
-#define TEXTP7 "I'M SORRY. THE PIANIST UNION TRADE DOESN'T ALLOW ME TO SAVE GIRLS FROM VAMPIRES' CLUTCHES"
-#define TEXTP8 "IF SHE HAD BEEN KIDNAPPED BY THE WEREWOLF..."
-#define TEXTP9 "I CAN ONLY PLAY THIS SONG"
-
-#define TEXTT1 "WHAT HAPPENS, WHAT'S THE MATTER?"
-#define TEXTT10 "THEY'RE WINNING"
-#define TEXTT11 "LEAVE ME ALONE, ALL RIGHT?"
-#define TEXTT12 "OF COURSE. I'M NOT BLIND"
-#define TEXTT13 "THE TRADITION IN THIS VILLAGE IS TO FORGET ALL HARD FEELINGS WHENEVER THERE IS A GAME, SO AS TO CHEER UP THE LOCAL TEAM"
-#define TEXTT14 "AND PLEASE, SHUT UP FOR GOD'S SAKE. I CAN'T HEAR ANYTHING!"
-#define TEXTT15 "COME ON, LEAVE ME ALONE AND DON'T BOTHER ME ANYMORE"
-#define TEXTT16 "IT HAS JUST STARTED! AND SHUT UP!"
-#define TEXTT17 "OK, OK, I THOUGHT SOMETHING WAS GOING ON"
-#define TEXTT18 "IT DOESN'T MATTER, ANYWAY. SHE'LL PROBABLY BE DEAD BY NOW"
-#define TEXTT19 "HE JUST STARTED PLAYING CLASSIC MUSIC, AND I COULDN'T STAND IT"
-#define TEXTT2 "OK. ROOM 512. UPSTAIRS. THE KEY IS ON THE DOOR"
-#define TEXTT20 "SINCE I'M PAYING HIM FOR PLAYING WHATEVER I WISH, I JUST FIRED HIM"
-#define TEXTT21 "AND THEN, HE GOT FRESH WITH ME. JESUS!, HE LOOKED SO NICE AND INNOCENT...WHAT A HYPOCRITE!"
-#define TEXTT22 "BY THE WAY, BE CAREFUL BECAUSE I JUST WAXED THE FLOOR"
-#define TEXTT23 "SHUT UP! WE'RE WATCHING THE GAME!"
-#define TEXTT24 "OH, COME ON! TAKE IT!"
-#define TEXTT3 "COUNT DRASCULA!!?"
-#define TEXTT4 "NO, NOTHING. THAT GUY HAS A BAD REPUTATION OVER HERE"
-#define TEXTT5 "WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK UP THEIR BLOOD"
-#define TEXTT6 "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"
-#define TEXTT7 "BUT OF COURSE, THOSE ARE JUST RUMORS. HE'S PROBABLY BOTH THINGS. BY THE WAY, WHY DO YOU WANT TO MEET HIM?"
-#define TEXTT8 "NO, FORGET IT. I'M REALLY BUSY..."
-#define TEXTT9 "WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TELL ME TO"
-#define TEXTD82 "NO, NOTHING"
-
-#define TEXTVB1 "WHO THE HELL IS CALLING AT THIS TIME?"
-#define TEXTVB10 "YOU DON'T HAVE THEM"
-#define TEXTVB11 "I'M SURE YOU WOULDN'T BET ALL YOUR MONEY ON IT, HUH?"
-#define TEXTVB12 "WELL, ALL RIGHT, COME ON IN"
-#define TEXTVB13 "IF YOU REALLY MEAN TO FACE DRASCULA, YOU'VE GOT TO BE ABLE TO TAKE ALL TYPES OF CREAKING AND VAMPIRE-LIKE NOISES"
-#define TEXTVB14 "IS THAT CLEAR?"
-#define TEXTVB15 "OK, WAIT A MINUTE"
-#define TEXTVB16 "STAND IN THE CENTER OF THE ROOM, PLEASE"
-#define TEXTVB17 "WHERE DID I PUT THAT RECORD CALLED \"NAILS SCRATCHING THE BLACKBOARD\"?"
-#define TEXTVB18 "ALL RIGHT. LET'S GET TO IT"
-#define TEXTVB19 "YOU ARE USELESS. YOU SEE...?, JUST LIKE THE REST!!"
-#define TEXTVB2 "OH, ..OH, NO, NO....I'M...GANIMEDES THE DWARF. PROFESSOR VON BRAUN DOESN'T LIVE HERE ANYMORE"
-#define TEXTVB20 "JUST GIVE ME NOW THE MONEY YOU LOST AND GET OUT OF HERE"
-#define TEXTVB21 "AND DON'T COME BACK UNTIL YOU ARE ABSOLUTELY READY"
-#define TEXTVB22 "WHAT DO YOU WANT NOW?"
-#define TEXTVB23 "I HAVE TO ADMIT IT. YOU REALLY GOT WHAT IT TAKES TO FIGHT AGAINST THE VAMPIRES"
-#define TEXTVB24 "HEY, TAKE YOUR MONEY. I ADMIT IT WHEN I MAKE A MISTAKE..."
-#define TEXTVB25 "LEAVE ME ALONE NOW, I WANT TO GET SOME SLEEP"
-#define TEXTVB26 "WHENEVER YOU ARE READY TO FIGHT AGAINST THE VAMPIRES, JUST COME BACK AND I'LL HELP YOU OUT"
-#define TEXTVB27 "OH, THAT'S EASY. JUST USING THE LIGHT OF ONE CRUCIFIX IS ENOUGH TO DESTROY HIM"
-#define TEXTVB28 "YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTICS POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE"
-#define TEXTVB29 "YOU'D BE LOST IF IT WASN'T FOR THEY..."
-#define TEXTVB3 "NO, I DON'T KNOW WHERE IT IS !!"
-#define TEXTVB30 "...BREW!"
-#define TEXTVB31 "YEAH, YOU'RE RIGHT! I MIGHT HAVE SOME PROBLEMS WITH MY BACK IN THE FUTURE IF I KEEP ON SLEEPING THIS WAY"
-#define TEXTVB32 "I UNDERSTAND HE WAS A BETTER OPPONENT THAN ME, BUT YOU HAVE TO ADMIT THAT THE DISCOVERY I MADE ABOUT ANTI-VAMPIRE TECHNIQUES WAS WHAT ACTUALLY PROTECTED ME"
-#define TEXTVB33 "I'VE FOUND THIS IMMUNIZING BREW THAT KEEPS YOU SAFE FROM ANY VAMPIRES' BITE OR AGAINST HIS FRISISNOTICS POWERS"
-#define TEXTVB34 "NO, NO, EXCUSE ME. I HAD IT ONCE BUT IT'S VERY DANGEROUS TO HAVE A BREW OF THAT TYPE. CAN YOU IMAGINE WHAT COULD HAPPEN IF A VAMPIRE GOT IT?"
-#define TEXTVB35 "HE'D BE IMMUNIZED AGAINST GARLIC, THE SUNSHINE LIGHT... SO I HAD TO GET RID OF WHAT I DIN'T USE BY THE SCIENTIFIC METHOD OF THROWING IT IN THE LAVATORY"
-#define TEXTVB36 "DON'T WORRY, I REMEMBER EXACTLY HOW TO MAKE THAT BREW"
-#define TEXTVB37 "I NEED GARLIC, BUT I ALREADY HAVE THEM. HOWEVER YOU'LL HAVE TO GET ME SOME WAX, BUBBLE GUM AND CIGARETTE PAPER OR PERHAPS A NAPKING OR SOMETHING ALIKE"
-#define TEXTVB38 "OH...AND OF COURSE THE MOST IMPORTANT INGREDIENT. LEAVES FROM A VERY STRANGE PLANT CALLED FERNAN"
-#define TEXTVB39 "IT'S A CLIMBING PLANT WHICH LEAVES HAVE MAGIC POWERS IF THEY'RE CUT WITH A GOLDEN SICKLE"
-#define TEXTVB4 "GET OUT!!"
-#define TEXTVB40 "SO THAT AS SOON AS YOU HAVE THESE FIVE THINGS, JUST COME HERE AND I'LL MAKE THE BREW"
-#define TEXTVB41 "YOU'LL BE READY THEN TO FIGHT AGAINST DRASCULA"
-#define TEXTVB42 "REMEMBER: WAX, NICOTINE, A PIECE OF BUBBLE GUM, A PAPER AND SOME FERNAN'S LEAVES CUT WITH A GOLDEN SICKLE"
-#define TEXTVB43 "I TOLD YOU! IT WAS JUST BECAUSE OF THE BREW!"
-#define TEXTVB44 "OH, ALL RIGHT. I'M GOING TO MAKE MYSELF A...THE BREW. JUST A MOMENT, OK?"
-#define TEXTVB45 "IT'S A PROTECTING SPELL AGAINST VAMPIRES"
-#define TEXTVB46 "I PUT IT THERE IN ORDER TO PRETEND THAT THE SKETCHER DIDN'T FORGET TO DRAW THE WINDOW YOU CAN SEE FROM OUTSIDE"
-#define TEXTVB47 "ALL RIGHT, THE FIRST THING YOU MUST KNOW IS THE WAY TO DRASCULA'S CASTLE"
-#define TEXTVB48 "THERE IS A CAVERN THAT GETS YOU STRAIGHT FROM THE CASTLE. IGOR, THE CRAZY ELVIS' FUN, TAKES IT TO GET TO THE VILLAGE EACH MORNING"
-#define TEXTVB49 "BE CAREFUL THOUGH, THERE IS A VAMPIRE ALWAYS WATCHING OVER IT. YOU'LL HAVE TO GET RID OF HIM"
-#define TEXTVB5 "IT'S TOO LATE NOW, YOU IDIOT!! IT ALWAYS IS"
-#define TEXTVB50 "THERE IS AN OLD WELL RIGHT BY THE CEMETERY CHURCH"
-#define TEXTVB51 "IT WAS USED A LONG TIME AGO FOR WITCHCRAFT TRIALS"
-#define TEXTVB52 "THEY THREW THE WITCHES IN THE WELL. IF THEY DROWNED THEY WERE REAL WITCHES. IF THEY DIDN'T, THEY WEREN'T"
-#define TEXTVB53 "WE THREW ONE ONCE AND SHE DIDN'T DROWN, I GUESS SHE WASN'T A WITCH"
-#define TEXTVB54 "ANYWAY. THERE IS YOUR BREW. HOWEVER, I ONLY GOT TO MAKE ENOUGH JUST FOR ONE PERSON"
-#define TEXTVB55 "YOU'D BETTER SMOKE IT RIGHT BEFORE YOU FIGHT AGAINST DRASCULA"
-#define TEXTVB56 "COME ON, RUN!"
-#define TEXTVB57 "OH, JUST EXCUSES...!"
-#define TEXTVB58 "ARE YOU JOHN HACKER? I'M DOCTOR VON BRAUN"
-#define TEXTVB59 "LISTEN TO ME, THIS IS VERY IMPORTANT. IT'S ABOUT THE BREW"
-#define TEXTVB6 "I COULDN'T AGREE MORE"
-#define TEXTVB60 "SHUT UP AND LET ME TALK. I JUST FOUND THIS BOOK ABOUT ANTI-VAMPIRE BREWS WARNING AGAINST MIXING THE JOINT WITH ANY ALCOHOLIC DRINK BEFORE YOU"
-#define TEXTVB61 "ALCOHOL REACTS WHEN MIXED WITH BREW, SO THAT IT CANCELS OUT ITS EFFECTS JUST IN A FEW SECONDS"
-#define TEXTVB62 "I'M SORRY, BUT I HAVE TO HANG UP RIGHT NOW. THE POLICE IS LOOKING FOR ME, THEY THINK I'M A PUSHER. STUPIDS!. ANYWAY, BYE AND GOOD LUCK SAVING THE WORLD!"
-#define TEXTVB7 "ME, SCARED?"
-#define TEXTVB8 "LISTEN HERE, DUDE. YOU'RE RIGHT NOW TALKING TO THE ONLY PERSON WHO KNOWS THE SECRET TO FIGHT AGAINST THE VAMPIRE"
-#define TEXTVB9 "YOU NEED TO HAVE SPECIAL SKILLS TO FIGHT AGAINST A VAMPIRE. NOT EVERYBODY CAN DO IT"
-
-#define SYS0 "PRESS 'DEL' AGAIN TO RESTART"
-#define SYS1 "PRESS 'ESC' AGAIN TO EXIT"
-#define SYS2 "SPEECH ONLY"
-#define SYS3 "TEXT AND SPEECH"
-
-#define HIS1 "A long time ago, it seems that Drascula killed Von Braun's wife, and then, as he intended to face the count, Von Braun started to investigate all he found vampires."
-#define HIS2 "When he thought he was ready, he came up to the castle and had a very violent encounter with Drascula."
-#define HIS3 "Nobody knows exactly what happened there. Although Von Braun lost, Drascula could not kill him."
-#define HIS4 "Von Braun felt humiliated by his defect, run away from the castle and has never dared to face Drascula ever again."
diff --git a/engines/engines.mk b/engines/engines.mk
index b23ea597bd..cfb8e69f3e 100644
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@ -1,122 +1,103 @@
-ifdef DISABLE_SCUMM
-DEFINES += -DDISABLE_SCUMM
-else
+ifdef ENABLE_SCUMM
+DEFINES += -DENABLE_SCUMM=$(ENABLE_SCUMM)
MODULES += engines/scumm
-ifdef DISABLE_SCUMM_7_8
-DEFINES += -DDISABLE_SCUMM_7_8
+ifdef ENABLE_SCUMM_7_8
+DEFINES += -DENABLE_SCUMM_7_8
endif
-ifdef DISABLE_HE
-DEFINES += -DDISABLE_HE
+ifdef ENABLE_HE
+DEFINES += -DENABLE_HE
endif
endif
-ifdef DISABLE_AGI
-DEFINES += -DDISABLE_AGI
-else
+ifdef ENABLE_AGI
+DEFINES += -DENABLE_AGI=$(ENABLE_AGI)
MODULES += engines/agi
endif
-ifdef DISABLE_AGOS
-DEFINES += -DDISABLE_AGOS
-else
+ifdef ENABLE_AGOS
+DEFINES += -DENABLE_AGOS=$(ENABLE_AGOS)
MODULES += engines/agos
endif
-ifdef DISABLE_CINE
-DEFINES += -DDISABLE_CINE
-else
+ifdef ENABLE_CINE
+DEFINES += -DENABLE_CINE=$(ENABLE_CINE)
MODULES += engines/cine
endif
-ifdef DISABLE_CRUISE
-DEFINES += -DDISABLE_CRUISE
-else
+ifdef ENABLE_CRUISE
+DEFINES += -DENABLE_CRUISE=$(ENABLE_CRUISE)
MODULES += engines/cruise
endif
-ifdef DISABLE_DRASCULA
-DEFINES += -DDISABLE_DRASCULA
-else
+ifdef ENABLE_DRASCULA
+DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA)
MODULES += engines/drascula
endif
-ifdef DISABLE_GOB
-DEFINES += -DDISABLE_GOB
-else
+ifdef ENABLE_GOB
+DEFINES += -DENABLE_GOB=$(ENABLE_GOB)
MODULES += engines/gob
endif
-ifdef DISABLE_IGOR
-DEFINES += -DDISABLE_IGOR
-else
+ifdef ENABLE_IGOR
+DEFINES += -DENABLE_IGOR=$(ENABLE_IGOR)
MODULES += engines/igor
endif
-ifdef DISABLE_KYRA
-DEFINES += -DDISABLE_KYRA
-else
+ifdef ENABLE_KYRA
+DEFINES += -DENABLE_KYRA=$(ENABLE_KYRA)
MODULES += engines/kyra
endif
-ifdef DISABLE_LURE
-DEFINES += -DDISABLE_LURE
-else
+ifdef ENABLE_LURE
+DEFINES += -DENABLE_LURE=$(ENABLE_LURE)
MODULES += engines/lure
endif
-ifdef DISABLE_M4
-DEFINES += -DDISABLE_M4
-else
+ifdef ENABLE_M4
+DEFINES += -DENABLE_M4=$(ENABLE_M4)
MODULES += engines/m4
endif
-ifdef DISABLE_MADE
-DEFINES += -DDISABLE_MADE
-else
+ifdef ENABLE_MADE
+DEFINES += -DENABLE_MADE=$(ENABLE_MADE)
MODULES += engines/made
endif
-ifdef DISABLE_PARALLACTION
-DEFINES += -DDISABLE_PARALLACTION
-else
+ifdef ENABLE_PARALLACTION
+DEFINES += -DENABLE_PARALLACTION=$(ENABLE_PARALLACTION)
MODULES += engines/parallaction
endif
-ifdef DISABLE_QUEEN
-DEFINES += -DDISABLE_QUEEN
-else
+ifdef ENABLE_QUEEN
+DEFINES += -DENABLE_QUEEN=$(ENABLE_QUEEN)
MODULES += engines/queen
endif
-ifdef DISABLE_SAGA
-DEFINES += -DDISABLE_SAGA
-else
+ifdef ENABLE_SAGA
+DEFINES += -DENABLE_SAGA=$(ENABLE_SAGA)
MODULES += engines/saga
endif
-ifdef DISABLE_SKY
-DEFINES += -DDISABLE_SKY
-else
+ifdef ENABLE_SKY
+DEFINES += -DENABLE_SKY=$(ENABLE_SKY)
MODULES += engines/sky
endif
-ifdef DISABLE_SWORD1
-DEFINES += -DDISABLE_SWORD1
-else
+ifdef ENABLE_SWORD1
+DEFINES += -DENABLE_SWORD1=$(ENABLE_SWORD1)
MODULES += engines/sword1
endif
-ifdef DISABLE_SWORD2
-DEFINES += -DDISABLE_SWORD2
-else
+ifdef ENABLE_SWORD2
+DEFINES += -DENABLE_SWORD2=$(ENABLE_SWORD2)
MODULES += engines/sword2
endif
-ifdef DISABLE_TOUCHE
-DEFINES += -DDISABLE_TOUCHE
-else
+ifdef ENABLE_TOUCHE
+DEFINES += -DENABLE_TOUCHE=$(ENABLE_TOUCHE)
MODULES += engines/touche
endif
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp
index c6286fba3b..d508dc75f9 100644
--- a/engines/gob/coktelvideo.cpp
+++ b/engines/gob/coktelvideo.cpp
@@ -333,41 +333,44 @@ void Imd::waitEndFrame() {
g_system->delayMillis(_frameLength);
}
-void Imd::copyCurrentFrame(byte *dest, uint16 x, uint16 y, uint16 width, int16 transp) {
+void Imd::copyCurrentFrame(byte *dest,
+ uint16 left, uint16 top, uint16 width, uint16 height,
+ uint16 x, uint16 y, uint16 pitch, int16 transp) {
+
if (!_vidMem)
return;
- dest += width * y;
+ if (((left + width) > _width) || ((top + height) > _height))
+ return;
- uint16 copyWidth = MIN<int16>(width - x, _width);
- uint16 destPitch = width - x;
- byte *vidMem = _vidMem;
+ dest += pitch * y;
+ byte *vidMem = _vidMem + _width * top;
if (transp < 0) {
// No transparency
- if ((x > 0) || (_width != width)) {
+ if ((x > 0) || (left > 0) || (pitch != _width) || (width != _width)) {
// Copy row-by-row
- for (int i = 0; i < _height; i++) {
- dest += x;
- memcpy(dest, vidMem, copyWidth);
- dest += destPitch;
+ for (int i = 0; i < height; i++) {
+ byte *d = dest + x;
+ byte *s = vidMem + left;
+
+ memcpy(d, s, width);
+
+ dest += pitch;
vidMem += _width;
}
-
} else
// Dimensions fit, copy everything at once
- memcpy(dest, _vidMem, _width * _height);
+ memcpy(dest, vidMem, width * height);
return;
}
- // Transparency, copy per pixel
- for (int i = 0; i < _height; i++) {
- byte *s = vidMem;
- byte *d = dest;
+ for (int i = 0; i < height; i++) {
+ byte *d = dest + x;
+ byte *s = vidMem + left;
- d += x;
- for (int j = 0; j < _width; j++) {
+ for (int j = 0; j < width; j++) {
if (*s != transp)
*d = *s;
@@ -375,9 +378,10 @@ void Imd::copyCurrentFrame(byte *dest, uint16 x, uint16 y, uint16 width, int16 t
d++;
}
- dest += width;
+ dest += pitch;
vidMem += _width;
}
+
}
void Imd::deleteVidMem(bool del) {
@@ -938,9 +942,9 @@ bool Vmd::load(Common::SeekableReadStream &stream) {
} else
_frameLength = 1000 / _frameRate;
- uint32 frameInfoOffset = _stream->readUint32LE();
+ _frameInfoOffset = _stream->readUint32LE();
- _stream->seek(frameInfoOffset);
+ _stream->seek(_frameInfoOffset);
_frames = new Frame[_framesCount];
for (uint16 i = 0; i < _framesCount; i++) {
_frames[i].parts = new Part[_partsPerFrame];
@@ -1350,4 +1354,43 @@ void Vmd::deDPCM(byte *soundBuf, byte *dataBuf, int16 &init, uint32 n) {
}
}
+bool Vmd::getAnchor(int16 frame, uint16 partType,
+ int16 &x, int16 &y, int16 &width, int16 &height) {
+
+ uint32 pos = _stream->pos();
+
+ _stream->seek(_frameInfoOffset);
+ // Offsets to frames
+ _stream->skip(_framesCount * 6);
+ // Jump to the specified frame
+ _stream->skip(_partsPerFrame * frame * 16);
+
+ // Find the anchor part
+ uint16 i;
+ for (i = 0; i < _partsPerFrame; i++) {
+ byte type = _stream->readByte();
+
+ if ((type == 0) || (type == partType))
+ break;
+
+ _stream->skip(15);
+ }
+
+ if (i == _partsPerFrame) {
+ // No anchor
+
+ _stream->seek(pos);
+ return false;
+ }
+
+ _stream->skip(5);
+ x = _stream->readSint16LE();
+ y = _stream->readSint16LE();
+ width = _stream->readSint16LE() - x + 1;
+ height = _stream->readSint16LE() - y + 1;
+
+ _stream->seek(pos);
+ return true;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/coktelvideo.h b/engines/gob/coktelvideo.h
index 84271073f6..4f9543e8d0 100644
--- a/engines/gob/coktelvideo.h
+++ b/engines/gob/coktelvideo.h
@@ -90,6 +90,8 @@ public:
/** Returns the features the loaded video possesses. */
virtual uint16 getFeatures() const = 0;
+ /** Returns the flags the loaded video possesses. */
+ virtual uint16 getFlags() const = 0;
/** Returns the x coordinate of the video. */
virtual int16 getX() const = 0;
/** Returns the y coordinate of the video. */
@@ -113,6 +115,10 @@ public:
/** Returns the current frame's palette. */
virtual const byte *getPalette() const = 0;
+ /** Reads the video's anchor pointer */
+ virtual bool getAnchor(int16 frame, uint16 partType,
+ int16 &x, int16 &y, int16 &width, int16 &height) = 0;
+
/** Load a video out of a stream. */
virtual bool load(Common::SeekableReadStream &stream) = 0;
/** Unload the currently loaded video. */
@@ -148,13 +154,19 @@ public:
/** Copy the current frame.
*
- * @param dest The memory to which to copy the current frame
+ * @param dest The memory to which to copy the current frame.
+ * @param left The x position within the frame.
+ * @param top The y position within the frame.
+ * @param width The width of the area to copy.
+ * @param height The height of the area to copy.
* @param x The x position to where to copy.
* @param y The y position to where to copy.
* @param pitch The buffer's width.
* @param transp Which color should be seen as transparent?
*/
- virtual void copyCurrentFrame(byte *dest, uint16 x, uint16 y, uint16 width, int16 transp = -1) = 0;
+ virtual void copyCurrentFrame(byte *dest,
+ uint16 left, uint16 top, uint16 width, uint16 height,
+ uint16 x, uint16 y, uint16 pitch, int16 transp = -1) = 0;
};
/** Coktel Vision's IMD files.
@@ -165,6 +177,7 @@ public:
~Imd();
uint16 getFeatures() const { return _features; }
+ uint16 getFlags() const { return _flags; }
int16 getX() const { return _x; }
int16 getY() const { return _y; }
int16 getWidth() const { return _width; }
@@ -175,6 +188,9 @@ public:
uint32 getSyncLag() const { return _skipFrames; }
const byte *getPalette() const { return _palette; }
+ bool getAnchor(int16 frame, uint16 partType,
+ int16 &x, int16 &y, int16 &width, int16 &height) { return false; }
+
void setFrameRate(int16 frameRate);
bool load(Common::SeekableReadStream &stream);
@@ -192,7 +208,9 @@ public:
State nextFrame();
void waitEndFrame();
- void copyCurrentFrame(byte *dest, uint16 x, uint16 y, uint16 width, int16 transp = -1);
+ void copyCurrentFrame(byte *dest,
+ uint16 left, uint16 top, uint16 width, uint16 height,
+ uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
protected:
struct Coord {
@@ -260,6 +278,9 @@ public:
Vmd();
~Vmd();
+ bool getAnchor(int16 frame, uint16 partType,
+ int16 &x, int16 &y, int16 &width, int16 &height);
+
bool load(Common::SeekableReadStream &stream);
void unload();
@@ -295,6 +316,7 @@ protected:
bool _hasVideo;
+ uint32 _frameInfoOffset;
uint16 _partsPerFrame;
Frame *_frames;
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp
index ecd3181838..1fb43e96bb 100644
--- a/engines/gob/dataio.cpp
+++ b/engines/gob/dataio.cpp
@@ -84,12 +84,10 @@ uint32 DataStream::size() const {
void DataStream::seek(int32 offset, int whence) {
if (_stream)
_stream->seek(offset, whence);
-
- int32 resPos = _io->seekChunk(_handle, offset, whence);
- if (resPos != -1)
- return;
-
- _io->file_getHandle(_handle)->seek(offset, whence);
+ else if ((_handle < 50) || (_handle >= 128))
+ _io->file_getHandle(_handle)->seek(offset, whence);
+ else
+ _io->seekChunk(_handle, offset, whence);
}
bool DataStream::eos() const {
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index 4bd6668f5c..7637605dcd 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -57,7 +57,7 @@ static const PlainGameDescriptor gobGames[] = {
{"lostintime", "Lost in Time"},
{"inca2", "Inca II: Wiracocha"},
{"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble"},
-// {"dynasty", "The Last Dynasty"},
+ {"dynasty", "The Last Dynasty"},
{0, 0}
};
@@ -1685,7 +1685,7 @@ static const GOBGameDescription gameDescriptions[] = {
kFeatures640,
"intro"
},
- /*{
+ {
{
"dynasty",
"",
@@ -1697,7 +1697,20 @@ static const GOBGameDescription gameDescriptions[] = {
kGameTypeWoodruff,
kFeatures640,
"intro"
- },*/
+ },
+ {
+ {
+ "dynasty",
+ "",
+ AD_ENTRY1s("intro.stk", "61e4069c16e27775a6cc6d20f529fb36", 2511300),
+ EN_USA,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
{ AD_TABLE_END_MARKER, kGameTypeNone, kFeaturesNone, NULL }
};
@@ -1894,7 +1907,11 @@ bool GobMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common:
return gd != 0;
}
-REGISTER_PLUGIN(GOB, PLUGIN_TYPE_ENGINE, GobMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(GOB)
+ REGISTER_PLUGIN_DYNAMIC(GOB, PLUGIN_TYPE_ENGINE, GobMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(GOB, PLUGIN_TYPE_ENGINE, GobMetaEngine);
+#endif
namespace Gob {
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index a4417f7f1d..8f7d5b325b 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -246,11 +246,11 @@ void Draw_v2::printTotText(int16 id) {
}
if (_renderFlags & RENDERFLAG_FROMSPLIT) {
- destY = _vm->_video->_splitHeight1;
+ destY = _vm->_video->_splitStart;
spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2);
if (_renderFlags & RENDERFLAG_DOUBLECOORDS)
spriteBottom *= 3;
- spriteBottom += _vm->_video->_splitHeight1;
+ spriteBottom += _vm->_video->_splitStart;
if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
spriteBottom += _backDeltaX;
destY += _backDeltaX;
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 1d5ce65999..666f46fde1 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -311,7 +311,8 @@ void Game::evaluateScroll(int16 x, int16 y) {
if (_preventScroll || !_scrollHandleMouse || (_menuLevel > 0))
return;
- if (_noScroll || (_vm->_global->_videoMode != 0x14))
+ if (_noScroll ||
+ ((_vm->_global->_videoMode != 0x14) && (_vm->_global->_videoMode != 0x18)))
return;
if ((x == 0) && (_vm->_draw->_scrollOffsetX > 0)) {
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index c69db45f15..45542541e3 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -272,7 +272,7 @@ void Game_v2::playTot(int16 skipPlay) {
_vm->_snd->freeSample(_soundSamples[i]);
}
- _vm->_vidPlayer->closeVideo();
+ _vm->_vidPlayer->primaryClose();
if (_totToLoad[0] == 0)
break;
diff --git a/engines/gob/global.cpp b/engines/gob/global.cpp
index 0c9dfd6a5c..1445601017 100644
--- a/engines/gob/global.cpp
+++ b/engines/gob/global.cpp
@@ -53,8 +53,11 @@ Global::Global(GobEngine *vm) : _vm(vm) {
_mousePresent = UNDEF;
_mouseXShift = 3;
_mouseYShift = 3;
- _mouseMaxCol = 320;
- _mouseMaxRow = 200;
+
+ _mouseMinX = 0;
+ _mouseMinY = 0;
+ _mouseMaxX = 320;
+ _mouseMaxY = 200;
_useJoystick = 1;
diff --git a/engines/gob/global.h b/engines/gob/global.h
index 6095183b33..45c179d277 100644
--- a/engines/gob/global.h
+++ b/engines/gob/global.h
@@ -90,8 +90,11 @@ public:
int16 _mousePresent;
int16 _mouseXShift;
int16 _mouseYShift;
- int16 _mouseMaxCol;
- int16 _mouseMaxRow;
+
+ int16 _mouseMinX;
+ int16 _mouseMinY;
+ int16 _mouseMaxX;
+ int16 _mouseMaxY;
char _useJoystick;
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index e6afeefc03..863665357b 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -146,10 +146,7 @@ int GobEngine::init() {
return -1;
}
- _system->beginGFXTransaction();
- _system->initSize(_width, _height);
- initCommonGFX(is640());
- _system->endGFXTransaction();
+ _video->setSize(is640());
// On some systems it's not safe to run CD audio games from the CD.
if (isCD())
@@ -328,7 +325,7 @@ bool GobEngine::initGameParts() {
_draw = new Draw_v2(this);
_game = new Game_v2(this);
_map = new Map_v4(this);
- _goblin = new Goblin_v3(this);
+ _goblin = new Goblin_v4(this);
_scenery = new Scenery_v2(this);
_saveLoad = new SaveLoad_v3(this, _targetName.c_str());
break;
@@ -346,15 +343,15 @@ bool GobEngine::initGameParts() {
if (is640()) {
_video->_surfWidth = _width = 640;
_video->_surfHeight = _video->_splitHeight1 = _height = 480;
- _global->_mouseMaxCol = 640;
- _global->_mouseMaxRow = 480;
+ _global->_mouseMaxX = 640;
+ _global->_mouseMaxY = 480;
_mode = 0x18;
_global->_primarySurfDesc = new SurfaceDesc(0x18, 640, 480);
} else {
_video->_surfWidth = _width = 320;
_video->_surfHeight = _video->_splitHeight1 = _height = 200;
- _global->_mouseMaxCol = 320;
- _global->_mouseMaxRow = 200;
+ _global->_mouseMaxX = 320;
+ _global->_mouseMaxY = 200;
_mode = 0x14;
_global->_primarySurfDesc = new SurfaceDesc(0x14, 320, 200);
}
diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h
index 0da4b5ace5..f7ac4aa549 100644
--- a/engines/gob/goblin.h
+++ b/engines/gob/goblin.h
@@ -315,6 +315,20 @@ protected:
virtual void advMovement(Mult::Mult_Object *obj, int8 state);
};
+class Goblin_v4 : public Goblin_v3 {
+public:
+ virtual void movePathFind(Mult::Mult_Object *obj,
+ Gob_Object *gobDesc, int16 nextAct);
+ virtual void moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
+ int16 nextAct, int16 framesCount);
+
+ Goblin_v4(GobEngine *vm);
+ virtual ~Goblin_v4() {}
+
+private:
+ int16 sub_20430(int16 state, uint16 dir);
+};
+
} // End of namespace Gob
#endif // GOB_GOBLIN_H
diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp
new file mode 100644
index 0000000000..167946e30d
--- /dev/null
+++ b/engines/gob/goblin_v4.cpp
@@ -0,0 +1,646 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/gob.h"
+#include "gob/goblin.h"
+#include "gob/global.h"
+#include "gob/mult.h"
+#include "gob/map.h"
+#include "gob/scenery.h"
+
+namespace Gob {
+
+Goblin_v4::Goblin_v4(GobEngine *vm) : Goblin_v3(vm) {
+}
+
+void Goblin_v4::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 nextAct) {
+ Mult::Mult_AnimData *animData;
+ int16 framesCount;
+ int16 gobX;
+ int16 gobY;
+ int16 gobDestX;
+ int16 gobDestY;
+ int16 destX;
+ int16 destY;
+ int16 dir;
+
+ dir = 0;
+ animData = obj->pAnimData;
+ framesCount = _vm->_scenery->getAnimLayer(animData->animation, animData->layer)->framesCount;
+ animData->newCycle = framesCount;
+ gobX = obj->goblinX;
+ gobY = obj->goblinY;
+ animData->order = gobY;
+ gobDestX = obj->gobDestX;
+ gobDestY = obj->gobDestY;
+ animData->destX = gobDestX;
+ animData->destY = gobDestY;
+ destX = obj->destX;
+ destY = obj->destY;
+
+ if (animData->pathExistence == 1) {
+ dir = _vm->_map->getDirection(gobX, gobY, destX, destY);
+ if (dir == 0)
+ animData->pathExistence = 0;
+ if ((gobX == destX) && (gobY == destY))
+ animData->pathExistence = 4;
+ } else if (animData->pathExistence == 3) {
+ if ((gobX == gobDestX) && (gobY == gobDestY)) {
+ animData->pathExistence = 4;
+ destX = gobDestX;
+ destY = gobDestY;
+ } else {
+ if (_vm->_map->checkDirectPath(obj, gobX, gobY, gobDestX, gobDestY) != 1) {
+ if ((gobX == destX) && (gobY == destY)) {
+ if (obj->nearestWayPoint > obj->nearestDest) {
+ _vm->_map->optimizePoints(obj, gobX, gobY);
+ destX = _vm->_map->_wayPoints[obj->nearestWayPoint].x;
+ destY = _vm->_map->_wayPoints[obj->nearestWayPoint].y;
+ if (_vm->_map->checkDirectPath(obj, gobX, gobY, destX, destY) == 3) {
+ WRITE_VAR(56, 1);
+ animData->pathExistence = 0;
+ }
+ if (obj->nearestWayPoint > obj->nearestDest)
+ obj->nearestWayPoint--;
+ } else if (obj->nearestWayPoint < obj->nearestDest) {
+ _vm->_map->optimizePoints(obj, gobX, gobY);
+ destX = _vm->_map->_wayPoints[obj->nearestWayPoint].x;
+ destY = _vm->_map->_wayPoints[obj->nearestWayPoint].y;
+ if (_vm->_map->checkDirectPath(obj, gobX, gobY, destX, destY) == 3) {
+ WRITE_VAR(56, 1);
+ animData->pathExistence = 0;
+ }
+ if (obj->nearestWayPoint < obj->nearestDest)
+ obj->nearestWayPoint++;
+ } else {
+ if ((_vm->_map->checkDirectPath(obj, gobX, gobY, gobDestX, gobDestY) == 3) &&
+ (_vm->_map->getPass(gobDestX, gobDestY) != 0)) {
+ destX = _vm->_map->_wayPoints[obj->nearestWayPoint].x;
+ destY = _vm->_map->_wayPoints[obj->nearestWayPoint].y;
+ WRITE_VAR(56, 1);
+ } else {
+ animData->pathExistence = 1;
+ destX = gobDestX;
+ destY = gobDestY;
+ }
+ }
+ }
+ } else {
+ destX = gobDestX;
+ destY = gobDestY;
+ }
+ dir = _vm->_map->getDirection(gobX, gobY, destX, destY);
+ }
+ }
+
+ obj->goblinX = gobX;
+ obj->goblinY = gobY;
+ obj->gobDestX = gobDestX;
+ obj->gobDestY = gobDestY;
+ obj->destX = destX;
+ obj->destY = destY;
+
+ if (_vm->_map->_widthByte == 4) {
+ switch (dir) {
+ case Map::kDirNW:
+ animData->nextState = sub_20430(animData->state, Map::kDirNW);
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) &&
+ (animData->nextState == 1))
+ animData->nextState = 40;
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10)
+ animData->nextState = sub_20430(animData->state, Map::kDirNW);
+ break;
+
+ case Map::kDirN:
+ animData->nextState =
+ (animData->curLookDir == 2) ? 2 : sub_20430(animData->state, Map::kDirN);
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) {
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10) {
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) == 10)
+ animData->nextState = 42;
+ else
+ animData->nextState = 2;
+ } else
+ animData->nextState = 40;
+ }
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20) &&
+ (animData->nextState == 2))
+ animData->nextState = 38;
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19) &&
+ (animData->nextState == 2))
+ animData->nextState = 26;
+ break;
+
+ case Map::kDirNE:
+ animData->nextState = sub_20430(animData->state, Map::kDirNE);
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) &&
+ (animData->nextState == 3))
+ animData->nextState = 42;
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) != 10)
+ animData->nextState = sub_20430(animData->state, Map::kDirNE);
+ break;
+
+ case Map::kDirW:
+ animData->nextState = sub_20430(animData->state, Map::kDirW);
+ break;
+
+ case Map::kDirE:
+ animData->nextState = sub_20430(animData->state, Map::kDirE);
+ break;
+
+ case Map::kDirSW:
+ animData->nextState = sub_20430(animData->state, Map::kDirSW);
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) &&
+ (animData->nextState == 7))
+ animData->nextState = 41;
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY) != 10)
+ animData->nextState = sub_20430(animData->state, Map::kDirSW);
+ break;
+
+ case Map::kDirS:
+ animData->nextState =
+ (animData->curLookDir == 6) ? 6 : sub_20430(animData->state, Map::kDirS);
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) {
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY + 2) != 10) {
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY + 2) == 10)
+ animData->nextState = 43;
+ else
+ animData->nextState = 6;
+ } else
+ animData->nextState = 41;
+ }
+ // loc_20AAD
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20) &&
+ (animData->nextState == 6))
+ animData->nextState = 39;
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19) &&
+ (animData->nextState == 6))
+ animData->nextState = 27;
+ break;
+
+ case Map::kDirSE:
+ animData->nextState = sub_20430(animData->state, Map::kDirSE);
+ if ((_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) &&
+ (animData->nextState == 5))
+ animData->nextState = 43;
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY) != 10)
+ animData->nextState = sub_20430(animData->state, Map::kDirSE);
+ break;
+
+ default:
+ // loc_20D18
+ switch (animData->state) {
+ case 0:
+ case 8:
+ // loc_21134
+ animData->nextState = 8;
+ break;
+
+ case 1:
+ case 10:
+ case 40:
+ // loc_21152
+ animData->nextState = 10;
+ break;
+
+ case 2:
+ case 29:
+ // loc_2113E
+ animData->nextState = 29;
+ break;
+
+ case 3:
+ case 11:
+ case 42:
+ // loc_2115C
+ animData->nextState = 11;
+ break;
+
+ case 4:
+ case 9:
+ // loc_2112A
+ animData->nextState = 9;
+ break;
+
+ case 5:
+ case 30:
+ case 43:
+ // loc_21166
+ animData->nextState = 30;
+ break;
+
+ case 6:
+ case 28:
+ // loc_21148
+ animData->nextState = 28;
+ break;
+
+ case 7:
+ case 31:
+ case 41:
+ // loc_21170
+ animData->nextState = 31;
+ break;
+ }
+ break;
+ }
+ } else {
+ switch (dir) {
+ case Map::kDirNW:
+ animData->nextState = 1;
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10)
+ animData->nextState = 40;
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10)
+ animData->nextState = 1;
+ }
+ break;
+
+ case Map::kDirN:
+ animData->nextState =
+ (animData->curLookDir == 2) ? 2 : rotateState(animData->curLookDir, 2);
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) {
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10) {
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) == 10)
+ animData->nextState = 42;
+ else
+ animData->nextState = 2;
+ } else
+ animData->nextState = 40;
+ } else if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20)
+ animData->nextState = 38;
+ else if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19)
+ animData->nextState = 26;
+ }
+ break;
+
+ case Map::kDirNE:
+ animData->nextState = 3;
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10)
+ animData->nextState = 42;
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) != 10)
+ animData->nextState = 3;
+ }
+ break;
+
+ case Map::kDirW:
+ animData->nextState = rotateState(animData->curLookDir, 0);
+ break;
+
+ case Map::kDirE:
+ animData->nextState = rotateState(animData->curLookDir, 4);
+ break;
+
+ case Map::kDirSW:
+ animData->nextState = 7;
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10)
+ animData->nextState = 41;
+ if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY + 2) != 10)
+ animData->nextState = 7;
+ }
+ break;
+
+ case Map::kDirS:
+ animData->nextState =
+ (animData->curLookDir == 6) ? 6 : rotateState(animData->curLookDir, 6);
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20)
+ animData->nextState = 39;
+ else if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19)
+ animData->nextState = 27;
+ }
+ break;
+
+ case Map::kDirSE:
+ animData->nextState = 5;
+ if (_vm->_map->_screenWidth == 640) {
+ if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10)
+ animData->nextState = 43;
+ if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY + 2) != 10)
+ animData->nextState = 5;
+ }
+ break;
+
+ default:
+ switch (animData->curLookDir) {
+ case 0:
+ animData->nextState = 8;
+ break;
+ case 1:
+ animData->nextState = 10;
+ break;
+ case 2:
+ animData->nextState = 29;
+ break;
+ case 3:
+ animData->nextState = 11;
+ break;
+ case 4:
+ animData->nextState = 9;
+ break;
+ case 5:
+ animData->nextState = 30;
+ break;
+ case 6:
+ animData->nextState = 28;
+ break;
+ case 7:
+ animData->nextState = 31;
+ break;
+ }
+ break;
+ }
+ }
+}
+
+void Goblin_v4::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
+ int16 nextAct, int16 framesCount) {
+ Mult::Mult_AnimData *animData;
+ int16 gobX;
+ int16 gobY;
+ int16 animation;
+ int16 state;
+ int16 layer;
+
+ if (!obj->goblinStates)
+ return;
+
+ movePathFind(obj, 0, 0);
+ playSounds(obj);
+
+ animData = obj->pAnimData;
+
+ framesCount = _vm->_scenery->getAnimLayer(animData->animation, animData->layer)->framesCount;
+
+ if (animData->isPaused == 0)
+ animData->frame++;
+
+ switch (animData->stateType) {
+ case 0:
+ case 1:
+ animData->isPaused = 0;
+ break;
+
+ case 4:
+ if (animData->frame == 0)
+ animData->isPaused = 1;
+ break;
+
+ case 6:
+ if (animData->frame >= framesCount)
+ animData->isPaused = 1;
+ break;
+ }
+
+ switch (animData->state) {
+ case 0:
+ case 1:
+ case 7:
+ case 13:
+ case 16:
+ case 23:
+ case 40:
+ case 41:
+ animData->curLookDir = 0;
+ break;
+
+ case 2:
+ case 15:
+ case 18:
+ case 21:
+ case 26:
+ case 38:
+ animData->curLookDir = 2;
+ break;
+
+ case 3:
+ case 4:
+ case 5:
+ case 12:
+ case 19:
+ case 22:
+ case 42:
+ case 43:
+ animData->curLookDir = 4;
+ break;
+
+ case 6:
+ case 14:
+ case 17:
+ case 20:
+ case 27:
+ case 39:
+ animData->curLookDir = 6;
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 28:
+ case 29:
+ case 30:
+ case 31:
+ if (animData->pathExistence == 4)
+ animData->pathExistence = 5;
+ break;
+ }
+
+ if ((animData->newState != -1) && (animData->frame == framesCount) &&
+ (animData->newState != animData->state)) {
+ animData->nextState = animData->newState;
+ animData->newState = -1;
+ animData->state = animData->nextState;
+
+ Scenery::AnimLayer *animLayer =
+ _vm->_scenery->getAnimLayer(animData->animation, animData->layer);
+ *obj->pPosX += animLayer->animDeltaX;
+ *obj->pPosY += animLayer->animDeltaY;
+
+ animation = obj->goblinStates[animData->nextState][0].animation;
+ layer = obj->goblinStates[animData->nextState][0].layer;
+ animData->layer = layer;
+ animData->animation = animation;
+ animData->frame = 0;
+ } else {
+ if (isMovement(animData->state)) {
+ state = animData->nextState;
+ if (animData->frame == ((framesCount + 1) / 2)) {
+ gobX = obj->goblinX;
+ gobY = obj->goblinY;
+
+ advMovement(obj, state);
+
+ if (animData->state != state) {
+ animation = obj->goblinStates[state][0].animation;
+ layer = obj->goblinStates[state][0].layer;
+ animData->layer = layer;
+ animData->animation = animation;
+ animData->frame = 0;
+ animData->state = state;
+ _vm->_scenery->updateAnim(layer, 0, animation, 0, *obj->pPosX, *obj->pPosY, 0);
+ if (_vm->_map->_bigTiles)
+ *obj->pPosY = ((gobY + 1) * _vm->_map->_tilesHeight) -
+ (_vm->_scenery->_animBottom - _vm->_scenery->_animTop) - (gobY + 1) / 2;
+ else
+ *obj->pPosY = ((gobY + 1) * _vm->_map->_tilesHeight) -
+ (_vm->_scenery->_animBottom - _vm->_scenery->_animTop);
+ *obj->pPosX = gobX * _vm->_map->_tilesWidth;
+ }
+ }
+ }
+
+ if (animData->frame >= framesCount) {
+ state = animData->nextState;
+ animation = obj->goblinStates[state][0].animation;
+ layer = obj->goblinStates[state][0].layer;
+ animData->layer = layer;
+ animData->animation = animation;
+ animData->frame = 0;
+ animData->state = state;
+ gobX = obj->goblinX;
+ gobY = obj->goblinY;
+
+ advMovement(obj, state);
+
+ _vm->_scenery->updateAnim(layer, 0, animation, 0, *obj->pPosX, *obj->pPosY, 0);
+ if (_vm->_map->_bigTiles)
+ *obj->pPosY = ((gobY + 1) * _vm->_map->_tilesHeight) -
+ (_vm->_scenery->_animBottom - _vm->_scenery->_animTop) - (gobY + 1) / 2;
+ else
+ *obj->pPosY = ((gobY + 1) * _vm->_map->_tilesHeight) -
+ (_vm->_scenery->_animBottom - _vm->_scenery->_animTop);
+ *obj->pPosX = gobX * _vm->_map->_tilesWidth;
+ }
+ }
+}
+
+int16 Goblin_v4::sub_20430(int16 state, uint16 dir) {
+ static const int16 word_3F25E[8][8] = {
+ { 0, 1, 10, 10, 10, 31, 31, 7},
+ { 0, 1, 2, 29, 29, 29, 8, 8},
+ {10, 1, 2, 3, 11, 11, 11, 10},
+ {29, 29, 2, 3, 4, 9, 9, 9},
+ {30, 11, 11, 3, 4, 5, 30, 30},
+ {28, 28, 9, 9, 4, 5, 6, 28},
+ {31, 31, 31, 30, 30, 5, 6, 7},
+ { 0, 8, 8, 8, 28, 28, 6, 7}
+ };
+ int16 dx = state, cx = 0;
+
+ switch (state) {
+ case 0:
+ case 8:
+ // loc_20447
+ dx = 0;
+ break;
+
+ case 1:
+ case 10:
+ case 40:
+ // loc_2044B
+ dx = 1;
+ break;
+
+ case 3:
+ case 11:
+ case 42:
+ // loc_20455
+ dx = 3;
+ break;
+
+ case 5:
+ case 30:
+ case 43:
+ // loc_2045F
+ dx = 5;
+ break;
+
+ case 7:
+ case 31:
+ case 41:
+ // loc_20469
+ dx = 7;
+ break;
+
+ case 9:
+ // loc_2045A
+ dx = 4;
+ break;
+
+ case 28:
+ // loc_20464
+ dx = 6;
+ break;
+
+ case 29:
+ // loc_20450
+ dx = 2;
+ break;
+ }
+
+ // loc_2046C
+
+ switch (dir) {
+ case Map::kDirNW:
+ cx = 1;
+ break;
+
+ case Map::kDirN:
+ cx = 2;
+ break;
+
+ case Map::kDirNE:
+ cx = 3;
+ break;
+
+ case Map::kDirW:
+ cx = 0;
+ break;
+
+ case Map::kDirE:
+ cx = 4;
+ break;
+
+ case Map::kDirSW:
+ cx = 7;
+ break;
+
+ case Map::kDirS:
+ cx = 6;
+ break;
+
+ case Map::kDirSE:
+ cx = 5;
+ break;
+ }
+
+ return word_3F25E[dx][cx];
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp
index f38d5ac115..4d184c53d3 100644
--- a/engines/gob/init.cpp
+++ b/engines/gob/init.cpp
@@ -181,9 +181,9 @@ void Init::initGame(const char *totName) {
_vm->_util->longDelay(200); // Letting everything settle
- if (_vm->_vidPlayer->openVideo("coktel.imd")) {
- _vm->_vidPlayer->play();
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("coktel.imd")) {
+ _vm->_vidPlayer->primaryPlay();
+ _vm->_vidPlayer->primaryClose();
}
_vm->_draw->closeScreen();
diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp
index 0de8245dea..702950d539 100644
--- a/engines/gob/inter_bargon.cpp
+++ b/engines/gob/inter_bargon.cpp
@@ -717,16 +717,16 @@ const char *Inter_Bargon::getOpcodeGoblinDesc(int i) {
}
void Inter_Bargon::oBargon_intro0(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scaa", 0, 160)) {
- _vm->_vidPlayer->play(0, 92, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scaa", 0, 160)) {
+ _vm->_vidPlayer->primaryPlay(0, 92, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro1(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scaa", 0, 160)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0, 0, 0, true, 23);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scaa", 0, 160)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0, 0, 0, true, 23);
+ _vm->_vidPlayer->primaryClose();
}
}
@@ -819,44 +819,44 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
}
void Inter_Bargon::oBargon_intro4(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scba", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0, 0, 0, true);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scba", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0, 0, 0, true);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro5(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scbb", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scbb", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro6(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scbc", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scbc", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro7(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scbf", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scbf", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro8(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scbc", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scbc", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
void Inter_Bargon::oBargon_intro9(OpGobParams &params) {
- if (_vm->_vidPlayer->openVideo("scbd", 191, 54)) {
- _vm->_vidPlayer->play(0, -1, 27, 0, 0, 0);
- _vm->_vidPlayer->closeVideo();
+ if (_vm->_vidPlayer->primaryOpen("scbd", 191, 54)) {
+ _vm->_vidPlayer->primaryPlay(0, -1, 27, 0, 0, 0);
+ _vm->_vidPlayer->primaryClose();
}
}
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 46d40d1553..be510df08a 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -880,6 +880,9 @@ void Inter_v2::o2_initMult() {
if (_vm->_mult->_objects && (oldObjCount != _vm->_mult->_objCount)) {
warning("Initializing new objects without having "
"cleaned up the old ones at first");
+
+ _vm->_mult->clearObjectVideos();
+
delete[] _vm->_mult->_objects;
delete[] _vm->_mult->_renderObjs;
delete[] _vm->_mult->_orderArray;
@@ -896,7 +899,7 @@ void Inter_v2::o2_initMult() {
if (_terminate)
return;
- _vm->_mult->_orderArray = new int8[_vm->_mult->_objCount];
+ _vm->_mult->_orderArray = new uint8[_vm->_mult->_objCount];
memset(_vm->_mult->_orderArray, 0, _vm->_mult->_objCount * sizeof(int8));
_vm->_mult->_objects = new Mult::Mult_Object[_vm->_mult->_objCount];
memset(_vm->_mult->_objects, 0,
@@ -988,12 +991,10 @@ void Inter_v2::o2_loadMultObject() {
_vm->_global->_inter_execPtr++;
}
- if (_vm->_goblin->_gobsCount <= objIndex)
- return;
-
Mult::Mult_Object &obj = _vm->_mult->_objects[objIndex];
Mult::Mult_AnimData &objAnim = *(obj.pAnimData);
- if (objAnim.animType == 100) {
+
+ if ((objAnim.animType == 100) && (objIndex < _vm->_goblin->_gobsCount)) {
val = *(obj.pPosX) % 256;
obj.destX = val;
@@ -1029,7 +1030,7 @@ void Inter_v2::o2_loadMultObject() {
((obj.goblinY + 1) / 2);
*(obj.pPosX) = obj.goblinX * _vm->_map->_tilesWidth;
- } else if (objAnim.animType == 101) {
+ } else if ((objAnim.animType == 101) && (objIndex < _vm->_goblin->_gobsCount)) {
layer = objAnim.layer;
animation = obj.goblinStates[layer][0].animation;
@@ -1048,6 +1049,21 @@ void Inter_v2::o2_loadMultObject() {
}
_vm->_scenery->updateAnim(layer, 0, animation, 0,
*(obj.pPosX), *(obj.pPosY), 0);
+
+ } else if ((objAnim.animType != 100) && (objAnim.animType != 101)) {
+
+ if ((*(obj.pPosX) == -1234) && (*(obj.pPosY) == -4321)) {
+
+ if (obj.videoSlot > 0)
+ _vm->_vidPlayer->slotClose(obj.videoSlot - 1);
+
+ obj.videoSlot = 0;
+ obj.lastLeft = -1;
+ obj.lastTop = -1;
+ obj.lastBottom = -1;
+ obj.lastRight = -1;
+ }
+
}
}
@@ -1375,17 +1391,21 @@ void Inter_v2::o2_initScreen() {
width = _vm->_parse->parseValExpr();
height = _vm->_parse->parseValExpr();
+ _vm->_video->clearScreen();
+
// Lost in Time switches to 640x400x16 when showing the title screen
if (_vm->getGameType() == kGameTypeLostInTime) {
+
if (videoMode == 0x10) {
+
width = _vm->_width = 640;
height = _vm->_height = 400;
_vm->_global->_colorCount = 16;
- _vm->_system->beginGFXTransaction();
- _vm->_system->initSize(_vm->_width, _vm->_height);
- _vm->initCommonGFX(true);
- _vm->_system->endGFXTransaction();
+
+ _vm->_video->setSize(true);
+
} else if (_vm->_global->_videoMode == 0x10) {
+
if (width == -1)
width = 320;
if (height == -1)
@@ -1394,10 +1414,9 @@ void Inter_v2::o2_initScreen() {
_vm->_width = 320;
_vm->_height = 200;
_vm->_global->_colorCount = 256;
- _vm->_system->beginGFXTransaction();
- _vm->_system->initSize(_vm->_width, _vm->_height);
- _vm->initCommonGFX(false);
- _vm->_system->endGFXTransaction();
+
+ _vm->_video->setSize(false);
+
}
}
@@ -1415,10 +1434,46 @@ void Inter_v2::o2_initScreen() {
if (height > 0)
_vm->_video->_surfHeight = height;
- _vm->_video->_splitHeight1 =
- MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
- _vm->_video->_splitHeight2 = offY;
- _vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
+ if (videoMode == 0x18) {
+
+ if (_vm->_video->_surfWidth < _vm->_width)
+ _vm->_video->_screenDeltaX = (_vm->_width - _vm->_video->_surfWidth) / 2;
+ else
+ _vm->_video->_screenDeltaX = 0;
+
+ _vm->_global->_mouseMinX = _vm->_video->_screenDeltaX;
+ _vm->_global->_mouseMaxX = _vm->_video->_screenDeltaX + _vm->_video->_surfWidth - 1;
+
+
+ int16 screenHeight = _vm->_video->_surfHeight;
+
+ _vm->_video->_surfHeight += offY;
+
+ _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, screenHeight - offY);
+ _vm->_video->_splitHeight2 = offY;
+ _vm->_video->_splitStart = screenHeight;
+
+ if ((_vm->_video->_surfHeight + offY) < _vm->_height)
+ _vm->_video->_screenDeltaY = (_vm->_height - (screenHeight + offY)) / 2;
+ else
+ _vm->_video->_screenDeltaY = 0;
+
+ _vm->_global->_mouseMaxY = (screenHeight + _vm->_video->_screenDeltaY) - offY - 1;
+ _vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
+
+ } else {
+ _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
+ _vm->_video->_splitHeight2 = offY;
+ _vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
+
+ _vm->_video->_screenDeltaX = 0;
+ _vm->_video->_screenDeltaY = 0;
+
+ _vm->_global->_mouseMinX = 0;
+ _vm->_global->_mouseMinY = 0;
+ _vm->_global->_mouseMaxX = _vm->_width;
+ _vm->_global->_mouseMaxY = _vm->_height - _vm->_video->_splitHeight2 - 1;
+ }
_vm->_draw->closeScreen();
_vm->_util->clearPalette();
@@ -1519,7 +1574,7 @@ void Inter_v2::o2_playImd() {
palEnd = _vm->_parse->parseValExpr();
palCmd = 1 << (flags & 0x3F);
- if ((imd[0] != 0) && !_vm->_vidPlayer->openVideo(imd, x, y, flags)) {
+ if ((imd[0] != 0) && !_vm->_vidPlayer->primaryOpen(imd, x, y, flags)) {
WRITE_VAR(11, -1);
return;
}
@@ -1532,12 +1587,12 @@ void Inter_v2::o2_playImd() {
if (startFrame >= 0) {
_vm->_game->_preventScroll = true;
- _vm->_vidPlayer->play(startFrame, lastFrame, breakKey, palCmd, palStart, palEnd, 0);
+ _vm->_vidPlayer->primaryPlay(startFrame, lastFrame, breakKey, palCmd, palStart, palEnd, 0);
_vm->_game->_preventScroll = false;
}
if (close)
- _vm->_vidPlayer->closeVideo();
+ _vm->_vidPlayer->primaryClose();
}
void Inter_v2::o2_getImdInfo() {
diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp
index d2269e5b2c..b24e54ffbd 100644
--- a/engines/gob/inter_v4.cpp
+++ b/engines/gob/inter_v4.cpp
@@ -544,9 +544,9 @@ void Inter_v4::setupOpcodes() {
static const OpcodeGoblinEntryV4 opcodesGoblin[71] = {
/* 00 */
- OPCODE(o2_loadInfogramesIns),
- OPCODE(o2_startInfogrames),
- OPCODE(o2_stopInfogrames),
+ {NULL, ""},
+ {NULL, ""},
+ {NULL, ""},
{NULL, ""},
/* 04 */
{NULL, ""},
@@ -555,7 +555,7 @@ void Inter_v4::setupOpcodes() {
{NULL, ""},
/* 08 */
{NULL, ""},
- OPCODE(o2_playInfogrames),
+ {NULL, ""},
{NULL, ""},
{NULL, ""},
/* 0C */
@@ -592,7 +592,7 @@ void Inter_v4::setupOpcodes() {
{NULL, ""},
{NULL, ""},
{NULL, ""},
- OPCODE(o2_handleGoblins),
+ {NULL, ""},
/* 28 */
{NULL, ""},
{NULL, ""},
@@ -723,7 +723,6 @@ void Inter_v4::o4_playVmdOrMusic() {
bool close;
evalExpr(0);
- _vm->_global->_inter_resStr[8] = 0;
strncpy0(fileName, _vm->_global->_inter_resStr, 127);
x = _vm->_parse->parseValExpr();
@@ -740,8 +739,26 @@ void Inter_v4::o4_playVmdOrMusic() {
if (lastFrame == -1) {
close = true;
} else if (lastFrame == -3) {
- warning("Woodruff Stub: Video/Music command -3: Play background video %s", fileName);
-// return;
+ warning("Woodruff Stub: Video/Music command -3: Play background video %s, %d, %d, %d, %d", fileName, startFrame, x, y, VAR_OFFSET(7872));
+
+ _vm->_mult->_objects[startFrame].pAnimData->animation = -startFrame - 1;
+
+ if (_vm->_mult->_objects[startFrame].videoSlot > 0)
+ _vm->_vidPlayer->slotClose(_vm->_mult->_objects[startFrame].videoSlot - 1);
+
+ int slot = _vm->_vidPlayer->slotOpen(fileName);
+
+ _vm->_mult->_objects[startFrame].videoSlot = slot + 1;
+
+ if (x == -1) {
+ *_vm->_mult->_objects[startFrame].pPosX = _vm->_vidPlayer->getDefaultX(slot);
+ *_vm->_mult->_objects[startFrame].pPosY = _vm->_vidPlayer->getDefaultY(slot);
+ } else {
+ *_vm->_mult->_objects[startFrame].pPosX = x;
+ *_vm->_mult->_objects[startFrame].pPosY = y;
+ }
+
+ return;
} else if (lastFrame == -4) {
warning("Woodruff Stub: Video/Music command -4: Play background video %s", fileName);
return;
@@ -767,19 +784,19 @@ void Inter_v4::o4_playVmdOrMusic() {
close = false;
}
- if ((fileName[0] != 0) && !_vm->_vidPlayer->openVideo(fileName, x, y, flags)) {
+ if ((fileName[0] != 0) && !_vm->_vidPlayer->primaryOpen(fileName, x, y, flags)) {
WRITE_VAR(11, -1);
return;
}
if (startFrame >= 0) {
_vm->_game->_preventScroll = true;
- _vm->_vidPlayer->play(startFrame, lastFrame, breakKey, palCmd, palStart, palEnd, 0);
+ _vm->_vidPlayer->primaryPlay(startFrame, lastFrame, breakKey, palCmd, palStart, palEnd, 0);
_vm->_game->_preventScroll = false;
}
if (close)
- _vm->_vidPlayer->closeVideo();
+ _vm->_vidPlayer->primaryClose();
}
} // End of namespace Gob
diff --git a/engines/gob/module.mk b/engines/gob/module.mk
index 8a428b4d34..aa2a235327 100644
--- a/engines/gob/module.mk
+++ b/engines/gob/module.mk
@@ -18,6 +18,7 @@ MODULE_OBJS := \
goblin_v1.o \
goblin_v2.o \
goblin_v3.o \
+ goblin_v4.o \
coktelvideo.o \
videoplayer.o \
init.o \
@@ -55,7 +56,7 @@ MODULE_OBJS := \
video_v2.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_GOB), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp
index 924cc9a4a7..70b6d33136 100644
--- a/engines/gob/mult.cpp
+++ b/engines/gob/mult.cpp
@@ -36,6 +36,7 @@
#include "gob/scenery.h"
#include "gob/sound.h"
#include "gob/video.h"
+#include "gob/videoplayer.h"
namespace Gob {
@@ -120,6 +121,8 @@ void Mult::freeAll(void) {
}
void Mult::freeMult() {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _renderObjs;
@@ -198,6 +201,8 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
if (!stopNoClear) {
if (_animDataAllocated) {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _renderObjs;
@@ -424,4 +429,10 @@ void Mult::doSoundAnim(bool &stop, int16 frame) {
}
}
+void Mult::clearObjectVideos() {
+ for (int i = 0; i < _objCount; i++)
+ if (_objects[i].videoSlot > 0)
+ _vm->_vidPlayer->slotClose(_objects[i].videoSlot - 1);
+}
+
} // End of namespace Gob
diff --git a/engines/gob/mult.h b/engines/gob/mult.h
index 90f6e61f9a..c283191ec8 100644
--- a/engines/gob/mult.h
+++ b/engines/gob/mult.h
@@ -36,16 +36,16 @@ public:
#include "common/pack-start.h" // START STRUCT PACKING
struct Mult_AnimData {
- uint8 animation;
+ int8 animation;
uint8 layer;
uint8 frame;
int8 animType;
- int8 order;
+ uint8 order;
int8 isPaused;
int8 isStatic;
int8 maxTick;
int8 maxFrame;
- int8 newLayer;
+ uint8 newLayer;
int8 newAnimation;
byte intersected;
uint8 newCycle;
@@ -61,7 +61,7 @@ public:
int8 stateType;
int8 animTypeBak;
int8 redrawAnimation;
- int8 redrawLayer;
+ uint8 redrawLayer;
uint8 redrawFrame;
} PACKED_STRUCT;
@@ -86,10 +86,10 @@ public:
int16 lastTop;
int16 lastBottom;
Mult_GobState **goblinStates;
- int8 goblinX;
- int8 goblinY;
- int8 destX;
- int8 destY;
+ uint8 goblinX;
+ uint8 goblinY;
+ uint8 destX;
+ uint8 destY;
int8 gobDestX;
int8 gobDestY;
uint8 nearestWayPoint;
@@ -104,6 +104,7 @@ public:
int16 newTop;
int16 newRight;
int16 newBottom;
+ uint32 videoSlot;
} PACKED_STRUCT;
struct Mult_StaticKey {
@@ -228,7 +229,7 @@ public:
int16 *_renderData;
Mult_Object **_renderObjs;
- int8 *_orderArray;
+ uint8 *_orderArray;
SurfaceDesc::Ptr _animSurf;
int16 _animLeft;
@@ -244,6 +245,8 @@ public:
void playMult(int16 startFrame, int16 endFrame, char checkEscape,
char handleMouse);
+ void clearObjectVideos();
+
virtual void loadMult(int16 resId) = 0;
virtual void freeMultKeys() = 0;
virtual bool hasMultData(uint16 multIndex) = 0;
diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp
index 4a5a817449..78071f1dd8 100644
--- a/engines/gob/mult_v1.cpp
+++ b/engines/gob/mult_v1.cpp
@@ -215,6 +215,8 @@ void Mult_v1::freeMultKeys() {
delete[] _multData->sndKeys;
if (_animDataAllocated) {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _animArrayX;
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index 37c360d53a..02211880ba 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -463,8 +463,7 @@ void Mult_v2::multSub(uint16 multIndex) {
int obj = _multData->animObjs[index][i];
if ((obj != -1) && (obj != 1024))
- _objects[obj].pAnimData->animTypeBak =
- _objects[obj].pAnimData->animType;
+ _objects[obj].pAnimData->animTypeBak = _objects[obj].pAnimData->animType;
}
}
@@ -472,8 +471,10 @@ void Mult_v2::multSub(uint16 multIndex) {
_multData->animKeysIndices[index][i] = 0;
for (int j = 0; j < _multData->animKeysCount[i]; j++)
- if (_multData->animKeys[i][j].frame == startFrame)
+ if (_multData->animKeys[i][j].frame >= startFrame) {
_multData->animKeysIndices[index][i] = j;
+ break;
+ }
}
if (_multData->animDirection == -1) {
@@ -487,6 +488,7 @@ void Mult_v2::multSub(uint16 multIndex) {
firstFrame = (_multData->animDirection == 1) ? startFrame : stopFrame;
for (int i = 0; i < 4; i++) {
_multData->imdKeysIndices[index][i] = 0;
+
for (int j = 0; j < _multData->imdKeysCount[i]; j++)
if (_multData->imdKeys[i][j].frame >= firstFrame) {
_multData->imdKeysIndices[index][i] = j;
@@ -524,14 +526,14 @@ void Mult_v2::playMultInit() {
delete[] _animArrayData;
_objects = new Mult_Object[_objCount];
- _orderArray = new int8[_objCount];
+ _orderArray = new uint8[_objCount];
_renderObjs = new Mult_Object*[_objCount];
_animArrayX = new int32[_objCount];
_animArrayY = new int32[_objCount];
_animArrayData = new Mult_AnimData[_objCount];
memset(_objects, 0, _objCount * sizeof(Mult_Object));
- memset(_orderArray, 0, _objCount * sizeof(int8));
+ memset(_orderArray, 0, _objCount * sizeof(uint8));
memset(_renderObjs, 0, _objCount * sizeof(Mult_Object *));
memset(_animArrayX, 0, _objCount * sizeof(int32));
memset(_animArrayY, 0, _objCount * sizeof(int32));
@@ -675,28 +677,54 @@ void Mult_v2::drawAnims(bool &stop) { // loc_50D5
void Mult_v2::newCycleAnim(Mult_Object &animObj) {
Mult_AnimData &animData = *(animObj.pAnimData);
- int nAnim = animData.animation;
- int nLayer = animData.layer;
+ Scenery::AnimLayer *animLayer = 0;
- if (_vm->_scenery->getAnimLayersCount(nAnim) <= nLayer)
- return;
+ if (animData.animation >= 0) {
+ int nAnim = animData.animation, nLayer = animData.layer;
+
+ if (_vm->_scenery->getAnimLayersCount(nAnim) <= nLayer)
+ return;
- Scenery::AnimLayer *animLayer = _vm->_scenery->getAnimLayer(nAnim, nLayer);
+ animLayer = _vm->_scenery->getAnimLayer(nAnim, nLayer);
+ }
if (animData.animType == 4) {
+ // loc_1E091
animData.frame = 0;
animData.isPaused = 1;
+ if (animData.animation < 0)
+ warning("TODO: AnimType 4, animation: %d", animData.animation);
+ return;
+ }
+
+ if (animData.animType == 12)
+ animData.animType = 11;
+
+ if (animData.animType == 11) {
+ if (animData.isBusy != 0) {
+ warning("TODO: AnimType 11");
+ }
return;
}
if (animData.animType != 8)
animData.frame++;
- if (animData.frame < animLayer->framesCount) {
- animData.newCycle = 0;
- return;
+ if (animData.animation < 0) {
+ if ((animObj.videoSlot > 0) &&
+ (_vm->_vidPlayer->getCurrentFrame(animObj.videoSlot - 1) <
+ _vm->_vidPlayer->getFramesCount(animObj.videoSlot - 1))) {
+ animData.newCycle = 0;
+ return;
+ }
+ } else {
+ if (animData.frame < animLayer->framesCount) {
+ animData.newCycle = 0;
+ return;
+ }
}
+
switch (animData.animType) {
case 0:
animData.frame = 0;
@@ -728,15 +756,21 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) {
case 7:
animData.frame--;
animData.isPaused = 1;
+ if ((animData.animation < 0) && (animObj.videoSlot > 0)) {
+ if (_vm->_vidPlayer->getFlags(animObj.videoSlot - 1) & 0x1000) {
+ _vm->_vidPlayer->slotClose(animObj.videoSlot - 1);
+ animObj.videoSlot = 0;
+ }
+ }
break;
}
animData.newCycle = 1;
}
void Mult_v2::animate() {
- int8 minOrder = 100;
- int8 maxOrder = 0;
- int8 *orderArray;
+ uint8 minOrder = 100;
+ uint8 maxOrder = 0;
+ uint8 *orderArray;
int orderArrayPos = 0;
int8 animIndices[150];
int numAnims = 0;
@@ -897,6 +931,9 @@ void Mult_v2::animate() {
Mult_Object &animObj1 = *_renderObjs[orderArray[i]];
Mult_AnimData &animData1 = *(animObj1.pAnimData);
+ if (!animObj1.goblinStates)
+ continue;
+
for (int j = i+1; j < orderArrayPos; j++) {
Mult_Object &animObj2 = *_renderObjs[orderArray[j]];
Mult_AnimData &animData2 = *(animObj2.pAnimData);
@@ -1043,7 +1080,7 @@ void Mult_v2::playImd(const char *imdFile, Mult::Mult_ImdKey &key, int16 dir,
x = y = -1;
if (key.imdFile == -1) {
- _vm->_vidPlayer->closeVideo();
+ _vm->_vidPlayer->primaryClose();
_vm->_game->_preventScroll = false;
return;
}
@@ -1061,11 +1098,11 @@ void Mult_v2::playImd(const char *imdFile, Mult::Mult_ImdKey &key, int16 dir,
if ((lastFrame - palFrame) < startFrame)
if (!(key.flags & 0x4000)) {
_vm->_game->_preventScroll = false;
- _vm->_vidPlayer->closeVideo();
+ _vm->_vidPlayer->primaryClose();
return;
}
- if (!_vm->_vidPlayer->openVideo(imdFile, x, y, flags)) {
+ if (!_vm->_vidPlayer->primaryOpen(imdFile, x, y, flags)) {
_vm->_game->_preventScroll = false;
return;
}
@@ -1077,7 +1114,7 @@ void Mult_v2::playImd(const char *imdFile, Mult::Mult_ImdKey &key, int16 dir,
lastFrame = _vm->_vidPlayer->getFramesCount() - 1;
baseFrame = startFrame % (lastFrame - palFrame + 1);
- _vm->_vidPlayer->play(baseFrame + palFrame, baseFrame + palFrame, 0,
+ _vm->_vidPlayer->primaryPlay(baseFrame + palFrame, baseFrame + palFrame, 0,
flags & 0x7F, palStart, palEnd, palFrame, lastFrame);
}
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 5979927dfa..3f9ec9e6f2 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -33,6 +33,8 @@
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/inter.h"
+#include "gob/map.h"
+#include "gob/videoplayer.h"
namespace Gob {
@@ -454,6 +456,7 @@ int16 Scenery::loadAnim(char search) {
ptr->layers = new AnimLayer[ptr->layersCount];
ptr->pieces = new PieceDesc*[picsCount];
ptr->piecesFromExt = new bool[picsCount];
+ ptr->sizes = new uint16[picsCount];
for (i = 0; i < ptr->layersCount; i++) {
int16 offset = READ_LE_UINT16(dataPtr + i * 2);
@@ -492,13 +495,19 @@ int16 Scenery::loadAnim(char search) {
for (i = 0; i < picsCount; i++) {
pictDescId = _vm->_inter->load16();
if (pictDescId >= 30000) {
+ uint32 size;
+
ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadExtData(pictDescId, 0, 0);
+ (PieceDesc *) _vm->_game->loadExtData(pictDescId, 0, 0, &size);
ptr->piecesFromExt[i] = true;
+ ptr->sizes[i] = size / 8;
} else {
+ int16 size;
+
ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadTotResource(pictDescId);
+ (PieceDesc *) _vm->_game->loadTotResource(pictDescId, &size);
ptr->piecesFromExt[i] = false;
+ ptr->sizes[i] = size / 8;
}
width = _vm->_inter->load16();
@@ -561,6 +570,7 @@ void Scenery::freeAnim(int16 index) {
delete[] _animations[index].layers;
delete[] _animations[index].pieces;
delete[] _animations[index].piecesFromExt;
+ delete[] _animations[index].sizes;
_animPictCount[index] = 0;
}
@@ -592,6 +602,138 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
int16 destX;
int16 destY;
+ if (animation < 0) {
+ // Object video
+
+ if (flags & 1) { // Do capture
+ updateAnim(layer, frame, animation, 0, drawDeltaX, drawDeltaY, 0);
+
+ if (_toRedrawLeft == -12345)
+ return;
+
+ _vm->_game->capturePush(_toRedrawLeft, _toRedrawTop,
+ _toRedrawRight - _toRedrawLeft + 1,
+ _toRedrawBottom - _toRedrawTop + 1);
+
+ *_pCaptureCounter = *_pCaptureCounter + 1;
+ }
+
+ Mult::Mult_Object &obj = _vm->_mult->_objects[-animation - 1];
+
+ if (!_vm->_vidPlayer->slotIsOpen(obj.videoSlot - 1)) {
+ _toRedrawLeft = -1234;
+ return;
+ }
+
+ if (frame >= _vm->_vidPlayer->getFramesCount(obj.videoSlot - 1))
+ frame = _vm->_vidPlayer->getFramesCount(obj.videoSlot - 1) - 1;
+
+ // Seek to frame
+ while (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) <= frame)
+ _vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+
+ destX = 0;
+ destY = 0;
+ left = *(obj.pPosX);
+ top = *(obj.pPosY);
+ right = left + _vm->_vidPlayer->getWidth(obj.videoSlot - 1) - 1;
+ bottom = top + _vm->_vidPlayer->getHeight(obj.videoSlot - 1) - 1;
+
+ if (flags & 2) {
+ if (left < _vm->_mult->_animLeft) {
+ destX += _vm->_mult->_animLeft - left;
+ left = _vm->_mult->_animLeft;
+ }
+
+ if ((_vm->_mult->_animLeft + _vm->_mult->_animWidth) <= right)
+ right = _vm->_mult->_animLeft + _vm->_mult->_animWidth - 1;
+
+ if (top < _vm->_mult->_animTop) {
+ destY += _vm->_mult->_animTop - top;
+ top = _vm->_mult->_animTop;
+ }
+
+ if ((_vm->_mult->_animTop + _vm->_mult->_animHeight) <= bottom)
+ bottom = _vm->_mult->_animTop + _vm->_mult->_animHeight - 1;
+
+ } else if (flags & 4) {
+ if (left < _toRedrawLeft) {
+ destX += _toRedrawLeft - left;
+ left = _toRedrawLeft;
+ }
+
+ if (right > _toRedrawRight)
+ right = _toRedrawRight;
+
+ if (top < _toRedrawTop) {
+ destY += _toRedrawTop - top;
+ top = _toRedrawTop;
+ }
+
+ if (bottom > _toRedrawBottom)
+ bottom = _toRedrawBottom;
+
+ } else {
+ _toRedrawTop = top;
+ _toRedrawLeft = left;
+ _toRedrawRight = right;
+ _toRedrawBottom = bottom;
+ }
+
+ if (doDraw) {
+ if ((left > right) || (top > bottom))
+ return;
+
+ if (left < _vm->_mult->_animLeft) {
+ destX += _vm->_mult->_animLeft - left;
+ left = _vm->_mult->_animLeft;
+ }
+
+ if ((_vm->_mult->_animLeft + _vm->_mult->_animWidth) <= right)
+ right = _vm->_mult->_animLeft + _vm->_mult->_animWidth - 1;
+
+ if (top < _vm->_mult->_animTop) {
+ destY += _vm->_mult->_animTop - top;
+ top = _vm->_mult->_animTop;
+ }
+
+ if ((_vm->_mult->_animTop + _vm->_mult->_animHeight) <= bottom)
+ bottom = _vm->_mult->_animTop + _vm->_mult->_animHeight - 1;
+
+ _vm->_draw->_spriteLeft = destX;
+ _vm->_draw->_spriteTop = destY;
+ _vm->_draw->_spriteRight = right - left + 1;
+ _vm->_draw->_spriteBottom = bottom - top + 1;
+ _vm->_draw->_destSpriteX = left;
+ _vm->_draw->_destSpriteY = top;
+ _vm->_draw->_transparency = layer;
+ if (layer & 0x80)
+ _vm->_draw->_spriteLeft = _vm->_vidPlayer->getWidth(obj.videoSlot - 1) -
+ (destX + _vm->_draw->_spriteRight);
+
+ _vm->_vidPlayer->slotCopyFrame(obj.videoSlot - 1, _vm->_draw->_backSurface->getVidMem(),
+ _vm->_draw->_spriteLeft, _vm->_draw->_spriteTop,
+ _vm->_draw->_spriteRight, _vm->_draw->_spriteBottom,
+ _vm->_draw->_destSpriteX, _vm->_draw->_destSpriteY,
+ _vm->_draw->_backSurface->getWidth(),
+ (_vm->_draw->_transparency != 0) ? 0 : -1);
+
+ _vm->_draw->invalidateRect(_vm->_draw->_destSpriteX, _vm->_draw->_destSpriteY,
+ _vm->_draw->_destSpriteX + _vm->_draw->_spriteRight - 1,
+ _vm->_draw->_destSpriteY + _vm->_draw->_spriteBottom - 1);
+
+ }
+
+ if (flags & 4) {
+ _animLeft = _toRedrawLeft = left;
+ _animTop = _toRedrawTop = top;
+ _animRight = _toRedrawRight = right;
+ _animBottom = _toRedrawBottom = bottom;
+ }
+
+ return;
+ }
+
if ((_animPictCount[animation] == 0) || (layer < 0))
return;
if (layer >= _animations[animation].layersCount)
@@ -670,6 +812,16 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
pictIndex = (pictIndex & 15) - 1;
+ if ((pictIndex == 0xFFFF) || (_animPictCount[animation] <= pictIndex)) {
+ warning("Scenery::updateAnim: pictIndex out of range");
+ return;
+ }
+
+ if (_animations[animation].sizes[pictIndex] <= pieceIndex) {
+ warning("Scenery::updateAnim: pieceIndex out of range");
+ continue;
+ }
+
left = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].left);
right = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].right);
top = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].top);
diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h
index 290d67d2d5..a1a1304d4d 100644
--- a/engines/gob/scenery.h
+++ b/engines/gob/scenery.h
@@ -92,6 +92,7 @@ public:
AnimLayer *layers;
PieceDesc **pieces;
bool *piecesFromExt;
+ uint16 *sizes;
Animation() : layersCount(0), layers(0), pieces(0),
piecesFromExt(0) {}
};
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 6ca694c11a..8e573ddb1a 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -128,11 +128,14 @@ void Util::processInput(bool scroll) {
}
_vm->_global->_speedFactor = MIN(_fastMode + 1, 3);
- if (scroll && hasMove) {
- if (y >= (_vm->_height - _vm->_video->_splitHeight2)) {
- y = _vm->_height - _vm->_video->_splitHeight2 - 1;
- _vm->_util->setMousePos(x, y);
- }
+ if (hasMove && scroll) {
+ x = CLIP(x, _vm->_global->_mouseMinX, _vm->_global->_mouseMaxX);
+ y = CLIP(y, _vm->_global->_mouseMinY, _vm->_global->_mouseMaxY);
+
+ x -= _vm->_video->_screenDeltaX;
+ y -= _vm->_video->_screenDeltaY;
+
+ _vm->_util->setMousePos(x, y);
_vm->_game->evaluateScroll(x, y);
}
}
@@ -228,15 +231,15 @@ int16 Util::checkKey(void) {
void Util::getMouseState(int16 *pX, int16 *pY, int16 *pButtons) {
Common::Point mouse = g_system->getEventManager()->getMousePos();
- *pX = mouse.x + _vm->_video->_scrollOffsetX;
- *pY = mouse.y + _vm->_video->_scrollOffsetY;
+ *pX = mouse.x + _vm->_video->_scrollOffsetX - _vm->_video->_screenDeltaX;
+ *pY = mouse.y + _vm->_video->_scrollOffsetY - _vm->_video->_screenDeltaY;
if (pButtons != 0)
*pButtons = _mouseButtons;
}
void Util::setMousePos(int16 x, int16 y) {
- g_system->warpMouse(x, y);
+ g_system->warpMouse(x + _vm->_video->_screenDeltaX, y + _vm->_video->_screenDeltaY);
}
void Util::waitMouseUp(void) {
@@ -331,12 +334,12 @@ void Util::waitEndFrame() {
void Util::setScrollOffset(int16 x, int16 y) {
processInput();
- if(x >= 0)
+ if (x >= 0)
_vm->_video->_scrollOffsetX = x;
else
_vm->_video->_scrollOffsetX = _vm->_draw->_scrollOffsetX;
- if(y >= 0)
+ if (y >= 0)
_vm->_video->_scrollOffsetY = y;
else
_vm->_video->_scrollOffsetY = _vm->_draw->_scrollOffsetY;
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 5a27254890..9a004318b8 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -95,6 +95,9 @@ Video::Video(GobEngine *vm) : _vm(vm) {
_splitHeight2 = 0;
_splitStart = 0;
+ _screenDeltaX = 0;
+ _screenDeltaY = 0;
+
_curSparse = 0;
_lastSparse = 0xFFFFFFFF;
}
@@ -142,9 +145,7 @@ SurfaceDesc *Video::initSurfDesc(int16 vidMode, int16 width, int16 height,
if (flags & PRIMARY_SURFACE) {
_vm->_global->_primaryWidth = width;
- _vm->_global->_mouseMaxCol = width;
_vm->_global->_primaryHeight = height;
- _vm->_global->_mouseMaxRow = height;
descPtr = _vm->_global->_primarySurfDesc;
descPtr->resize(width, height);
@@ -160,17 +161,41 @@ SurfaceDesc *Video::initSurfDesc(int16 vidMode, int16 width, int16 height,
return descPtr;
}
+void Video::clearScreen() {
+ g_system->clearScreen();
+}
+
+void Video::setSize(bool defaultTo1XScaler) {
+ _vm->_system->beginGFXTransaction();
+ _vm->_system->initSize(_vm->_width, _vm->_height);
+ _vm->initCommonGFX(defaultTo1XScaler);
+ _vm->_system->endGFXTransaction();
+}
+
void Video::retrace(bool mouse) {
if (mouse)
CursorMan.showMouse((_vm->_draw->_showCursor & 2) != 0);
if (_vm->_global->_primarySurfDesc) {
- g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
- _scrollOffsetY * _surfWidth + _scrollOffsetX, _surfWidth,
- 0, 0, _vm->_width, _splitHeight1);
- if (_splitHeight2 > 0)
- g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
- _splitStart * _surfWidth, _surfWidth, 0,
- _vm->_height - _splitHeight2, _vm->_width, _splitHeight2);
+ int screenOffset = _scrollOffsetY * _surfWidth + _scrollOffsetX;
+ int screenX = _screenDeltaX;
+ int screenY = _screenDeltaY;
+ int screenWidth = _vm->_width;
+ int screenHeight = _splitHeight1;
+
+ g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() + screenOffset,
+ _surfWidth, screenX, screenY, screenWidth, screenHeight);
+
+ if (_splitHeight2 > 0) {
+ screenOffset = _splitStart * _surfWidth;
+ screenX = 0;
+ screenY = _vm->_height - _splitHeight2;
+ screenWidth = _vm->_width;
+ screenHeight = _splitHeight2;
+
+ g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() + screenOffset,
+ _surfWidth, screenX, screenY, screenWidth, screenHeight);
+ }
+
g_system->updateScreen();
}
}
diff --git a/engines/gob/video.h b/engines/gob/video.h
index 16932d5046..4a585d8857 100644
--- a/engines/gob/video.h
+++ b/engines/gob/video.h
@@ -104,11 +104,17 @@ public:
int16 _splitHeight1;
int16 _splitHeight2;
int16 _splitStart;
+ int16 _screenDeltaX;
+ int16 _screenDeltaY;
void freeDriver();
void initPrimary(int16 mode);
SurfaceDesc *initSurfDesc(int16 vidMode, int16 width,
int16 height, int16 flags);
+
+ void setSize(bool defaultTo1XScaler);
+
+ void clearScreen();
void retrace(bool mouse = true);
void waitRetrace(bool mouse = true);
void sparseRetrace(int max);
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index c3cecea318..e088646498 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -32,29 +32,117 @@
#include "gob/game.h"
#include "gob/palanim.h"
#include "gob/inter.h"
+#include "gob/map.h"
namespace Gob {
const char *VideoPlayer::_extensions[] = { "IMD", "VMD" };
-VideoPlayer::VideoPlayer(GobEngine *vm) : _vm(vm) {
- _curFile[0] = 0;
- _stream = 0;
+VideoPlayer::Video::Video(GobEngine *vm) : _vm(vm), _fileName(0), _stream(0), _video(0) {
+}
+
+VideoPlayer::Video::~Video() {
+ close();
+}
+
+bool VideoPlayer::Video::open(const char *fileName, Type which) {
+ close();
+
+ int16 handle = _vm->_dataIO->openData(fileName);
+
+ if (handle < 0) {
+ warning("Couldn't open video \"%s\": No such file", fileName);
+ return false;
+ }
+
+ _stream = _vm->_dataIO->openAsStream(handle, true);
+
+ if (which == kVideoTypeIMD) {
+ _video = new Imd();
+ } else if (which == kVideoTypeVMD) {
+ _video = new Vmd();
+ } else {
+ warning("Couldn't open video \"%s\": Invalid video Type", fileName);
+ close();
+ return false;
+ }
+
+ if (!_video->load(*_stream)) {
+ warning("While loading video \"%s\"", fileName);
+ close();
+ return false;
+ }
+
+ _fileName = new char[strlen(fileName) + 1];
+ strcpy(_fileName, fileName);
+
+ _defaultX = _video->getX();
+ _defaultY = _video->getY();
+
+ return true;
+}
+
+void VideoPlayer::Video::close() {
+ delete _video;
+ delete _stream;
+ delete[] _fileName;
+
_video = 0;
+ _stream = 0;
+ _fileName = 0;
+ memset(&_state, 0, sizeof(CoktelVideo::State));
+ _defaultX = _defaultY = 0;
+}
+
+bool VideoPlayer::Video::isOpen() const {
+ return (_video != 0);
+}
+
+const char *VideoPlayer::Video::getFileName() const {
+ return _fileName ? _fileName : "";
+}
+
+CoktelVideo *VideoPlayer::Video::getVideo() {
+ return _video;
+}
+
+const CoktelVideo *VideoPlayer::Video::getVideo() const {
+ return _video;
+}
+
+CoktelVideo::State VideoPlayer::Video::getState() const {
+ return _state;
+}
+
+int16 VideoPlayer::Video::getDefaultX() const {
+ return _defaultX;
+}
+
+int16 VideoPlayer::Video::getDefaultY() const {
+ return _defaultY;
+}
+
+CoktelVideo::State VideoPlayer::Video::nextFrame() {
+ if (_video)
+ _state = _video->nextFrame();
+
+ return _state;
+}
+
+VideoPlayer::VideoPlayer(GobEngine *vm) : _vm(vm) {
+ _primaryVideo = new Video(vm);
_backSurf = false;
_needBlit = false;
_noCursorSwitch = false;
}
VideoPlayer::~VideoPlayer() {
- closeVideo();
+ delete _primaryVideo;
+ for (uint i = 0; i < _videoSlots.size(); i++)
+ delete _videoSlots[i];
}
-bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Type which) {
- char fileName[256];
-
- strncpy0(fileName, video, 250);
-
+bool VideoPlayer::findFile(char *fileName, Type &which) {
char *extStart = strrchr(fileName, '.');
// There's no empty extension
if (extStart == (fileName + strlen(fileName) - 1)) {
@@ -112,33 +200,22 @@ bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Ty
}
- if (scumm_strnicmp(_curFile, fileName, strlen(fileName))) {
- closeVideo();
+ return true;
+}
- int16 handle = _vm->_dataIO->openData(fileName);
+bool VideoPlayer::primaryOpen(const char *videoFile, int16 x, int16 y,
+ int16 flags, Type which) {
- if (handle < 0) {
- warning("Couldn't open video \"%s\": No such file", fileName);
- return false;
- }
+ char fileName[256];
- _stream = _vm->_dataIO->openAsStream(handle, true);
+ strncpy0(fileName, videoFile, 250);
- if (which == kVideoTypeIMD) {
- _video = new Imd();
- } else if (which == kVideoTypeVMD) {
- _video = new Vmd();
- } else {
- warning("Couldn't open video \"%s\": Invalid video Type", fileName);
- closeVideo();
- return false;
- }
+ if (!findFile(fileName, which))
+ return false;
- if (!_video->load(*_stream)) {
- warning("While loading video \"%s\"", fileName);
- closeVideo();
+ if (scumm_strnicmp(_primaryVideo->getFileName(), fileName, strlen(fileName))) {
+ if (!_primaryVideo->open(fileName, which))
return false;
- }
// WORKAROUND: In some rare cases, the cursor should still be
// displayed while a video is playing.
@@ -153,53 +230,54 @@ bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Ty
_noCursorSwitch = true;
}
- strcpy(_curFile, fileName);
-
if (!(flags & kFlagNoVideo)) {
_backSurf = ((flags & kFlagFrontSurface) == 0);
SurfaceDesc::Ptr surf = _vm->_draw->_spritesArray[_backSurf ? 21 : 20];
- _video->setVideoMemory(surf->getVidMem(), surf->getWidth(), surf->getHeight());
+ _primaryVideo->getVideo()->setVideoMemory(surf->getVidMem(),
+ surf->getWidth(), surf->getHeight());
} else
- _video->setVideoMemory();
+ _primaryVideo->getVideo()->setVideoMemory();
_needBlit = ((flags & kFlagUseBackSurfaceContent) != 0) && ((flags & kFlagFrontSurface) != 0);
- _video->enableSound(*_vm->_mixer);
+ _primaryVideo->getVideo()->enableSound(*_vm->_mixer);
}
- if (!_video)
+ if (!_primaryVideo->isOpen())
return false;
- _video->setFrameRate(_vm->_util->getFrameRate());
- _video->setXY(x, y);
- WRITE_VAR(7, _video->getFramesCount());
+ _primaryVideo->getVideo()->setFrameRate(_vm->_util->getFrameRate());
+ _primaryVideo->getVideo()->setXY(x, y);
+ WRITE_VAR(7, _primaryVideo->getVideo()->getFramesCount());
return true;
}
-void VideoPlayer::play(int16 startFrame, int16 lastFrame, int16 breakKey,
+void VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame, bool fade, int16 reverseTo) {
- if (!_video)
+ if (!_primaryVideo->isOpen())
return;
+ CoktelVideo &video = *(_primaryVideo->getVideo());
+
breakKey = 27;
if (startFrame < 0)
- startFrame = _video->getCurrentFrame();
+ startFrame = video.getCurrentFrame();
if (lastFrame < 0)
- lastFrame = _video->getFramesCount() - 1;
+ lastFrame = video.getFramesCount() - 1;
if (palFrame < 0)
palFrame = startFrame;
if (endFrame < 0)
endFrame = lastFrame;
palCmd &= 0x3F;
- if (_video->getCurrentFrame() != startFrame) {
- if (_video->getFeatures() & CoktelVideo::kFeaturesSound)
- startFrame = _video->getCurrentFrame();
+ if (video.getCurrentFrame() != startFrame) {
+ if (video.getFeatures() & CoktelVideo::kFeaturesSound)
+ startFrame = video.getCurrentFrame();
else
- _video->seekFrame(startFrame);
+ video.seekFrame(startFrame);
}
_vm->_draw->_showCursor = _noCursorSwitch ? 3 : 0;
@@ -217,36 +295,177 @@ void VideoPlayer::play(int16 startFrame, int16 lastFrame, int16 breakKey,
}
if (!_noCursorSwitch)
- _video->waitEndFrame();
+ video.waitEndFrame();
startFrame++;
}
if (reverseTo >= 0) {
- int16 toFrame = _video->getFramesCount() - reverseTo;
- for (int i = _video->getCurrentFrame(); i >= toFrame; i--) {
- _video->seekFrame(i, SEEK_SET, true);
+ int16 toFrame = video.getFramesCount() - reverseTo;
+ for (int i = video.getCurrentFrame(); i >= toFrame; i--) {
+ video.seekFrame(i, SEEK_SET, true);
if (doPlay(i, breakKey, 0, 0, 0, 0, 0)) {
_vm->_palAnim->fade(0, -2, 0);
memset((char *) _vm->_draw->_vgaPalette, 0, 768);
}
if (!_noCursorSwitch)
- _video->waitEndFrame();
+ video.waitEndFrame();
}
}
}
-int16 VideoPlayer::getFramesCount() const {
- if (!_video)
- return 0;
+void VideoPlayer::primaryClose() {
+ _primaryVideo->close();
+}
+
+int VideoPlayer::slotOpen(const char *videoFile, Type which) {
+ Video *video = new Video(_vm);
+ char fileName[256];
+
+ strncpy0(fileName, videoFile, 250);
+
+ if (!findFile(fileName, which)) {
+ delete video;
+ return -1;
+ }
+
+ if (!video->open(fileName, which)) {
+ delete video;
+ return -1;
+ }
+
+ video->getVideo()->setVideoMemory();
+ video->getVideo()->disableSound();
+
+ _videoSlots.push_back(video);
- return _video->getFramesCount();
+ WRITE_VAR(7, video->getVideo()->getFramesCount());
+
+ return _videoSlots.size() - 1;
+}
+
+void VideoPlayer::slotPlay(int slot, int16 frame) {
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ return;
+
+ CoktelVideo &video = *(_videoSlots[slot]->getVideo());
+
+ if (frame < 0)
+ frame = video.getCurrentFrame();
+
+ if (frame >= video.getFramesCount())
+ return;
+
+ if (video.getCurrentFrame() != frame)
+ video.seekFrame(frame);
+
+ _videoSlots[slot]->nextFrame();
+ WRITE_VAR(11, frame);
+}
+
+void VideoPlayer::slotClose(int slot) {
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ return;
+
+ delete _videoSlots[slot];
+ _videoSlots.remove_at(slot);
+}
+
+void VideoPlayer::slotCopyFrame(int slot, byte *dest,
+ uint16 left, uint16 top, uint16 width, uint16 height,
+ uint16 x, uint16 y, uint16 pitch, int16 transp) {
+
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ return;
+
+ _videoSlots[slot]->getVideo()->copyCurrentFrame(dest,
+ left, top, width, height, x, y, pitch, transp);
+}
+
+void VideoPlayer::slotCopyPalette(int slot, int16 palStart, int16 palEnd) {
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ return;
+
+ copyPalette(*(_videoSlots[slot]->getVideo()), palStart, palEnd);
+}
+
+bool VideoPlayer::slotIsOpen(int slot) const {
+ if ((slot >= 0) && (((uint) slot) < _videoSlots.size()))
+ return true;
+
+ return false;
}
-int16 VideoPlayer::getCurrentFrame() const {
- if (!_video)
- return 0;
+const VideoPlayer::Video *VideoPlayer::getVideoBySlot(int slot) const {
+ if (slot < 0) {
+ if (_primaryVideo->isOpen())
+ return _primaryVideo;
+ } else if (((uint) slot) < _videoSlots.size())
+ return _videoSlots[slot];
- return _video->getCurrentFrame();
+ return 0;
+}
+
+uint16 VideoPlayer::getFlags(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getVideo()->getFlags();
+
+ return 0;
+}
+
+int16 VideoPlayer::getFramesCount(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getVideo()->getFramesCount();
+
+ return 0;
+}
+
+int16 VideoPlayer::getCurrentFrame(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getVideo()->getCurrentFrame();
+
+ return 0;
+}
+
+int16 VideoPlayer::getWidth(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getVideo()->getWidth();
+
+ return 0;
+}
+
+int16 VideoPlayer::getHeight(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getVideo()->getHeight();
+
+ return 0;
+}
+
+int16 VideoPlayer::getDefaultX(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getDefaultX();
+
+ return 0;
+}
+
+int16 VideoPlayer::getDefaultY(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getDefaultY();
+
+ return 0;
}
bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
@@ -260,7 +479,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_draw->_applyPal = true;
if (palCmd >= 4)
- copyPalette(palStart, palEnd);
+ copyPalette(*(_primaryVideo->getVideo()), palStart, palEnd);
}
if (modifiedPal && (palCmd == 8) && !_backSurf)
@@ -270,7 +489,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
if (_needBlit)
_vm->_draw->forceBlit();
- CoktelVideo::State state = _video->nextFrame();
+ CoktelVideo::State state = _primaryVideo->nextFrame();
WRITE_VAR(11, frame);
if (_needBlit)
@@ -285,7 +504,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
}
if (state.flags & CoktelVideo::kStatePalette) {
- copyPalette(palStart, palEnd);
+ copyPalette(*(_primaryVideo->getVideo()), palStart, palEnd);
if (!_backSurf)
_vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
@@ -311,7 +530,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_util->processInput();
if (_vm->_quitRequested) {
- _video->disableSound();
+ _primaryVideo->getVideo()->disableSound();
return true;
}
@@ -321,7 +540,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_inter->storeKey(_vm->_util->checkKey());
if (VAR(0) == (unsigned) breakKey) {
- _video->disableSound();
+ _primaryVideo->getVideo()->disableSound();
return true;
}
}
@@ -329,26 +548,37 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
return false;
}
-void VideoPlayer::copyPalette(int16 palStart, int16 palEnd) {
- if ((palStart == -1) || (palEnd == -1))
- memcpy((char *) _vm->_global->_pPaletteDesc->vgaPal,
- _video->getPalette(), 768);
- else
- memcpy(((char *) (_vm->_global->_pPaletteDesc->vgaPal)) +
- palStart * 3, _video->getPalette() + palStart * 3,
+void VideoPlayer::copyPalette(CoktelVideo &video, int16 palStart, int16 palEnd) {
+ if ((palStart != -1) && (palEnd != -1))
+ memcpy(((char *) (_vm->_global->_pPaletteDesc->vgaPal)) + palStart * 3,
+ video.getPalette() + palStart * 3,
(palEnd - palStart + 1) * 3);
+ else
+ memcpy((char *) _vm->_global->_pPaletteDesc->vgaPal, video.getPalette(), 768);
}
-void VideoPlayer::writeVideoInfo(const char *video, int16 varX, int16 varY,
+void VideoPlayer::writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
int16 varFrames, int16 varWidth, int16 varHeight) {
- if (openVideo(video)) {
- WRITE_VAR_OFFSET(varX, _video->getX());
- WRITE_VAR_OFFSET(varY, _video->getY());
- WRITE_VAR_OFFSET(varFrames, _video->getFramesCount());
- WRITE_VAR_OFFSET(varWidth, _video->getWidth());
- WRITE_VAR_OFFSET(varHeight, _video->getHeight());
- closeVideo();
+ if (primaryOpen(videoFile)) {
+ int16 x, y, width, height;
+
+ if ((VAR_OFFSET(varX) != 0xFFFFFFFF) ||
+ !_primaryVideo->getVideo()->getAnchor(1, 2, x, y, width, height)) {
+
+ x = _primaryVideo->getVideo()->getX();
+ y = _primaryVideo->getVideo()->getY();
+ width = _primaryVideo->getVideo()->getWidth();
+ height = _primaryVideo->getVideo()->getHeight();
+ }
+
+ WRITE_VAR_OFFSET(varX, x);
+ WRITE_VAR_OFFSET(varY, y);
+ WRITE_VAR_OFFSET(varFrames, _primaryVideo->getVideo()->getFramesCount());
+ WRITE_VAR_OFFSET(varWidth, width);
+ WRITE_VAR_OFFSET(varHeight, height);
+
+ primaryClose();
} else {
WRITE_VAR_OFFSET(varX, -1);
WRITE_VAR_OFFSET(varY, -1);
@@ -358,13 +588,4 @@ void VideoPlayer::writeVideoInfo(const char *video, int16 varX, int16 varY,
}
}
-void VideoPlayer::closeVideo() {
- delete _video;
- delete _stream;
-
- _video = 0;
- _stream = 0;
- *_curFile = 0;
-}
-
} // End of namespace Gob
diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h
index 7b9a3ca687..fd3c68aa1a 100644
--- a/engines/gob/videoplayer.h
+++ b/engines/gob/videoplayer.h
@@ -26,6 +26,8 @@
#ifndef GOB_VIDEOPLAYER_H
#define GOB_VIDEOPLAYER_H
+#include "common/array.h"
+
#include "gob/coktelvideo.h"
#include "gob/dataio.h"
@@ -51,34 +53,81 @@ public:
VideoPlayer(GobEngine *vm);
~VideoPlayer();
- bool openVideo(const char *video, int16 x = -1, int16 y = -1,
+ bool primaryOpen(const char *videoFile, int16 x = -1, int16 y = -1,
int16 flags = kFlagFrontSurface, Type which = kVideoTypeTry);
-
- void play(int16 startFrame = -1, int16 lastFrame = -1, int16 breakKey = 27,
+ void primaryPlay(int16 startFrame = -1, int16 lastFrame = -1, int16 breakKey = 27,
uint16 palCmd = 8, int16 palStart = 0, int16 palEnd = 255,
int16 palFrame = -1, int16 endFrame = -1, bool fade = false,
int16 reverseTo = -1);
-
- int16 getFramesCount() const;
- int16 getCurrentFrame() const;
- void writeVideoInfo(const char *video, int16 varX, int16 varY,
+ void primaryClose();
+
+ int slotOpen(const char *videoFile, Type which = kVideoTypeTry);
+ void slotPlay(int slot, int16 frame = -1);
+ void slotClose(int slot);
+ void slotCopyFrame(int slot, byte *dest,
+ uint16 left, uint16 top, uint16 width, uint16 height,
+ uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
+ void slotCopyPalette(int slot, int16 palStart = -1, int16 palEnd = -1);
+
+ bool slotIsOpen(int slot) const;
+
+ uint16 getFlags(int slot = -1) const;
+ int16 getFramesCount(int slot = -1) const;
+ int16 getCurrentFrame(int slot = -1) const;
+ int16 getWidth(int slot = -1) const;
+ int16 getHeight(int slot = -1) const;
+ int16 getDefaultX(int slot = -1) const;
+ int16 getDefaultY(int slot = -1) const;
+
+ void writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
int16 varFrames, int16 varWidth, int16 varHeight);
- void closeVideo();
-
private:
+ class Video {
+ public:
+ Video(GobEngine *vm);
+ ~Video();
+
+ bool open(const char *fileName, Type which);
+ void close();
+
+ bool isOpen() const;
+
+ const char *getFileName() const;
+ CoktelVideo *getVideo();
+ const CoktelVideo *getVideo() const;
+ CoktelVideo::State getState() const;
+
+ int16 getDefaultX() const;
+ int16 getDefaultY() const;
+
+ CoktelVideo::State nextFrame();
+
+ private:
+ GobEngine *_vm;
+
+ char *_fileName;
+ DataStream *_stream;
+ CoktelVideo *_video;
+ CoktelVideo::State _state;
+ int16 _defaultX, _defaultY;
+ };
+
static const char *_extensions[];
GobEngine *_vm;
- char _curFile[256];
- DataStream *_stream;
- CoktelVideo *_video;
+ Common::Array<Video *> _videoSlots;
+ Video *_primaryVideo;
bool _backSurf;
bool _needBlit;
bool _noCursorSwitch;
- void copyPalette(int16 palStart = -1, int16 palEnd = -1);
+ bool findFile(char *fileName, Type &which);
+
+ const Video *getVideoBySlot(int slot = -1) const;
+
+ void copyPalette(CoktelVideo &video, int16 palStart = -1, int16 palEnd = -1);
bool doPlay(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame);
diff --git a/engines/igor/detection.cpp b/engines/igor/detection.cpp
index 400db95f20..b04de19fb9 100644
--- a/engines/igor/detection.cpp
+++ b/engines/igor/detection.cpp
@@ -133,4 +133,8 @@ bool IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return gd != 0;
}
-REGISTER_PLUGIN(IGOR, PLUGIN_TYPE_ENGINE, IgorMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(IGOR)
+ REGISTER_PLUGIN_DYNAMIC(IGOR, PLUGIN_TYPE_ENGINE, IgorMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(IGOR, PLUGIN_TYPE_ENGINE, IgorMetaEngine);
+#endif
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index ab75085782..48ef4e951c 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -38,7 +38,7 @@ MODULE_OBJS := \
parts/part_main.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp
new file mode 100644
index 0000000000..9314f8604e
--- /dev/null
+++ b/engines/kyra/animator_hof.cpp
@@ -0,0 +1,339 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_hof.h"
+#include "kyra/wsamovie.h"
+
+#include "common/endian.h"
+
+namespace Kyra {
+
+void KyraEngine_HoF::restorePage3() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::restorePage3()");
+ screen()->copyBlockToPage(2, 0, 0, 320, 144, _gamePlayBuffer);
+}
+
+void KyraEngine_HoF::clearAnimObjects() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::clearAnimObjects()");
+ _animObjects[0].index = 0;
+ _animObjects[0].type = 0;
+ _animObjects[0].enabled = 1;
+ _animObjects[0].flags = 0x800;
+ _animObjects[0].width = 32;
+ _animObjects[0].height = 49;
+ _animObjects[0].width2 = 4;
+ _animObjects[0].height2 = 10;
+
+ for (int i = 1; i < 11; ++i) {
+ _animObjects[i].index = i;
+ _animObjects[i].type = 2;
+ }
+
+ for (int i = 11; i <= 40; ++i) {
+ _animObjects[i].index = i;
+ _animObjects[i].type = 1;
+ _animObjects[i].flags = 0x800;
+ _animObjects[i].width = 16;
+ _animObjects[i].height = 16;
+ }
+}
+
+void KyraEngine_HoF::drawAnimObjects() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawAnimObjects()");
+ for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
+ if (!curObject->enabled)
+ continue;
+
+ int x = curObject->xPos2 - (_screen->getScreenDim(2)->sx << 3);
+ int y = curObject->yPos2 - _screen->getScreenDim(2)->sy;
+ int layer = 7;
+
+ if (curObject->flags & 0x800) {
+ if (curObject->animFlags)
+ layer = 0;
+ else
+ layer = getDrawLayer(curObject->xPos1, curObject->yPos1);
+ }
+ curObject->flags |= 0x800;
+
+ if (curObject->index)
+ drawSceneAnimObject(curObject, x, y, layer);
+ else
+ drawCharacterAnimObject(curObject, x, y, layer);
+ }
+}
+
+void KyraEngine_HoF::refreshAnimObjects(int force) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::refreshAnimObjects(%d)", force);
+ for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
+ if (!curObject->enabled)
+ continue;
+ if (!curObject->needRefresh && !force)
+ continue;
+
+ int x = curObject->xPos2 - curObject->width2;
+ if (x < 0)
+ x = 0;
+ if (x >= 320)
+ x = 319;
+ int y = curObject->yPos2 - curObject->height2;
+ if (y < 0)
+ y = 0;
+ if (y >= 143)
+ y = 142;
+
+ int width = curObject->width + curObject->width2 + 8;
+ int height = curObject->height + curObject->height2*2;
+ if (width + x > 320)
+ width -= width + x - 322;
+ if (height + y > 143)
+ height -= height + y - 144;
+
+ _screen->hideMouse();
+ _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->showMouse();
+
+ curObject->needRefresh = false;
+ }
+}
+
+void KyraEngine_HoF::updateItemAnimations() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateItemAnimations()");
+ bool nextFrame = false;
+
+ if (_itemAnimData[0].itemIndex == -1 || _inventorySaved)
+ return;
+
+ const ItemAnimData_v2 *s = &_itemAnimData[_nextAnimItem];
+ ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
+
+ if (++_nextAnimItem == 14) {
+ _nextAnimItem = 0;
+ return;
+ }
+
+ uint32 ctime = _system->getMillis();
+ if (ctime < a->nextFrame)
+ return;
+
+ uint16 shpIdx = s->frames[a->currentFrame].index + 64;
+ if ((s->itemIndex == _handItemSet || s->itemIndex == _itemInHand) && (!_mouseState && _screen->isMouseVisible())) {
+ nextFrame = true;
+ _screen->setMouseCursor(8, 15, getShapePtr(shpIdx));
+ }
+
+ for (int i = 0; i < 10; i++) {
+ if (s->itemIndex == _mainCharacter.inventory[i]) {
+ nextFrame = true;
+ _screen->drawShape(2, getShapePtr(240 + i), 304, 184, 0, 0);
+ _screen->drawShape(2, getShapePtr(shpIdx), 304, 184, 0, 0);
+ _screen->copyRegion(304, 184, _inventoryX[i], _inventoryY[i], 16, 16, 2, 0);
+ }
+ }
+
+ _screen->updateScreen();
+
+ for (int i = 11; i < 40; i++) {
+ AnimObj *animObject = &_animObjects[i];
+ if (animObject->shapeIndex2 == s->itemIndex + 64) {
+ if (s->itemIndex == 121) {
+ int f = findItem(_mainCharacter.sceneId, 121);
+ int nx = _itemList[f].x - 4;
+ if (nx > 12) {
+ if (lineIsPassable(nx, _itemList[f].y)) {
+ animObject->xPos2 -= 4;
+ _itemList[f].x -= 4;
+ }
+ }
+ }
+ animObject->shapePtr = getShapePtr(shpIdx);
+ animObject->shapeIndex1 = shpIdx;
+ animObject->needRefresh = 1;
+ nextFrame = true;
+ }
+ }
+
+ if (nextFrame) {
+ a->nextFrame = _system->getMillis() + (s->frames[a->currentFrame].delay * _tickLength);
+ a->currentFrame = ++a->currentFrame % s->numFrames;
+ }
+}
+
+void KyraEngine_HoF::updateCharFacing() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateCharFacing()");
+ if (_mainCharacter.x1 > _mouseX)
+ _mainCharacter.facing = 5;
+ else
+ _mainCharacter.facing = 3;
+
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+}
+
+void KyraEngine_HoF::updateCharacterAnim(int) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateCharacterAnim(-)");
+ Character *c = &_mainCharacter;
+ AnimObj *animState = _animObjects;
+
+ animState->needRefresh = 1;
+ animState->specialRefresh = 1;
+
+ if (c->facing >= 1 && c->facing <= 3)
+ animState->flags |= 1;
+ else if (c->facing >= 5 && c->facing <= 7)
+ animState->flags &= ~1;
+
+ animState->xPos2 = animState->xPos1 = c->x1;
+ animState->yPos2 = animState->yPos1 = c->y1;
+ animState->shapePtr = getShapePtr(c->animFrame);
+ animState->shapeIndex1 = animState->shapeIndex2 = c->animFrame;
+
+ int xAdd = _shapeDescTable[c->animFrame-9].xAdd;
+ int yAdd = _shapeDescTable[c->animFrame-9].yAdd;
+
+ _charScale = getScale(c->x1, c->y1);
+
+ animState->xPos2 += (xAdd * _charScale) >> 8;
+ animState->yPos2 += (yAdd * _charScale) >> 8;
+ animState->width2 = 8;
+ animState->height2 = 10;
+
+ _animList = deleteAnimListEntry(_animList, animState);
+ if (_animList)
+ _animList = addToAnimListSorted(_animList, animState);
+ else
+ _animList = initAnimList(_animList, animState);
+
+ updateCharPal(1);
+}
+
+void KyraEngine_HoF::updateSceneAnim(int anim, int newFrame) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateSceneAnim(%d, %d)", anim, newFrame);
+ AnimObj *animObject = &_animObjects[1+anim];
+ if (!animObject->enabled)
+ return;
+
+ animObject->needRefresh = 1;
+ animObject->specialRefresh = 1;
+ animObject->flags = 0;
+
+ if (_sceneAnims[anim].flags & 2)
+ animObject->flags |= 0x800;
+ else
+ animObject->flags &= ~0x800;
+
+ if (_sceneAnims[anim].flags & 4)
+ animObject->flags |= 1;
+ else
+ animObject->flags &= ~1;
+
+ if (_sceneAnims[anim].flags & 0x20) {
+ animObject->shapePtr = _sceneShapeTable[newFrame];
+ animObject->shapeIndex2 = 0xFFFF;
+ animObject->shapeIndex3 = 0xFFFF;
+ animObject->animNum = 0xFFFF;
+ } else {
+ animObject->shapePtr = 0;
+ animObject->shapeIndex3 = newFrame;
+ animObject->animNum = anim;
+ }
+
+ animObject->xPos1 = _sceneAnims[anim].x;
+ animObject->yPos1 = _sceneAnims[anim].y;
+ animObject->xPos2 = _sceneAnims[anim].x2;
+ animObject->yPos2 = _sceneAnims[anim].y2;
+
+ if (_sceneAnims[anim].flags & 2) {
+ _animList = deleteAnimListEntry(_animList, animObject);
+ if (!_animList)
+ _animList = initAnimList(_animList, animObject);
+ else
+ _animList = addToAnimListSorted(_animList, animObject);
+ }
+}
+
+void KyraEngine_HoF::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
+ if (obj->type == 1) {
+ if (obj->shapeIndex1 == 0xFFFF)
+ return;
+ int scale = getScale(obj->xPos1, obj->yPos1);
+ _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, scale, scale);
+ return;
+ }
+
+ if (obj->shapePtr) {
+ _screen->drawShape(2, obj->shapePtr, x, y, 2, obj->flags, layer);
+ } else {
+ if (obj->shapeIndex3 == 0xFFFF || obj->animNum == 0xFFFF)
+ return;
+
+ int flags = 0x4000;
+ if (obj->flags & 0x800)
+ flags |= 0x8000;
+
+ if (_sceneAnims[obj->animNum].wsaFlag) {
+ x = y = 0;
+ } else {
+ x = obj->xPos2;
+ y = obj->yPos2;
+ }
+
+ _sceneAnimMovie[obj->animNum]->setX(x);
+ _sceneAnimMovie[obj->animNum]->setY(y);
+ _sceneAnimMovie[obj->animNum]->setDrawPage(2);
+ _sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, int(flags | layer), 0, 0);
+ }
+}
+
+void KyraEngine_HoF::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
+ if (_drawNoShapeFlag || obj->shapeIndex1 == 0xFFFF)
+ return;
+ _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, _charScale, _charScale);
+}
+
+void KyraEngine_HoF::setCharacterAnimDim(int w, int h) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::setCharacterAnimDim(%d, %d)", w, h);
+ restorePage3();
+
+ _animObj0Width = _animObjects[0].width;
+ _animObj0Height = _animObjects[0].height;
+
+ _animObjects[0].width = w;
+ _animObjects[0].height = h;
+}
+
+void KyraEngine_HoF::resetCharacterAnimDim() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::resetCharacterAnimDim()");
+ restorePage3();
+
+ _animObjects[0].width = _animObj0Width;
+ _animObjects[0].height = _animObj0Height;
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/animator_v3.cpp b/engines/kyra/animator_mr.cpp
index 078b914e86..ab3d347549 100644
--- a/engines/kyra/animator_v3.cpp
+++ b/engines/kyra/animator_mr.cpp
@@ -23,13 +23,19 @@
*
*/
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_mr.h"
+#include "kyra/resource.h"
#include "kyra/wsamovie.h"
namespace Kyra {
-void KyraEngine_v3::clearAnimObjects() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::clearAnimObjects()");
+void KyraEngine_MR::restorePage3() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::restorePage3()");
+ screen()->copyBlockToPage(2, 0, 0, 320, 200, _gamePlayBuffer);
+}
+
+void KyraEngine_MR::clearAnimObjects() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::clearAnimObjects()");
for (int i = 0; i < 67; ++i)
_animObjects[i].enabled = false;
@@ -37,7 +43,7 @@ void KyraEngine_v3::clearAnimObjects() {
_animObjects[0].index = 0;
_animObjects[0].type = 0;
_animObjects[0].enabled = true;
- _animObjects[0].unk8 = 1;
+ _animObjects[0].specialRefresh = 1;
_animObjects[0].flags = 0x800;
_animObjects[0].width = 57;
_animObjects[0].height = 91;
@@ -50,13 +56,13 @@ void KyraEngine_v3::clearAnimObjects() {
_animObjects[i].flags = 0;
_animObjects[i].enabled = false;
_animObjects[i].needRefresh = 0;
- _animObjects[i].unk8 = 1;
+ _animObjects[i].specialRefresh = 1;
}
for (int i = 17; i <= 66; ++i) {
_animObjects[i].index = i;
_animObjects[i].type = 1;
- _animObjects[i].unk8 = 1;
+ _animObjects[i].specialRefresh = 1;
_animObjects[i].flags = 0x800;
_animObjects[i].width = 24;
_animObjects[i].height = 20;
@@ -65,87 +71,8 @@ void KyraEngine_v3::clearAnimObjects() {
}
}
-KyraEngine_v3::AnimObj *KyraEngine_v3::initAnimList(AnimObj *list, AnimObj *entry) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initAnimList(%p, %p)", (const void*)list, (const void*)entry);
- entry->nextObject = list;
- return entry;
-}
-
-KyraEngine_v3::AnimObj *KyraEngine_v3::addToAnimListSorted(AnimObj *list, AnimObj *add) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)add);
- add->nextObject = 0;
-
- if (!list)
- return add;
-
- if (add->yPos1 <= list->yPos1) {
- add->nextObject = list;
- return add;
- }
-
- AnimObj *cur = list;
- AnimObj *prev = list;
- while (add->yPos1 > cur->yPos1) {
- AnimObj *temp = cur->nextObject;
- if (!temp)
- break;
- prev = cur;
- cur = temp;
- }
-
- if (add->yPos1 <= cur->yPos1) {
- prev->nextObject = add;
- add->nextObject = cur;
- } else {
- cur->nextObject = add;
- add->nextObject = 0;
- }
- return list;
-}
-
-KyraEngine_v3::AnimObj *KyraEngine_v3::deleteAnimListEntry(AnimObj *list, AnimObj *entry) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)entry);
- if (!list)
- return 0;
-
- AnimObj *old = 0;
- AnimObj *cur = list;
-
- while (true) {
- if (cur == entry)
- break;
- if (!cur->nextObject)
- break;
- old = cur;
- cur = cur->nextObject;
- }
-
- if (cur != entry)
- return list;
-
- if (cur == list) {
- if (!cur->nextObject)
- return 0;
- cur = cur->nextObject;
- return cur;
- }
-
- if (!cur->nextObject) {
- if (!old)
- return 0;
- old->nextObject = 0;
- return list;
- }
-
- if (cur != entry)
- return list;
-
- old->nextObject = entry->nextObject;
- return list;
-}
-
-void KyraEngine_v3::animSetupPaletteEntry(AnimObj *anim) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::animSetupPaletteEntry(%p)", (const void*)anim);
+void KyraEngine_MR::animSetupPaletteEntry(AnimObj *anim) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::animSetupPaletteEntry(%p)", (const void*)anim);
int layer = _screen->getLayer(anim->xPos1, anim->yPos1) - 1;
int16 count = 0;
for (int i = 0; i < 3; ++i)
@@ -156,15 +83,8 @@ void KyraEngine_v3::animSetupPaletteEntry(AnimObj *anim) {
anim->palette = count / 3;
}
-void KyraEngine_v3::restorePage3() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::restorePage3()");
- musicUpdate(0);
- _screen->copyBlockToPage(3, 0, 0, 320, 200, _gamePlayBuffer);
- musicUpdate(0);
-}
-
-void KyraEngine_v3::drawAnimObjects() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawAnimObjects()");
+void KyraEngine_MR::drawAnimObjects() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawAnimObjects()");
for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
if (!curObject->enabled)
continue;
@@ -174,7 +94,7 @@ void KyraEngine_v3::drawAnimObjects() {
int layer = 7;
if (curObject->flags & 0x800) {
- if (!curObject->unk8)
+ if (!curObject->specialRefresh)
layer = 0;
else
layer = getDrawLayer(curObject->xPos1, curObject->yPos1);
@@ -187,13 +107,13 @@ void KyraEngine_v3::drawAnimObjects() {
}
}
-void KyraEngine_v3::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
+void KyraEngine_MR::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
if (obj->type == 1) {
- if (obj->shapeIndex == 0xFFFF)
+ if (obj->shapeIndex1 == 0xFFFF)
return;
int scale = getScale(obj->xPos1, obj->yPos1);
- _screen->drawShape(2, getShapePtr(obj->shapeIndex), x, y, 2, obj->flags | 0x104, _paletteOverlay, obj->palette, layer, scale, scale);
+ _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 0x104, _paletteOverlay, obj->palette, layer, scale, scale);
} else {
if (obj->shapePtr) {
_screen->drawShape(2, obj->shapePtr, x, y, 2, obj->flags, 7);
@@ -213,15 +133,15 @@ void KyraEngine_v3::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
}
}
-void KyraEngine_v3::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
+void KyraEngine_MR::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
if (_drawNoShapeFlag)
return;
if (_mainCharacter.animFrame < 9)
_mainCharacter.animFrame = 87;
- if (obj->shapeIndex == 0xFFFF || _mainCharacter.animFrame == 87)
+ if (obj->shapeIndex1 == 0xFFFF || _mainCharacter.animFrame == 87)
return;
_screen->drawShape(2, getShapePtr(421), _mainCharacter.x3, _mainCharacter.y3, 2, obj->flags | 0x304, _paletteOverlay, 3, layer, _charScale, _charScale);
@@ -230,8 +150,8 @@ void KyraEngine_v3::drawCharacterAnimObject(AnimObj *obj, int x, int y, int laye
_screen->drawShape(2, shape, x, y, 2, obj->flags | 4, layer, _charScale, _charScale);
}
-void KyraEngine_v3::refreshAnimObjects(int force) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::refreshAnimObjects(%d)", force);
+void KyraEngine_MR::refreshAnimObjects(int force) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::refreshAnimObjects(%d)", force);
for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
if (!curObject->enabled)
continue;
@@ -276,27 +196,8 @@ void KyraEngine_v3::refreshAnimObjects(int force) {
}
}
-void KyraEngine_v3::refreshAnimObjectsIfNeed() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::refreshAnimObjectsIfNeed()");
- for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) {
- if (curEntry->enabled && curEntry->needRefresh) {
- restorePage3();
- drawAnimObjects();
- refreshAnimObjects(0);
- _screen->updateScreen();
- return;
- }
- }
-}
-
-void KyraEngine_v3::flagAnimObjsForRefresh() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::flagAnimObjsForRefresh()");
- for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject)
- curEntry->needRefresh = true;
-}
-
-void KyraEngine_v3::updateCharacterAnim(int charId) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::updateCharacterAnim(%d)", charId);
+void KyraEngine_MR::updateCharacterAnim(int charId) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateCharacterAnim(%d)", charId);
AnimObj *obj = &_animObjects[0];
obj->needRefresh = true;
@@ -304,15 +205,15 @@ void KyraEngine_v3::updateCharacterAnim(int charId) {
obj->xPos1 = _mainCharacter.x1;
obj->yPos1 = _mainCharacter.y1;
obj->shapePtr = getShapePtr(_mainCharacter.animFrame);
- obj->shapeIndex = obj->shapeIndex2 = _mainCharacter.animFrame;
+ obj->shapeIndex1 = obj->shapeIndex2 = _mainCharacter.animFrame;
int shapeOffsetX = 0, shapeOffsetY = 0;
if (_mainCharacter.animFrame >= 50 && _mainCharacter.animFrame <= 87) {
shapeOffsetX = _malcolmShapeXOffset;
shapeOffsetY = _malcolmShapeYOffset;
} else {
- shapeOffsetX = _newShapeXAdd;
- shapeOffsetY = _newShapeYAdd;
+ shapeOffsetX = _animShapeXAdd;
+ shapeOffsetY = _animShapeYAdd;
}
obj->xPos2 = _mainCharacter.x1;
@@ -328,7 +229,7 @@ void KyraEngine_v3::updateCharacterAnim(int charId) {
}
for (int i = 1; i <= 16; ++i) {
- if (_animObjects[i].enabled && _animObjects[i].unk8)
+ if (_animObjects[i].enabled && _animObjects[i].specialRefresh)
_animObjects[i].needRefresh = true;
}
@@ -342,8 +243,8 @@ void KyraEngine_v3::updateCharacterAnim(int charId) {
updateCharPal(1);
}
-void KyraEngine_v3::updateSceneAnim(int anim, int newFrame) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::updateSceneAnim(%d, %d)", anim, newFrame);
+void KyraEngine_MR::updateSceneAnim(int anim, int newFrame) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateSceneAnim(%d, %d)", anim, newFrame);
AnimObj *animObject = &_animObjects[1+anim];
if (!animObject->enabled)
return;
@@ -380,9 +281,9 @@ void KyraEngine_v3::updateSceneAnim(int anim, int newFrame) {
}
}
-void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, int x2, int y2, int w,
+void KyraEngine_MR::setupSceneAnimObject(int animId, uint16 flags, int x, int y, int x2, int y2, int w,
int h, int unk10, int specialSize, int unk14, int shape, const char *filename) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::setupSceneAnimObject(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')",
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::setupSceneAnimObject(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')",
animId, flags, x, y, x2, y2, w, h, unk10, specialSize, unk14, shape, filename);
restorePage3();
SceneAnim &anim = _sceneAnims[animId];
@@ -393,9 +294,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
anim.y2 = y2;
anim.width = w;
anim.height = h;
- anim.unk10 = unk10;
anim.specialSize = specialSize;
- anim.unk14 = unk14;
anim.shapeIndex = shape;
if (filename)
strcpy(anim.filename, filename);
@@ -431,7 +330,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
obj->enabled = true;
obj->needRefresh = true;
- obj->unk8 = (anim.flags & 0x20) ? 1 : 0;
+ obj->specialRefresh = (anim.flags & 0x20) ? 1 : 0;
obj->flags = (anim.flags & 0x10) ? 0x800 : 0;
if (anim.flags & 2)
obj->flags |= 1;
@@ -439,7 +338,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
obj->xPos1 = anim.x;
obj->yPos1 = anim.y;
- if ((anim.flags & 4) && anim.shapeIndex != 0xFFFF)
+ if ((anim.flags & 4) && anim.shapeIndex != -1)
obj->shapePtr = _sceneShapes[anim.shapeIndex];
else
obj->shapePtr = 0;
@@ -464,8 +363,8 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
_animList = initAnimList(_animList, obj);
}
-void KyraEngine_v3::removeSceneAnimObject(int anim, int refresh) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::removeSceneAnimObject(%d, %d)", anim, refresh);
+void KyraEngine_MR::removeSceneAnimObject(int anim, int refresh) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::removeSceneAnimObject(%d, %d)", anim, refresh);
AnimObj *obj = &_animObjects[anim+1];
restorePage3();
obj->shapeIndex3 = 0xFFFF;
@@ -480,8 +379,8 @@ void KyraEngine_v3::removeSceneAnimObject(int anim, int refresh) {
_sceneAnimMovie[anim]->close();
}
-void KyraEngine_v3::setCharacterAnimDim(int w, int h) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::setCharacterAnimDim(%d, %d)", w, h);
+void KyraEngine_MR::setCharacterAnimDim(int w, int h) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::setCharacterAnimDim(%d, %d)", w, h);
restorePage3();
_charBackUpWidth = _animObjects[0].width;
_charBackUpWidth2 = _animObjects[0].width2;
@@ -494,8 +393,8 @@ void KyraEngine_v3::setCharacterAnimDim(int w, int h) {
_animObjects[0].height = h;
}
-void KyraEngine_v3::resetCharacterAnimDim() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetCharacterAnimDim()");
+void KyraEngine_MR::resetCharacterAnimDim() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::resetCharacterAnimDim()");
restorePage3();
_animObjects[0].width2 = _charBackUpWidth2;
_animObjects[0].height2 = _charBackUpHeight2;
@@ -505,8 +404,8 @@ void KyraEngine_v3::resetCharacterAnimDim() {
_charBackUpWidth = _charBackUpHeight = -1;
}
-void KyraEngine_v3::showIdleAnim() {
- debugC(9, kDebugLevelMain | kDebugLevelAnimator, "KyraEngine_v3::showIdleAnim()");
+void KyraEngine_MR::showIdleAnim() {
+ debugC(9, kDebugLevelMain | kDebugLevelAnimator, "KyraEngine_MR::showIdleAnim()");
if (_mainCharacter.sceneId == 20 || _mainCharacter.sceneId == 21
|| _mainCharacter.sceneId == 12 || _mainCharacter.sceneId == 11)
@@ -516,142 +415,21 @@ void KyraEngine_v3::showIdleAnim() {
return;
if (!_nextIdleType && !talkObjectsInCurScene()) {
- malcolmRandomChat();
+ randomSceneChat();
} else {
static const char *facingTable[] = {
"A", "R", "R", "FR", "FX", "FL", "L", "L"
};
char filename[14];
- snprintf(filename, 14, "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _malcolmShapes);
+ snprintf(filename, 14, "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _characterShapeFile);
if (_res->exists(filename))
- runTemporaryScript(filename, 1, 1, 1, 1);
+ runAnimationScript(filename, 1, 1, 1, 1);
}
_nextIdleType = !_nextIdleType;
}
-int KyraEngine_v3::initNewShapes(uint8 *filedata) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initNewShapes(%p)", (const void*)filedata);
- const int lastEntry = MIN(_newShapeLastEntry, 41);
- for (int i = 0; i < lastEntry; ++i)
- _gameShapes[9+i] = _screen->getPtrToShape(filedata, i);
- return lastEntry;
-}
-
-void KyraEngine_v3::processNewShapes(int allowSkip, int resetChar) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::processNewShapes(%d, %d)", allowSkip, resetChar);
- setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
-
- _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
- _scriptInterpreter->startScript(&_temporaryScriptState, 1);
-
- resetSkipFlag();
-
- while (_scriptInterpreter->validScript(&_temporaryScriptState)) {
- _temporaryScriptExecBit = false;
- while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit)
- _scriptInterpreter->runScript(&_temporaryScriptState);
-
- if (_newShapeAnimFrame < 0)
- continue;
-
- _mainCharacter.animFrame = _newShapeAnimFrame + 9;
- updateCharacterAnim(0);
- if (_chatText)
- updateWithText();
- else
- update();
-
- uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
-
- while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
- if (_chatText)
- updateWithText();
- else
- update();
-
- delay(10);
- }
-
- if (skipFlag())
- resetSkipFlag();
- }
-
- if (resetChar) {
- if (_newShapeFlag >= 0) {
- _mainCharacter.animFrame = _newShapeFlag + 9;
- updateCharacterAnim(0);
- if (_chatText)
- updateWithText();
- else
- update();
- }
-
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- }
-
- _newShapeFlag = -1;
- resetCharacterAnimDim();
-}
-
-void KyraEngine_v3::resetNewShapes(int count, uint8 *filedata) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetNewShapes(%d, %p)", count, (const void*)filedata);
- for (int i = 0; i < count; ++i)
- _gameShapes[9+i] = 0;
- delete [] filedata;
- setNextIdleAnimTimer();
-}
-
-void KyraEngine_v3::addItemToAnimList(int item) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addItemToAnimList(%d)", item);
- restorePage3();
-
- AnimObj *animObj = &_animObjects[17+item];
-
- animObj->enabled = 1;
- animObj->needRefresh = 1;
-
- int itemId = _itemList[item].id;
-
- animObj->xPos2 = animObj->xPos1 = _itemList[item].x;
- animObj->yPos2 = animObj->yPos1 = _itemList[item].y;
-
- animObj->shapePtr = getShapePtr(248+itemId);
- animSetupPaletteEntry(animObj);
- animObj->shapeIndex2 = animObj->shapeIndex = 248+itemId;
-
- int scaleY, scaleX;
- scaleY = scaleX = getScale(animObj->xPos1, animObj->yPos1);
-
- uint8 *shapePtr = getShapePtr(248+itemId);
- animObj->xPos3 = (animObj->xPos2 -= (_screen->getShapeScaledWidth(shapePtr, scaleX) >> 1));
- animObj->yPos3 = (animObj->yPos2 -= _screen->getShapeScaledHeight(shapePtr, scaleY));
-
- animObj->width2 = animObj->height2 = 0;
-
- _animList = addToAnimListSorted(_animList, animObj);
- animObj->needRefresh = 1;
-}
-
-void KyraEngine_v3::deleteItemAnimEntry(int item) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::deleteItemAnimEntry(%d)", item);
- AnimObj *animObj = &_animObjects[17+item];
-
- restorePage3();
-
- animObj->shapePtr = 0;
- animObj->shapeIndex = 0xFFFF;
- animObj->shapeIndex2 = 0xFFFF;
- animObj->needRefresh = 1;
-
- refreshAnimObjectsIfNeed();
-
- animObj->enabled = 0;
- _animList = deleteAnimListEntry(_animList, animObj);
-}
-
} // end of namespace Kyra
diff --git a/engines/kyra/animator_v1.cpp b/engines/kyra/animator_v1.cpp
index 69dc473d32..ea56efd9fb 100644
--- a/engines/kyra/animator_v1.cpp
+++ b/engines/kyra/animator_v1.cpp
@@ -33,7 +33,7 @@
#include "common/system.h"
namespace Kyra {
-ScreenAnimator::ScreenAnimator(KyraEngine_v1 *vm, OSystem *system) {
+Animator_v1::Animator_v1(KyraEngine_v1 *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
_initOk = false;
@@ -48,14 +48,14 @@ ScreenAnimator::ScreenAnimator(KyraEngine_v1 *vm, OSystem *system) {
memset(_actorBkgBackUp[1], 0, _screen->getRectSize(8, 69));
}
-ScreenAnimator::~ScreenAnimator() {
+Animator_v1::~Animator_v1() {
close();
delete [] _actorBkgBackUp[0];
delete [] _actorBkgBackUp[1];
}
-void ScreenAnimator::init(int actors_, int items_, int sprites_) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::init(%d, %d, %d)", actors_, items_, sprites_);
+void Animator_v1::init(int actors_, int items_, int sprites_) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::init(%d, %d, %d)", actors_, items_, sprites_);
_screenObjects = new AnimObject[actors_ + items_ + sprites_];
assert(_screenObjects);
memset(_screenObjects, 0, sizeof(AnimObject) * (actors_ + items_ + sprites_));
@@ -67,8 +67,8 @@ void ScreenAnimator::init(int actors_, int items_, int sprites_) {
_initOk = true;
}
-void ScreenAnimator::close() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::close()");
+void Animator_v1::close() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::close()");
if (_initOk) {
_initOk = false;
delete [] _screenObjects;
@@ -76,7 +76,7 @@ void ScreenAnimator::close() {
}
}
-void ScreenAnimator::initAnimStateList() {
+void Animator_v1::initAnimStateList() {
AnimObject *animStates = _screenObjects;
animStates[0].index = 0;
animStates[0].active = 1;
@@ -118,8 +118,8 @@ void ScreenAnimator::initAnimStateList() {
}
}
-void ScreenAnimator::preserveAllBackgrounds() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveAllBackgrounds()");
+void Animator_v1::preserveAllBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::preserveAllBackgrounds()");
uint8 curPage = _screen->_curPage;
_screen->_curPage = 2;
@@ -134,8 +134,8 @@ void ScreenAnimator::preserveAllBackgrounds() {
_screen->_curPage = curPage;
}
-void ScreenAnimator::flagAllObjectsForBkgdChange() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForBkgdChange()");
+void Animator_v1::flagAllObjectsForBkgdChange() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::flagAllObjectsForBkgdChange()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->bkgdChangeFlag = 1;
@@ -143,8 +143,8 @@ void ScreenAnimator::flagAllObjectsForBkgdChange() {
}
}
-void ScreenAnimator::flagAllObjectsForRefresh() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForRefresh()");
+void Animator_v1::flagAllObjectsForRefresh() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::flagAllObjectsForRefresh()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->refreshFlag = 1;
@@ -152,8 +152,8 @@ void ScreenAnimator::flagAllObjectsForRefresh() {
}
}
-void ScreenAnimator::restoreAllObjectBackgrounds() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::restoreAllObjectBackground()");
+void Animator_v1::restoreAllObjectBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::restoreAllObjectBackground()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -169,8 +169,8 @@ void ScreenAnimator::restoreAllObjectBackgrounds() {
_screen->_curPage = 0;
}
-void ScreenAnimator::preserveAnyChangedBackgrounds() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveAnyChangedBackgrounds()");
+void Animator_v1::preserveAnyChangedBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::preserveAnyChangedBackgrounds()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -185,8 +185,8 @@ void ScreenAnimator::preserveAnyChangedBackgrounds() {
_screen->_curPage = 0;
}
-void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
+void Animator_v1::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
int x = 0, y = 0, width = obj->width, height = obj->height;
if (restore) {
@@ -217,8 +217,8 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore)
_screen->copyRegionToBuffer(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
}
-void ScreenAnimator::prepDrawAllObjects() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::prepDrawAllObjects()");
+void Animator_v1::prepDrawAllObjects() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::prepDrawAllObjects()");
AnimObject *curObject = _objectQueue;
int drawPage = 2;
int flagUnk1 = 0, flagUnk2 = 0, flagUnk3 = 0;
@@ -363,8 +363,8 @@ void ScreenAnimator::prepDrawAllObjects() {
}
}
-void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::copyChangedObjectsForward(%d)", refreshFlag);
+void Animator_v1::copyChangedObjectsForward(int refreshFlag) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::copyChangedObjectsForward(%d)", refreshFlag);
for (AnimObject *curObject = _objectQueue; curObject; curObject = curObject->nextAnimObject) {
if (curObject->active) {
@@ -404,16 +404,16 @@ void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
}
}
-void ScreenAnimator::updateAllObjectShapes() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::updateAllObjectShapes()");
+void Animator_v1::updateAllObjectShapes() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::updateAllObjectShapes()");
restoreAllObjectBackgrounds();
preserveAnyChangedBackgrounds();
prepDrawAllObjects();
copyChangedObjectsForward(0);
}
-void ScreenAnimator::animRemoveGameItem(int index) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d)", index);
+void Animator_v1::animRemoveGameItem(int index) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::animRemoveGameItem(%d)", index);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_items[index];
@@ -427,8 +427,8 @@ void ScreenAnimator::animRemoveGameItem(int index) {
objectRemoveQueue(_objectQueue, animObj);
}
-void ScreenAnimator::animAddGameItem(int index, uint16 sceneId) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d, %d)", index, sceneId);
+void Animator_v1::animAddGameItem(int index, uint16 sceneId) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::animRemoveGameItem(%d, %d)", index, sceneId);
restoreAllObjectBackgrounds();
assert(sceneId < _vm->_roomTableSize);
Room *currentRoom = &_vm->_roomTable[sceneId];
@@ -453,8 +453,8 @@ void ScreenAnimator::animAddGameItem(int index, uint16 sceneId) {
animObj->bkgdChangeFlag = 1;
}
-void ScreenAnimator::animAddNPC(int character) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::animAddNPC(%d)", character);
+void Animator_v1::animAddNPC(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::animAddNPC(%d)", character);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_actors[character];
const Character *ch = &_vm->_characterList[character];
@@ -478,8 +478,8 @@ void ScreenAnimator::animAddNPC(int character) {
animObj->bkgdChangeFlag = 1;
}
-AnimObject *ScreenAnimator::objectRemoveQueue(AnimObject *queue, AnimObject *rem) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectRemoveQueue(%p, %p)", (const void *)queue, (const void *)rem);
+Animator_v1::AnimObject *Animator_v1::objectRemoveQueue(AnimObject *queue, AnimObject *rem) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::objectRemoveQueue(%p, %p)", (const void *)queue, (const void *)rem);
AnimObject *cur = queue;
AnimObject *prev = queue;
@@ -512,14 +512,14 @@ AnimObject *ScreenAnimator::objectRemoveQueue(AnimObject *queue, AnimObject *rem
return queue;
}
-AnimObject *ScreenAnimator::objectAddHead(AnimObject *queue, AnimObject *head) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectAddHead(%p, %p)", (const void *)queue, (const void *)head);
+Animator_v1::AnimObject *Animator_v1::objectAddHead(AnimObject *queue, AnimObject *head) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::objectAddHead(%p, %p)", (const void *)queue, (const void *)head);
head->nextAnimObject = queue;
return head;
}
-AnimObject *ScreenAnimator::objectQueue(AnimObject *queue, AnimObject *add) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectQueue(%p, %p)", (const void *)queue, (const void *)add);
+Animator_v1::AnimObject *Animator_v1::objectQueue(AnimObject *queue, AnimObject *add) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::objectQueue(%p, %p)", (const void *)queue, (const void *)add);
if (add->drawY <= queue->drawY || !queue) {
add->nextAnimObject = queue;
return add;
@@ -544,16 +544,16 @@ AnimObject *ScreenAnimator::objectQueue(AnimObject *queue, AnimObject *add) {
return queue;
}
-void ScreenAnimator::addObjectToQueue(AnimObject *object) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::addObjectToQueue(%p)", (const void *)object);
+void Animator_v1::addObjectToQueue(AnimObject *object) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::addObjectToQueue(%p)", (const void *)object);
if (!_objectQueue)
_objectQueue = objectAddHead(0, object);
else
_objectQueue = objectQueue(_objectQueue, object);
}
-void ScreenAnimator::refreshObject(AnimObject *object) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::refreshObject(%p)", (const void *)object);
+void Animator_v1::refreshObject(AnimObject *object) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::refreshObject(%p)", (const void *)object);
_objectQueue = objectRemoveQueue(_objectQueue, object);
if (_objectQueue)
_objectQueue = objectQueue(_objectQueue, object);
@@ -561,8 +561,8 @@ void ScreenAnimator::refreshObject(AnimObject *object) {
_objectQueue = objectAddHead(0, object);
}
-void ScreenAnimator::makeBrandonFaceMouse() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::makeBrandonFaceMouse()");
+void Animator_v1::makeBrandonFaceMouse() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::makeBrandonFaceMouse()");
Common::Point mouse = _vm->getMousePos();
if (mouse.x >= _vm->_currentCharacter->x1)
_vm->_currentCharacter->facing = 3;
@@ -572,22 +572,22 @@ void ScreenAnimator::makeBrandonFaceMouse() {
updateAllObjectShapes();
}
-int16 ScreenAnimator::fetchAnimWidth(const uint8 *shape, int16 mult) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimWidth(%p, %d)", (const void *)shape, mult);
+int16 Animator_v1::fetchAnimWidth(const uint8 *shape, int16 mult) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::fetchAnimWidth(%p, %d)", (const void *)shape, mult);
if (_vm->gameFlags().useAltShapeHeader)
shape += 2;
return (((int16)READ_LE_UINT16((shape+3))) * mult) >> 8;
}
-int16 ScreenAnimator::fetchAnimHeight(const uint8 *shape, int16 mult) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimHeight(%p, %d)", (const void *)shape, mult);
+int16 Animator_v1::fetchAnimHeight(const uint8 *shape, int16 mult) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::fetchAnimHeight(%p, %d)", (const void *)shape, mult);
if (_vm->gameFlags().useAltShapeHeader)
shape += 2;
return (int16)(((int8)*(shape+2)) * mult) >> 8;
}
-void ScreenAnimator::setBrandonAnimSeqSize(int width, int height) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::setBrandonAnimSeqSize(%d, %d)", width, height);
+void Animator_v1::setBrandonAnimSeqSize(int width, int height) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::setBrandonAnimSeqSize(%d, %d)", width, height);
restoreAllObjectBackgrounds();
_brandonAnimSeqSizeWidth = _actors[0].width;
_brandonAnimSeqSizeHeight = _actors[0].height;
@@ -596,16 +596,16 @@ void ScreenAnimator::setBrandonAnimSeqSize(int width, int height) {
preserveAllBackgrounds();
}
-void ScreenAnimator::resetBrandonAnimSeqSize() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::resetBrandonAnimSeqSize()");
+void Animator_v1::resetBrandonAnimSeqSize() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::resetBrandonAnimSeqSize()");
restoreAllObjectBackgrounds();
_actors[0].width = _brandonAnimSeqSizeWidth;
_actors[0].height = _brandonAnimSeqSizeHeight;
preserveAllBackgrounds();
}
-void ScreenAnimator::animRefreshNPC(int character) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRefreshNPC(%d)", character);
+void Animator_v1::animRefreshNPC(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::animRefreshNPC(%d)", character);
AnimObject *animObj = &_actors[character];
Character *ch = &_vm->characterList()[character];
@@ -663,8 +663,8 @@ void ScreenAnimator::animRefreshNPC(int character) {
refreshObject(animObj);
}
-void ScreenAnimator::setCharacterDefaultFrame(int character) {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::setCharacterDefaultFrame()");
+void Animator_v1::setCharacterDefaultFrame(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::setCharacterDefaultFrame()");
static uint16 initFrameTable[] = {
7, 41, 77, 0, 0
};
@@ -676,8 +676,8 @@ void ScreenAnimator::setCharacterDefaultFrame(int character) {
// edit->unk6 = 1;
}
-void ScreenAnimator::setCharactersHeight() {
- debugC(9, kDebugLevelAnimator, "ScreenAnimator::setCharactersHeight()");
+void Animator_v1::setCharactersHeight() {
+ debugC(9, kDebugLevelAnimator, "Animator_v1::setCharactersHeight()");
static int8 initHeightTable[] = {
48, 40, 48, 47, 56,
44, 42, 47, 38, 35,
diff --git a/engines/kyra/animator_v1.h b/engines/kyra/animator_v1.h
index 7bfb872651..3ae0b23da4 100644
--- a/engines/kyra/animator_v1.h
+++ b/engines/kyra/animator_v1.h
@@ -23,38 +23,38 @@
*
*/
-#ifndef KYRA_ANIMATOR_H
-#define KYRA_ANIMATOR_H
+#ifndef KYRA_ANIMATOR_V1_H
+#define KYRA_ANIMATOR_V1_H
namespace Kyra {
class KyraEngine_v1;
class Screen;
-struct AnimObject {
- uint8 index;
- uint32 active;
- uint32 refreshFlag;
- uint32 bkgdChangeFlag;
- bool disable;
- uint32 flags;
- int16 drawY;
- uint8 *sceneAnimPtr;
- int16 animFrameNumber;
- uint8 *background;
- uint16 rectSize;
- int16 x1, y1;
- int16 x2, y2;
- uint16 width;
- uint16 height;
- uint16 width2;
- uint16 height2;
- AnimObject *nextAnimObject;
-};
-
-class ScreenAnimator {
+class Animator_v1 {
public:
- ScreenAnimator(KyraEngine_v1 *vm, OSystem *system);
- virtual ~ScreenAnimator();
+ struct AnimObject {
+ uint8 index;
+ uint32 active;
+ uint32 refreshFlag;
+ uint32 bkgdChangeFlag;
+ bool disable;
+ uint32 flags;
+ int16 drawY;
+ uint8 *sceneAnimPtr;
+ int16 animFrameNumber;
+ uint8 *background;
+ uint16 rectSize;
+ int16 x1, y1;
+ int16 x2, y2;
+ uint16 width;
+ uint16 height;
+ uint16 width2;
+ uint16 height2;
+ AnimObject *nextAnimObject;
+ };
+
+ Animator_v1(KyraEngine_v1 *vm, OSystem *system);
+ virtual ~Animator_v1();
operator bool() const { return _initOk; }
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp
index 8efbdbe747..af22056eee 100644
--- a/engines/kyra/animator_v2.cpp
+++ b/engines/kyra/animator_v2.cpp
@@ -24,37 +24,23 @@
*/
#include "kyra/kyra_v2.h"
+#include "kyra/screen_v2.h"
#include "kyra/wsamovie.h"
#include "common/endian.h"
namespace Kyra {
-void KyraEngine_v2::clearAnimObjects() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::clearAnimObjects()");
- memset(_animObjects, 0, sizeof(_animObjects));
-
- _animObjects[0].index = 0;
- _animObjects[0].type = 0;
- _animObjects[0].enabled = 1;
- _animObjects[0].flags = 0x800;
- _animObjects[0].width = 32;
- _animObjects[0].height = 49;
- _animObjects[0].width2 = 4;
- _animObjects[0].height2 = 10;
-
- for (int i = 1; i < 11; ++i) {
- _animObjects[i].index = i;
- _animObjects[i].type = 2;
- }
+void KyraEngine_v2::allocAnimObjects(int actors, int anims, int items) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_v2::allocAnimObjects(%d, %d, %d)", actors, anims, items);
+ _animObjects = new AnimObj[actors+anims+items];
+ assert(_animObjects);
- for (int i = 11; i <= 40; ++i) {
- _animObjects[i].index = i;
- _animObjects[i].type = 1;
- _animObjects[i].flags = 0x800;
- _animObjects[i].width = 16;
- _animObjects[i].height = 16;
- }
+ memset(_animObjects, 0, sizeof(AnimObj)*(actors+anims+items));
+
+ _animActor = _animObjects;
+ _animAnims = _animObjects + actors;
+ _animItems = _animObjects + actors + anims;
}
KyraEngine_v2::AnimObj *KyraEngine_v2::initAnimList(AnimObj *list, AnimObj *entry) {
@@ -136,65 +122,6 @@ KyraEngine_v2::AnimObj *KyraEngine_v2::deleteAnimListEntry(AnimObj *list, AnimOb
return list;
}
-void KyraEngine_v2::drawAnimObjects() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawAnimObjects()");
- for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
- if (!curObject->enabled)
- continue;
-
- int x = curObject->xPos2 - (_screen->getScreenDim(2)->sx << 3);
- int y = curObject->yPos2 - _screen->getScreenDim(2)->sy;
- int layer = 7;
-
- if (curObject->flags & 0x800) {
- if (curObject->animFlags)
- layer = 0;
- else
- layer = getDrawLayer(curObject->xPos1, curObject->yPos1);
- }
- curObject->flags |= 0x800;
-
- if (curObject->index)
- drawSceneAnimObject(curObject, x, y, layer);
- else
- drawCharacterAnimObject(curObject, x, y, layer);
- }
-}
-
-void KyraEngine_v2::refreshAnimObjects(int force) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::refreshAnimObjects(%d)", force);
- for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) {
- if (!curObject->enabled)
- continue;
- if (!curObject->needRefresh && !force)
- continue;
-
- int x = curObject->xPos2 - curObject->width2;
- if (x < 0)
- x = 0;
- if (x >= 320)
- x = 319;
- int y = curObject->yPos2 - curObject->height2;
- if (y < 0)
- y = 0;
- if (y >= 143)
- y = 142;
-
- int width = curObject->width + curObject->width2 + 8;
- int height = curObject->height + curObject->height2*2;
- if (width + x > 320)
- width -= width + x - 322;
- if (height + y > 143)
- height -= height + y - 144;
-
- _screen->hideMouse();
- _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->showMouse();
-
- curObject->needRefresh = false;
- }
-}
-
void KyraEngine_v2::refreshAnimObjectsIfNeed() {
debugC(9, kDebugLevelAnimator, "KyraEngine_v2::refreshAnimObjectsIfNeed()");
for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) {
@@ -202,256 +129,62 @@ void KyraEngine_v2::refreshAnimObjectsIfNeed() {
restorePage3();
drawAnimObjects();
refreshAnimObjects(0);
- _screen->updateScreen();
+ screen()->updateScreen();
return;
}
}
}
-void KyraEngine_v2::updateItemAnimations() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateItemAnimations()");
- bool nextFrame = false;
-
- if (_itemAnimData[0].itemIndex == -1 || _inventorySaved)
- return;
-
- const ItemAnimData_v2 *s = &_itemAnimData[_nextAnimItem];
- ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
-
- if (++_nextAnimItem == 14) {
- _nextAnimItem = 0;
- return;
- }
-
- uint32 ctime = _system->getMillis();
- if (ctime < a->nextFrame)
- return;
-
- uint16 shpIdx = s->frames[a->currentFrame].index + 64;
- if ((s->itemIndex == _handItemSet || s->itemIndex == _itemInHand) && (!_mouseState && _screen->isMouseVisible())) {
- nextFrame = true;
- _screen->setMouseCursor(8, 15, getShapePtr(shpIdx));
- }
-
- for (int i = 0; i < 10; i++) {
- if (s->itemIndex == _mainCharacter.inventory[i]) {
- nextFrame = true;
- _screen->drawShape(2, _defaultShapeTable[240 + i], 304, 184, 0, 0);
- _screen->drawShape(2, getShapePtr(shpIdx), 304, 184, 0, 0);
- _screen->copyRegion(304, 184, _inventoryX[i], _inventoryY[i], 16, 16, 2, 0);
- }
- }
-
- _screen->updateScreen();
-
- for (int i = 11; i < 40; i++) {
- AnimObj *animObject = &_animObjects[i];
- if (animObject->shapeIndex2 == s->itemIndex + 64) {
- if (s->itemIndex == 121) {
- int f = findItem(_mainCharacter.sceneId, 121);
- int nx = _itemList[f].x - 4;
- if (nx > 12) {
- if (lineIsPassable(nx, _itemList[f].y)) {
- animObject->xPos2 -= 4;
- _itemList[f].x -= 4;
- }
- }
- }
- animObject->shapePtr = _defaultShapeTable[shpIdx];
- animObject->shapeIndex1 = shpIdx;
- animObject->needRefresh = 1;
- nextFrame = true;
- }
- }
-
- if (nextFrame) {
- a->nextFrame = _system->getMillis() + (s->frames[a->currentFrame].delay * _tickLength);
- a->currentFrame = ++a->currentFrame % s->numFrames;
- }
-}
-
void KyraEngine_v2::flagAnimObjsForRefresh() {
debugC(9, kDebugLevelAnimator, "KyraEngine_v2::flagAnimObjsForRefresh()");
for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject)
curEntry->needRefresh = 1;
}
-void KyraEngine_v2::flagAnimObjsUnk8() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::flagAnimObjsUnk8()");
+void KyraEngine_v2::flagAnimObjsSpecialRefresh() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_v2::flagAnimObjsSpecialRefresh()");
for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject)
- curEntry->unk8 = 1;
-}
-
-void KyraEngine_v2::updateCharFacing() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateCharFacing()");
- if (_mainCharacter.x1 > _mouseX)
- _mainCharacter.facing = 5;
- else
- _mainCharacter.facing = 3;
-
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
-}
-
-void KyraEngine_v2::updateCharacterAnim(int) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateCharacterAnim(-)");
- Character *c = &_mainCharacter;
- AnimObj *animState = _animObjects;
-
- animState->needRefresh = 1;
- animState->unk8 = 1;
-
- if (c->facing >= 1 && c->facing <= 3)
- animState->flags |= 1;
- else if (c->facing >= 5 && c->facing <= 7)
- animState->flags &= ~1;
-
- animState->xPos2 = animState->xPos1 = c->x1;
- animState->yPos2 = animState->yPos1 = c->y1;
- animState->shapePtr = _defaultShapeTable[c->animFrame];
- animState->shapeIndex1 = animState->shapeIndex2 = c->animFrame;
-
- int xAdd = _shapeDescTable[c->animFrame-9].xAdd;
- int yAdd = _shapeDescTable[c->animFrame-9].yAdd;
-
- _charScaleX = _charScaleY = getScale(c->x1, c->y1);
-
- animState->xPos2 += (xAdd * _charScaleX) >> 8;
- animState->yPos2 += (yAdd * _charScaleY) >> 8;
- animState->width2 = 8;
- animState->height2 = 10;
-
- _animList = deleteAnimListEntry(_animList, animState);
- if (_animList)
- _animList = addToAnimListSorted(_animList, animState);
- else
- _animList = initAnimList(_animList, animState);
-
- updateCharPal(1);
-}
-
-void KyraEngine_v2::updateSceneAnim(int anim, int newFrame) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateSceneAnim(%d, %d)", anim, newFrame);
- AnimObj *animObject = &_animObjects[1+anim];
- if (!animObject->enabled)
- return;
-
- animObject->needRefresh = 1;
- animObject->unk8 = 1;
- animObject->flags = 0;
-
- if (_sceneAnims[anim].flags & 2)
- animObject->flags |= 0x800;
- else
- animObject->flags &= ~0x800;
-
- if (_sceneAnims[anim].flags & 4)
- animObject->flags |= 1;
- else
- animObject->flags &= ~1;
-
- if (_sceneAnims[anim].flags & 0x20) {
- animObject->shapePtr = _sceneShapeTable[newFrame];
- animObject->shapeIndex2 = 0xFFFF;
- animObject->shapeIndex3 = 0xFFFF;
- animObject->animNum = 0xFFFF;
- } else {
- animObject->shapePtr = 0;
- animObject->shapeIndex3 = newFrame;
- animObject->animNum = anim;
- }
-
- animObject->xPos1 = _sceneAnims[anim].x;
- animObject->yPos1 = _sceneAnims[anim].y;
- animObject->xPos2 = _sceneAnims[anim].x2;
- animObject->yPos2 = _sceneAnims[anim].y2;
-
- if (_sceneAnims[anim].flags & 2) {
- _animList = deleteAnimListEntry(_animList, animObject);
- if (!_animList)
- _animList = initAnimList(_animList, animObject);
- else
- _animList = addToAnimListSorted(_animList, animObject);
- }
-}
-
-void KyraEngine_v2::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
- if (obj->type == 1) {
- if (obj->shapeIndex1 == 0xFFFF)
- return;
- int scale = getScale(obj->xPos1, obj->yPos1);
- _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, scale, scale);
- return;
- }
-
- if (obj->shapePtr) {
- _screen->drawShape(2, obj->shapePtr, x, y, 2, obj->flags, layer);
- } else {
- if (obj->shapeIndex3 == 0xFFFF || obj->animNum == 0xFFFF)
- return;
-
- int flags = 0x4000;
- if (obj->flags & 0x800)
- flags |= 0x8000;
-
- if (_sceneAnims[obj->animNum].wsaFlag) {
- x = y = 0;
- } else {
- x = obj->xPos2;
- y = obj->yPos2;
- }
-
- _sceneAnimMovie[obj->animNum]->setX(x);
- _sceneAnimMovie[obj->animNum]->setY(y);
- _sceneAnimMovie[obj->animNum]->setDrawPage(2);
- _sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, int(flags | layer), 0, 0);
- }
-}
-
-void KyraEngine_v2::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer);
- if (_drawNoShapeFlag || obj->shapeIndex1 == 0xFFFF)
- return;
- _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, _charScaleX, _charScaleY);
+ curEntry->specialRefresh = 1;
}
void KyraEngine_v2::addItemToAnimList(int item) {
debugC(9, kDebugLevelAnimator, "KyraEngine_v2::addItemToAnimList(%d)", item);
+ assert(item < _itemListSize);
+
restorePage3();
- AnimObj *animObj = &_animObjects[11+item];
+ AnimObj *animObj = _animItems + item;
animObj->enabled = 1;
animObj->needRefresh = 1;
- animObj->unk8 = 1;
int itemId = _itemList[item].id;
animObj->xPos2 = animObj->xPos1 = _itemList[item].x;
animObj->yPos2 = animObj->yPos1 = _itemList[item].y;
- animObj->shapePtr = _defaultShapeTable[64+itemId];
- animObj->shapeIndex2 = animObj->shapeIndex1 = 64+itemId;
+ animObj->shapePtr = getShapePtr(itemId + _desc.itemShapeStart);
+ animSetupPaletteEntry(animObj);
+ animObj->shapeIndex2 = animObj->shapeIndex1 = itemId + _desc.itemShapeStart;
int scaleY, scaleX;
scaleY = scaleX = getScale(animObj->xPos1, animObj->yPos1);
- uint8 *shapePtr = getShapePtr(64+itemId);
- animObj->xPos3 = (animObj->xPos2 -= (_screen->getShapeScaledWidth(shapePtr, scaleX) >> 1));
- animObj->yPos3 = (animObj->yPos2 -= _screen->getShapeScaledHeight(shapePtr, scaleY));
+ uint8 *shapePtr = getShapePtr(itemId + _desc.itemShapeStart);
+ animObj->xPos3 = (animObj->xPos2 -= (screen_v2()->getShapeScaledWidth(shapePtr, scaleX) >> 1));
+ animObj->yPos3 = (animObj->yPos2 -= screen_v2()->getShapeScaledHeight(shapePtr, scaleY));
animObj->width2 = animObj->height2 = 0;
_animList = addToAnimListSorted(_animList, animObj);
animObj->needRefresh = 1;
- animObj->unk8 = 1;
}
void KyraEngine_v2::deleteItemAnimEntry(int item) {
debugC(9, kDebugLevelAnimator, "KyraEngine_v2::deleteItemAnimEntry(%d)", item);
- AnimObj *animObj = &_animObjects[11+item];
+ assert(item < _itemListSize);
+
+ AnimObj *animObj = _animItems + item;
restorePage3();
@@ -459,7 +192,6 @@ void KyraEngine_v2::deleteItemAnimEntry(int item) {
animObj->shapeIndex1 = 0xFFFF;
animObj->shapeIndex2 = 0xFFFF;
animObj->needRefresh = 1;
- animObj->unk8 = 1;
refreshAnimObjectsIfNeed();
@@ -467,24 +199,5 @@ void KyraEngine_v2::deleteItemAnimEntry(int item) {
_animList = deleteAnimListEntry(_animList, animObj);
}
-void KyraEngine_v2::setCharacterAnimDim(int w, int h) {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::setCharacterAnimDim(%d, %d)", w, h);
- restorePage3();
-
- _animObj0Width = _animObjects[0].width;
- _animObj0Height = _animObjects[0].height;
-
- _animObjects[0].width = w;
- _animObjects[0].height = h;
-}
-
-void KyraEngine_v2::resetCharacterAnimDim() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v2::resetCharacterAnimDim()");
- restorePage3();
-
- _animObjects[0].width = _animObj0Width;
- _animObjects[0].height = _animObj0Height;
-}
-
} // end of namespace Kyra
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index ab49f18e97..51e4d17487 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -29,6 +29,7 @@
#include "kyra/debugger.h"
#include "kyra/kyra_v1.h"
#include "kyra/kyra_v2.h"
+#include "kyra/kyra_hof.h"
#include "kyra/screen.h"
#include "kyra/timer.h"
#include "kyra/resource.h"
@@ -39,6 +40,7 @@ Debugger::Debugger(KyraEngine *vm)
: ::GUI::Debugger() {
_vm = vm;
+ DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("screen_debug_mode", WRAP_METHOD(Debugger, cmd_setScreenDebug));
DCmd_Register("load_palette", WRAP_METHOD(Debugger, cmd_loadPalette));
DCmd_Register("facings", WRAP_METHOD(Debugger, cmd_showFacings));
@@ -189,11 +191,7 @@ bool Debugger::cmd_setTimerCountdown(int argc, const char **argv) {
#pragma mark -
Debugger_v1::Debugger_v1(KyraEngine_v1 *vm)
- : Debugger(vm) {
- _vm = vm;
-
- DCmd_Register("continue", WRAP_METHOD(Debugger_v1, Cmd_Exit));
- DCmd_Register("enter", WRAP_METHOD(Debugger_v1, cmd_enterRoom));
+ : Debugger(vm), _vm(vm) {
DCmd_Register("rooms", WRAP_METHOD(Debugger_v1, cmd_listRooms));
DCmd_Register("give", WRAP_METHOD(Debugger_v1, cmd_giveItem));
DCmd_Register("birthstones", WRAP_METHOD(Debugger_v1, cmd_listBirthstones));
@@ -235,7 +233,8 @@ bool Debugger_v1::cmd_enterRoom(int argc, const char **argv) {
_vm->_currentCharacter->facing = direction;
_vm->enterNewScene(room, _vm->_currentCharacter->facing, 0, 0, 1);
- _vm->_screen->_mouseLockCount = 0;
+ while (!_vm->_screen->isMouseVisible())
+ _vm->_screen->showMouse();
_detach_now = true;
return false;
@@ -285,7 +284,6 @@ bool Debugger_v1::cmd_listBirthstones(int argc, const char **argv) {
#pragma mark -
Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) {
- DCmd_Register("continue", WRAP_METHOD(Debugger_v2, Cmd_Exit));
DCmd_Register("character_info", WRAP_METHOD(Debugger_v2, cmd_characterInfo));
DCmd_Register("enter", WRAP_METHOD(Debugger_v2, cmd_enterScene));
DCmd_Register("rooms", WRAP_METHOD(Debugger_v2, cmd_listScenes)); // for consistency with kyra_v1
@@ -293,7 +291,6 @@ Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) {
DCmd_Register("scene_info", WRAP_METHOD(Debugger_v2, cmd_sceneInfo));
DCmd_Register("scene_to_facing", WRAP_METHOD(Debugger_v2, cmd_sceneToFacing));
DCmd_Register("give", WRAP_METHOD(Debugger_v2, cmd_giveItem));
- DCmd_Register("pass_codes", WRAP_METHOD(Debugger_v2, cmd_passcodes));
}
bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {
@@ -324,7 +321,8 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {
_vm->_mainCharacter.facing = direction;
_vm->enterNewScene(scene, _vm->_mainCharacter.facing, 0, 0, 1);
- _vm->_screen->_mouseLockCount = 0;
+ while (!_vm->screen_v2()->isMouseVisible())
+ _vm->screen_v2()->showMouse();
_detach_now = true;
return false;
@@ -337,8 +335,8 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {
bool Debugger_v2::cmd_listScenes(int argc, const char **argv) {
int shown = 1;
for (int i = 0; i < _vm->_sceneListSize; ++i) {
- if (_vm->_sceneList[i].filename[0]) {
- DebugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename);
+ if (_vm->_sceneList[i].filename1[0]) {
+ DebugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename1);
if (!(shown % 5))
DebugPrintf("\n");
++shown;
@@ -350,7 +348,7 @@ bool Debugger_v2::cmd_listScenes(int argc, const char **argv) {
}
bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) {
- DebugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename);
+ DebugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename1);
DebugPrintf("\n");
DebugPrintf("Exit information:\n");
DebugPrintf("Exit1: leads to %d, position %dx%d\n", int16(_vm->_sceneExit1), _vm->_sceneEnterX1, _vm->_sceneEnterY1);
@@ -373,7 +371,7 @@ bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) {
}
bool Debugger_v2::cmd_characterInfo(int argc, const char **argv) {
- DebugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename);
+ DebugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename1);
DebugPrintf("Position: %dx%d\n", _vm->_mainCharacter.x1, _vm->_mainCharacter.y1);
DebugPrintf("Facing: %d\n", _vm->_mainCharacter.facing);
DebugPrintf("Inventory:\n");
@@ -437,7 +435,13 @@ bool Debugger_v2::cmd_giveItem(int argc, const char **argv) {
return true;
}
-bool Debugger_v2::cmd_passcodes(int argc, const char **argv) {
+#pragma mark -
+
+Debugger_HoF::Debugger_HoF(KyraEngine_HoF *vm) : Debugger_v2(vm), _vm(vm) {
+ DCmd_Register("pass_codes", WRAP_METHOD(Debugger_HoF, cmd_passcodes));
+}
+
+bool Debugger_HoF::cmd_passcodes(int argc, const char **argv) {
if (argc == 2) {
int val = atoi(argv[1]);
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index dedcd672c7..ab5657bbde 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -33,6 +33,7 @@ namespace Kyra {
class KyraEngine;
class KyraEngine_v1;
class KyraEngine_v2;
+class KyraEngine_HoF;
class Debugger : public ::GUI::Debugger {
public:
@@ -84,6 +85,15 @@ protected:
bool cmd_characterInfo(int argc, const char **argv);
bool cmd_sceneToFacing(int argc, const char **argv);
bool cmd_giveItem(int argc, const char **argv);
+};
+
+class Debugger_HoF : public Debugger_v2 {
+public:
+ Debugger_HoF(KyraEngine_HoF *vm);
+
+protected:
+ KyraEngine_HoF *_vm;
+
bool cmd_passcodes(int argc, const char **argv);
};
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 02e501b31a..b921314e68 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -24,8 +24,8 @@
#include "kyra/kyra.h"
#include "kyra/kyra_v1.h"
-#include "kyra/kyra_v2.h"
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_hof.h"
+#include "kyra/kyra_mr.h"
#include "common/config-manager.h"
#include "common/advancedDetector.h"
@@ -41,22 +41,22 @@ struct KYRAGameDescription {
namespace {
-#define FLAGS(x, y, z, a, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, id }
+#define FLAGS(x, y, z, a, b, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, id }
-#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, Kyra::GI_KYRA1)
-#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, Kyra::GI_KYRA1)
-#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, false, Kyra::GI_KYRA1)
+#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, false, Kyra::GI_KYRA1)
+#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, Kyra::GI_KYRA2)
-#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, Kyra::GI_KYRA2)
-#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, Kyra::GI_KYRA2)
+#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, false, Kyra::GI_KYRA2)
+#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, false, Kyra::GI_KYRA2)
+#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, false, Kyra::GI_KYRA2)
-#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, Kyra::GI_KYRA3)
+#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, true, Kyra::GI_KYRA3)
const KYRAGameDescription adGameDescs[] = {
{
@@ -435,7 +435,7 @@ const KYRAGameDescription adGameDescs[] = {
KYRA3_CD_FLAGS
},
- { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0) }
+ { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0) }
};
const PlainGameDescriptor gameList[] = {
@@ -509,10 +509,10 @@ bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
*engine = new Kyra::KyraEngine_v1(syst, flags);
break;
case Kyra::GI_KYRA2:
- *engine = new Kyra::KyraEngine_v2(syst, flags);
+ *engine = new Kyra::KyraEngine_HoF(syst, flags);
break;
case Kyra::GI_KYRA3:
- *engine = new Kyra::KyraEngine_v3(syst, flags);
+ *engine = new Kyra::KyraEngine_MR(syst, flags);
break;
default:
res = false;
@@ -550,4 +550,8 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const {
return saveList;
}
-REGISTER_PLUGIN(KYRA, PLUGIN_TYPE_ENGINE, KyraMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(KYRA)
+ REGISTER_PLUGIN_DYNAMIC(KYRA, PLUGIN_TYPE_ENGINE, KyraMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(KYRA, PLUGIN_TYPE_ENGINE, KyraMetaEngine);
+#endif
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index 5581f636b1..d2e02671c9 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -306,10 +306,15 @@ void GUI::updateSaveList() {
for (Common::StringList::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) {
char s1 = 0, s2 = 0, s3 = 0;
- s1 = (*i)[i->size()-3] - '0';
- s2 = (*i)[i->size()-2] - '0';
- s3 = (*i)[i->size()-1] - '0';
- if (s1 < 0 || s2 < 0 || s3 < 0 || s1 > 9 || s2 > 9 || s3 > 9)
+ s1 = (*i)[i->size()-3];
+ s2 = (*i)[i->size()-2];
+ s3 = (*i)[i->size()-1];
+ if (!isdigit(s1) || !isdigit(s2) || !isdigit(s3))
+ continue;
+ s1 -= '0';
+ s2 -= '0';
+ s3 -= '0';
+ if (s1 == 9 && s2 == 9 && s3 == 9)
continue;
_saveSlots.push_back(s1*100+s2*10+s3);
}
diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h
index dfbca22441..a04ac20de3 100644
--- a/engines/kyra/gui.h
+++ b/engines/kyra/gui.h
@@ -142,8 +142,8 @@ public:
virtual void processButton(Button *button) = 0;
virtual int processButtonList(Button *buttonList, uint16 inputFlags) = 0;
- int redrawShadedButtonCallback(Button *button);
- int redrawButtonCallback(Button *button);
+ virtual int redrawShadedButtonCallback(Button *button);
+ virtual int redrawButtonCallback(Button *button);
// menu specific
virtual void initMenuLayout(Menu &menu);
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp
new file mode 100644
index 0000000000..d1fcaa4712
--- /dev/null
+++ b/engines/kyra/gui_hof.cpp
@@ -0,0 +1,1183 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra.h"
+#include "kyra/kyra_hof.h"
+#include "kyra/screen.h"
+#include "kyra/wsamovie.h"
+#include "kyra/timer.h"
+#include "kyra/sound.h"
+#include "kyra/resource.h"
+
+#include "common/savefile.h"
+
+namespace Kyra {
+
+void KyraEngine_HoF::loadButtonShapes() {
+ const uint8 *src = _screen->getCPagePtr(3);
+ _screen->loadBitmap("_BUTTONS.CSH", 3, 3, 0);
+
+ _gui->_scrollUpButton.data0ShapePtr = _buttonShapes[0] = _screen->makeShapeCopy(src, 0);
+ _gui->_scrollUpButton.data2ShapePtr = _buttonShapes[1] = _screen->makeShapeCopy(src, 1);
+ _gui->_scrollUpButton.data1ShapePtr = _buttonShapes[2] = _screen->makeShapeCopy(src, 2);
+ _gui->_scrollDownButton.data0ShapePtr = _buttonShapes[3] = _screen->makeShapeCopy(src, 3);
+ _gui->_scrollDownButton.data2ShapePtr = _buttonShapes[4] = _screen->makeShapeCopy(src, 4);
+ _gui->_scrollDownButton.data1ShapePtr = _buttonShapes[5] = _screen->makeShapeCopy(src, 5);
+ _buttonShapes[6] = _screen->makeShapeCopy(src, 6);
+ _buttonShapes[7] = _screen->makeShapeCopy(src, 7);
+ _buttonShapes[8] = _screen->makeShapeCopy(src, 6);
+ _buttonShapes[9] = _screen->makeShapeCopy(src, 7);
+ _buttonShapes[10] = _screen->makeShapeCopy(src, 10);
+ _buttonShapes[11] = _screen->makeShapeCopy(src, 11);
+ _buttonShapes[16] = _screen->makeShapeCopy(src, 16);
+ _buttonShapes[17] = _screen->makeShapeCopy(src, 17);
+ _buttonShapes[18] = _screen->makeShapeCopy(src, 18);
+}
+
+void KyraEngine_HoF::setupLangButtonShapes() {
+ switch (_lang) {
+ case 0:
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
+ break;
+
+ case 1:
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[8];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[9];
+ break;
+
+ case 2:
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[10];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[11];
+ break;
+
+ default:
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
+ break;
+ }
+}
+
+GUI_HoF::GUI_HoF(KyraEngine_HoF *vm) : GUI_v2(vm), _vm(vm), _screen(_vm->_screen) {
+}
+
+const char *GUI_HoF::getMenuTitle(const Menu &menu) {
+ if (!menu.menuNameId)
+ return 0;
+
+ return _vm->getTableString(menu.menuNameId, _vm->_optionsBuffer, 1);
+}
+
+const char *GUI_HoF::getMenuItemTitle(const MenuItem &menuItem) {
+ if (!menuItem.itemId)
+ return 0;
+
+ return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1);
+}
+
+const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) {
+ if (!menuItem.labelId)
+ return 0;
+
+ return _vm->getTableString(menuItem.labelId, _vm->_optionsBuffer, 1);
+}
+
+char *GUI_HoF::getTableString(int id) {
+ return _vm->getTableString(id, _vm->_optionsBuffer, 0);
+}
+
+#pragma mark -
+
+
+int KyraEngine_HoF::buttonInventory(Button *button) {
+ if (!_screen->isMouseVisible())
+ return 0;
+
+ int inventorySlot = button->index - 6;
+
+ uint16 item = _mainCharacter.inventory[inventorySlot];
+ if (_itemInHand == -1) {
+ if (item == 0xFFFF)
+ return 0;
+ _screen->hideMouse();
+ clearInventorySlot(inventorySlot, 0);
+ snd_playSoundEffect(0x0B);
+ setMouseCursor(item);
+ int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7;
+ updateCommandLineEx(item+54, string, 0xD6);
+ _itemInHand = (int16)item;
+ _screen->showMouse();
+ _mainCharacter.inventory[inventorySlot] = 0xFFFF;
+ } else {
+ if (_mainCharacter.inventory[inventorySlot] != 0xFFFF) {
+ if (checkInventoryItemExchange(_itemInHand, inventorySlot))
+ return 0;
+
+ item = _mainCharacter.inventory[inventorySlot];
+ snd_playSoundEffect(0x0B);
+ _screen->hideMouse();
+ clearInventorySlot(inventorySlot, 0);
+ drawInventoryShape(0, _itemInHand, inventorySlot);
+ setMouseCursor(item);
+ int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7;
+ updateCommandLineEx(item+54, string, 0xD6);
+ _screen->showMouse();
+ _mainCharacter.inventory[inventorySlot] = _itemInHand;
+ setHandItem(item);
+ } else {
+ snd_playSoundEffect(0x0C);
+ _screen->hideMouse();
+ drawInventoryShape(0, _itemInHand, inventorySlot);
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ int string = (_lang == 1) ? getItemCommandStringInv(_itemInHand) : 8;
+ updateCommandLineEx(_itemInHand+54, string, 0xD6);
+ _screen->showMouse();
+ _mainCharacter.inventory[inventorySlot] = _itemInHand;
+ _itemInHand = -1;
+ }
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::scrollInventory(Button *button) {
+ uint16 *src = _mainCharacter.inventory;
+ uint16 *dst = &_mainCharacter.inventory[10];
+ uint16 temp[5];
+
+ memcpy(temp, src, sizeof(uint16)*5);
+ memcpy(src, src+5, sizeof(uint16)*5);
+ memcpy(src+5, dst, sizeof(uint16)*5);
+ memcpy(dst, dst+5, sizeof(uint16)*5);
+ memcpy(dst+5, temp, sizeof(uint16)*5);
+ _screen->hideMouse();
+ _screen->copyRegion(0x46, 0x90, 0x46, 0x90, 0x71, 0x2E, 0, 2);
+ _screen->showMouse();
+ redrawInventory(2);
+ scrollInventoryWheel();
+ return 0;
+}
+
+int KyraEngine_HoF::getInventoryItemSlot(uint16 item) {
+ for (int i = 0; i < 20; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ return i;
+ }
+ return -1;
+}
+
+int KyraEngine_HoF::findFreeVisibleInventorySlot() {
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == 0xFFFF)
+ return i;
+ }
+ return -1;
+}
+
+void KyraEngine_HoF::removeSlotFromInventory(int slot) {
+ _mainCharacter.inventory[slot] = 0xFFFF;
+ if (slot < 10) {
+ _screen->hideMouse();
+ clearInventorySlot(slot, 0);
+ _screen->showMouse();
+ }
+}
+
+bool KyraEngine_HoF::checkInventoryItemExchange(uint16 handItem, int slot) {
+ bool removeItem = false;
+ uint16 newItem = 0xFFFF;
+
+ uint16 invItem = _mainCharacter.inventory[slot];
+
+ for (const uint16 *table = _itemMagicTable; *table != 0xFFFF; table += 4) {
+ if (table[0] != handItem || table[1] != invItem)
+ continue;
+
+ if (table[3] == 0xFFFF)
+ continue;
+
+ removeItem = (table[3] == 1);
+ newItem = table[2];
+
+ snd_playSoundEffect(0x68);
+ _mainCharacter.inventory[slot] = newItem;
+ _screen->hideMouse();
+ clearInventorySlot(slot, 0);
+ drawInventoryShape(0, newItem, slot);
+
+ if (removeItem)
+ removeHandItem();
+
+ _screen->showMouse();
+
+ if (_lang != 1)
+ updateCommandLineEx(newItem+54, 0x2E, 0xD6);
+
+ return true;
+ }
+
+ return false;
+}
+
+void KyraEngine_HoF::drawInventoryShape(int page, uint16 item, int slot) {
+ _screen->drawShape(page, getShapePtr(item+64), _inventoryX[slot], _inventoryY[slot], 0, 0);
+ _screen->updateScreen();
+}
+
+void KyraEngine_HoF::clearInventorySlot(int slot, int page) {
+ _screen->drawShape(page, getShapePtr(240+slot), _inventoryX[slot], _inventoryY[slot], 0, 0);
+ _screen->updateScreen();
+}
+
+void KyraEngine_HoF::redrawInventory(int page) {
+ int pageBackUp = _screen->_curPage;
+ _screen->_curPage = page;
+
+ const uint16 *inventory = _mainCharacter.inventory;
+ _screen->hideMouse();
+ for (int i = 0; i < 10; ++i) {
+ clearInventorySlot(i, page);
+ if (inventory[i] != 0xFFFF) {
+ _screen->drawShape(page, getShapePtr(inventory[i]+64), _inventoryX[i], _inventoryY[i], 0, 0);
+ drawInventoryShape(page, inventory[i], i);
+ }
+ }
+ _screen->showMouse();
+ _screen->updateScreen();
+
+ _screen->_curPage = pageBackUp;
+}
+
+void KyraEngine_HoF::scrollInventoryWheel() {
+ WSAMovieV2 movie(this, _screen);
+ movie.open("INVWHEEL.WSA", 0, 0);
+ int frames = movie.opened() ? movie.frames() : 6;
+ memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000);
+ uint8 overlay[0x100];
+ _screen->generateOverlay(_screen->getPalette(0), overlay, 0, 50);
+ _screen->hideMouse();
+ _screen->copyRegion(0x46, 0x90, 0x46, 0x79, 0x71, 0x17, 0, 2, Screen::CR_NO_P_CHECK);
+ _screen->showMouse();
+ snd_playSoundEffect(0x25);
+
+ movie.setDrawPage(0);
+ movie.setX(0);
+ movie.setY(0);
+
+ bool breakFlag = false;
+ for (int i = 0; i <= 6 && !breakFlag; ++i) {
+ if (movie.opened()) {
+ _screen->hideMouse();
+ movie.displayFrame(i % frames, 0, 0);
+ _screen->showMouse();
+ _screen->updateScreen();
+ }
+
+ uint32 endTime = _system->getMillis() + _tickLength;
+
+ int y = (i * 981) >> 8;
+ if (y >= 23 || i == 6) {
+ y = 23;
+ breakFlag = true;
+ }
+
+ _screen->applyOverlay(0x46, 0x79, 0x71, 0x17, 2, overlay);
+ _screen->copyRegion(0x46, y+0x79, 0x46, 0x90, 0x71, 0x2E, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+
+ delayUntil(endTime);
+ }
+
+ _screen->copyBlockToPage(2, 0, 0, 320, 200, _screenBuffer);
+ movie.close();
+}
+
+// spellbook specific code
+
+int KyraEngine_HoF::bookButton(Button *button) {
+ if (!queryGameFlag(1)) {
+ objectChat(getTableString(0xEB, _cCodeBuffer, 1), 0, 0x83, 0xEB);
+ return 0;
+ }
+
+ if (!_screen->isMouseVisible())
+ return 0;
+
+ if (queryGameFlag(0xE5)) {
+ snd_playSoundEffect(0x0D);
+ return 0;
+ }
+
+ if (_itemInHand == 72) {
+ if (!queryGameFlag(0xE2)) {
+ _bookMaxPage += 2;
+ removeHandItem();
+ snd_playSoundEffect(0x6C);
+ setGameFlag(0xE2);
+ }
+
+ if (!queryGameFlag(0x18A) && queryGameFlag(0x170)) {
+ _bookMaxPage += 2;
+ removeHandItem();
+ snd_playSoundEffect(0x6C);
+ setGameFlag(0x18A);
+ }
+
+ return 0;
+ }
+
+ if (_handItemSet != -1) {
+ snd_playSoundEffect(0x0D);
+ return 0;
+ }
+
+ _screen->hideMouse();
+ showMessage(0, 0xCF);
+ displayInvWsaLastFrame();
+ _bookNewPage = _bookCurPage;
+
+ if (_screenBuffer) {
+ _screen->hideMouse();
+ memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000);
+ _screen->showMouse();
+ }
+
+ memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
+ _screen->fadeToBlack(7, &_updateFunctor);
+ _res->loadFileToBuf("_BOOK.COL", _screen->getPalette(0), 768);
+ loadBookBkgd();
+ showBookPage();
+ _screen->copyRegion(0, 0, 0, 0, 0x140, 0xC8, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+
+ int oldItemInHand = _itemInHand;
+ removeHandItem();
+ _screen->fadePalette(_screen->getPalette(0), 7);
+ _screen->showMouse();
+
+ bookLoop();
+
+ _screen->fadeToBlack(7);
+ _screen->hideMouse();
+ setHandItem(oldItemInHand);
+ updateMouse();
+ restorePage3();
+
+ if (_screenBuffer) {
+ _screen->hideMouse();
+ _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer);
+ _screen->showMouse();
+ }
+
+ setHandItem(_itemInHand);
+ memcpy(_screen->getPalette(0), _screen->getPalette(2), 768);
+ _screen->fadePalette(_screen->getPalette(0), 7, &_updateFunctor);
+ _screen->showMouse();
+
+ if (!queryGameFlag(4) && !queryGameFlag(0xB8)) {
+ objectChat(getTableString(0xEC, _cCodeBuffer, 1), 0, 0x83, 0xEC);
+ objectChat(getTableString(0xED, _cCodeBuffer, 1), 0, 0x83, 0xED);
+ objectChat(getTableString(0xEE, _cCodeBuffer, 1), 0, 0x83, 0xEE);
+ objectChat(getTableString(0xEF, _cCodeBuffer, 1), 0, 0x83, 0xEF);
+ setGameFlag(4);
+ }
+
+ return 0;
+}
+
+void KyraEngine_HoF::loadBookBkgd() {
+ char filename[16];
+
+ if (_flags.isTalkie)
+ strcpy(filename, (_bookBkgd == 0) ? "_XBOOKD.CPS" : "_XBOOKC.CPS");
+ else
+ strcpy(filename, (_bookBkgd == 0) ? "_BOOKD.CPS" : "_BOOKC.CPS");
+
+ _bookBkgd ^= 1;
+
+ if (_flags.isTalkie) {
+ if (!_bookCurPage)
+ strcpy(filename, "_XBOOKB.CPS");
+ if (_bookCurPage == _bookMaxPage)
+ strcpy(filename, "_XBOOKA.CPS");
+
+ switch (_lang) {
+ case 0:
+ filename[1] = 'E';
+ break;
+
+ case 1:
+ filename[1] = 'F';
+ break;
+
+ case 2:
+ filename[1] = 'G';
+ break;
+
+ default:
+ warning("loadBookBkgd unsupported language");
+ filename[1] = 'E';
+ break;
+ }
+ } else {
+ if (!_bookCurPage)
+ strcpy(filename, "_BOOKB.CPS");
+ if (_bookCurPage == _bookMaxPage)
+ strcpy(filename, "_BOOKA.CPS");
+ }
+
+ _screen->loadBitmap(filename, 3, 3, 0);
+}
+
+void KyraEngine_HoF::showBookPage() {
+ char filename[16];
+
+ sprintf(filename, "PAGE%.01X.", _bookCurPage);
+ strcat(filename, _languageExtension[_lang]);
+ uint8 *leftPage = _res->fileData(filename, 0);
+ int leftPageY = _bookPageYOffset[_bookCurPage];
+
+ sprintf(filename, "PAGE%.01X.", _bookCurPage+1);
+ strcat(filename, _languageExtension[_lang]);
+ uint8 *rightPage = (_bookCurPage != _bookMaxPage) ? _res->fileData(filename, 0) : 0;
+ int rightPageY = _bookPageYOffset[_bookCurPage+1];
+
+ _screen->hideMouse();
+ if (leftPage) {
+ bookDecodeText(leftPage);
+ bookPrintText(2, leftPage, 20, leftPageY+20, 0x31);
+ delete [] leftPage;
+ }
+
+ if (rightPage) {
+ bookDecodeText(rightPage);
+ bookPrintText(2, rightPage, 176, rightPageY+20, 0x31);
+ delete [] rightPage;
+ }
+ _screen->showMouse();
+}
+
+void KyraEngine_HoF::bookLoop() {
+ Button bookButtons[5];
+
+ GUI_V2_BUTTON(bookButtons[0], 0x24, 0, 0, 1, 1, 1, 0x4487, 0, 0x82, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ bookButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage);
+ GUI_V2_BUTTON(bookButtons[1], 0x25, 0, 0, 1, 1, 1, 0x4487, 0, 0xB1, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ bookButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage);
+ GUI_V2_BUTTON(bookButtons[2], 0x26, 0, 0, 1, 1, 1, 0x4487, 0, 0x8F, 0xBE, 0x21, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ bookButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookClose);
+ GUI_V2_BUTTON(bookButtons[3], 0x27, 0, 0, 1, 1, 1, 0x4487, 0, 0x08, 0x08, 0x90, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ bookButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage);
+ GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage);
+
+ Button *buttonList = 0;
+
+ for (uint i = 0; i < ARRAYSIZE(bookButtons); ++i)
+ buttonList = _gui->addButtonToList(buttonList, &bookButtons[i]);
+
+ showBookPage();
+ _bookShown = true;
+ while (_bookShown && !_quitFlag) {
+ checkInput(buttonList);
+ removeInputTop();
+
+ if (_bookCurPage != _bookNewPage) {
+ _bookCurPage = _bookNewPage;
+ _screen->clearPage(2);
+ loadBookBkgd();
+ showBookPage();
+ snd_playSoundEffect(0x64);
+ _screen->hideMouse();
+ _screen->copyRegion(0, 0, 0, 0, 0x140, 0xC8, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ _screen->showMouse();
+ }
+ }
+ _screen->clearPage(2);
+}
+
+void KyraEngine_HoF::bookDecodeText(uint8 *str) {
+ uint8 *dst = str, *op = str;
+ while (*op != 0x1A) {
+ while (*op != 0x1A && *op != 0x0D)
+ *dst++ = *op++;
+
+ if (*op == 0x1A)
+ break;
+
+ op += 2;
+ *dst++ = 0x0D;
+ }
+ *dst = 0;
+}
+
+void KyraEngine_HoF::bookPrintText(int dstPage, const uint8 *str, int x, int y, uint8 color) {
+ int curPageBackUp = _screen->_curPage;
+ _screen->_curPage = dstPage;
+
+ _screen->setTextColor(_bookTextColorMap, 0, 3);
+ Screen::FontId oldFont = _screen->setFont(Screen::FID_BOOKFONT_FNT);
+ _screen->_charWidth = -2;
+
+ _screen->hideMouse();
+ _screen->printText((const char*)str, x, y, color, (_flags.lang == Common::JA_JPN) ? 0xf6 : 0);
+ _screen->showMouse();
+
+ _screen->_charWidth = 0;
+ _screen->setFont(oldFont);
+ _screen->_curPage = curPageBackUp;
+}
+
+int KyraEngine_HoF::bookPrevPage(Button *button) {
+ _bookNewPage = MAX<int>(_bookCurPage-2, 0);
+ return 0;
+}
+
+int KyraEngine_HoF::bookNextPage(Button *button) {
+ _bookNewPage = MIN<int>(_bookCurPage+2, _bookMaxPage);
+ return 0;
+}
+
+int KyraEngine_HoF::bookClose(Button *button) {
+ _bookShown = false;
+ return 0;
+}
+
+// cauldron specific code
+
+int KyraEngine_HoF::cauldronClearButton(Button *button) {
+ if (!queryGameFlag(2)) {
+ updateCharFacing();
+ objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
+ return 0;
+ }
+
+ if (queryGameFlag(0xE4)) {
+ snd_playSoundEffect(0x0D);
+ return 0;
+ }
+
+ _screen->hideMouse();
+ displayInvWsaLastFrame();
+ snd_playSoundEffect(0x25);
+ loadInvWsa("PULL.WSA", 1, 6, 0, -1, -1, 1);
+ loadInvWsa("CAULD00.WSA", 1, 7, 0, 0xD4, 0x0F, 1);
+ showMessage(0, 0xCF);
+ setCauldronState(0, 0);
+ clearCauldronTable();
+ snd_playSoundEffect(0x57);
+ loadInvWsa("CAULDFIL.WSA", 1, 7, 0, -1, -1, 1);
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_HoF::cauldronButton(Button *button) {
+ if (!queryGameFlag(2)) {
+ objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
+ return 0;
+ }
+
+ if (!_screen->isMouseVisible() || _handItemSet < -1)
+ return 0;
+
+ if (queryGameFlag(0xE4)) {
+ snd_playSoundEffect(0x0D);
+ return 0;
+ }
+
+ updateCharFacing();
+
+ for (int i = 0; _cauldronProtectedItems[i] != -1; ++i) {
+ if (_itemInHand == _cauldronProtectedItems[i]) {
+ objectChat(getTableString(0xF1, _cCodeBuffer, 1), 0, 0x83, 0xF1);
+ return 0;
+ }
+ }
+
+ if (_itemInHand == -1) {
+ listItemsInCauldron();
+ return 0;
+ }
+
+ for (int i = 0; _cauldronBowlTable[i] != -1; i += 2) {
+ if (_itemInHand == _cauldronBowlTable[i]) {
+ addFrontCauldronTable(_itemInHand);
+ setHandItem(_cauldronBowlTable[i+1]);
+ if (!updateCauldron()) {
+ _cauldronState = 0;
+ cauldronRndPaletteFade();
+ }
+ return 0;
+ }
+ }
+
+ if (_itemInHand == 18) {
+ const int16 *magicTable = (_mainCharacter.sceneId == 77) ? _cauldronMagicTableScene77 : _cauldronMagicTable;
+ while (magicTable[0] != -1) {
+ if (_cauldronState == magicTable[0]) {
+ setHandItem(magicTable[1]);
+ snd_playSoundEffect(0x6C);
+ ++_cauldronUseCount;
+ if (_cauldronStateTable[_cauldronState] <= _cauldronUseCount && _cauldronUseCount) {
+ showMessage(0, 0xCF);
+ setCauldronState(0, true);
+ clearCauldronTable();
+ }
+ return 0;
+ }
+ magicTable += 2;
+ }
+ } else if (_itemInHand >= 0) {
+ int item = _itemInHand;
+ cauldronItemAnim(item);
+ addFrontCauldronTable(item);
+ if (!updateCauldron()) {
+ _cauldronState = 0;
+ cauldronRndPaletteFade();
+ }
+ }
+
+ return 0;
+}
+
+#pragma mark -
+
+int GUI_HoF::optionsButton(Button *button) {
+ _restartGame = false;
+ _reloadTemporarySave = false;
+
+ _screen->hideMouse();
+ updateButton(&_vm->_inventoryButtons[0]);
+ _screen->showMouse();
+
+ if (!_screen->isMouseVisible() && button)
+ return 0;
+
+ _vm->showMessage(0, 0xCF);
+
+ if (_vm->_handItemSet < -1) {
+ _vm->_handItemSet = -1;
+ _screen->hideMouse();
+ _screen->setMouseCursor(1, 1, _vm->getShapePtr(0));
+ _screen->showMouse();
+ return 0;
+ }
+
+ int oldHandItem = _vm->_itemInHand;
+ _screen->setMouseCursor(0, 0, _vm->getShapePtr(0));
+ _vm->displayInvWsaLastFrame();
+ //XXX
+ _displayMenu = true;
+
+ for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
+ _menuButtons[i].data0Val1 = _menuButtons[i].data1Val1 = _menuButtons[i].data2Val1 = 4;
+ _menuButtons[i].data0Callback = _redrawShadedButtonFunctor;
+ _menuButtons[i].data1Callback = _menuButtons[i].data2Callback = _redrawButtonFunctor;
+ }
+
+ initMenuLayout(_mainMenu);
+ initMenuLayout(_gameOptions);
+ initMenuLayout(_audioOptions);
+ initMenuLayout(_choiceMenu);
+ _loadMenu.numberOfItems = 6;
+ initMenuLayout(_loadMenu);
+ initMenuLayout(_saveMenu);
+ initMenuLayout(_savenameMenu);
+ initMenuLayout(_deathMenu);
+
+ _currentMenu = &_mainMenu;
+
+ if (_vm->_menuDirectlyToLoad) {
+ backUpPage1(_vm->_screenBuffer);
+ setupPalette();
+
+ _loadedSave = false;
+
+ loadMenu(0);
+
+ if (_loadedSave) {
+ if (_restartGame)
+ _vm->_itemInHand = -1;
+ } else {
+ restorePage1(_vm->_screenBuffer);
+ restorePalette();
+ }
+
+ resetState(-1);
+ _vm->_menuDirectlyToLoad = false;
+ return 0;
+ }
+
+ if (!button) {
+ _currentMenu = &_deathMenu;
+ _isDeathMenu = true;
+ } else {
+ _isDeathMenu = false;
+ }
+
+ backUpPage1(_vm->_screenBuffer);
+ setupPalette();
+ initMenu(*_currentMenu);
+ _madeSave = false;
+ _loadedSave = false;
+ _vm->_itemInHand = -1;
+ updateAllMenuButtons();
+
+ if (_isDeathMenu) {
+ while (!_screen->isMouseVisible())
+ _screen->showMouse();
+ }
+
+ while (_displayMenu) {
+ processHighlights(*_currentMenu, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ if (_vm->_runFlag && !_loadedSave && !_madeSave) {
+ restorePalette();
+ restorePage1(_vm->_screenBuffer);
+ }
+
+ if (_vm->_runFlag)
+ updateMenuButton(&_vm->_inventoryButtons[0]);
+
+ resetState(oldHandItem);
+
+ if (!_loadedSave && _reloadTemporarySave) {
+ _vm->_unkSceneScreenFlag1 = true;
+ _vm->loadGame(_vm->getSavegameFilename(999));
+ _vm->_saveFileMan->removeSavefile(_vm->getSavegameFilename(999));
+ _vm->_unkSceneScreenFlag1 = false;
+ }
+
+ return 0;
+}
+
+#pragma mark -
+
+void GUI_HoF::setupPalette() {
+ memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
+
+ uint8 *palette = _screen->getPalette(0);
+ for (int i = 0; i < 768; ++i)
+ palette[i] >>= 1;
+
+ static const uint8 guiPal[] = { 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFc, 0xFD, 0xFE };
+
+ for (uint i = 0; i < ARRAYSIZE(guiPal); ++i)
+ memcpy(_screen->getPalette(0)+guiPal[i]*3, _screen->getPalette(1)+guiPal[i]*3, 3);
+
+ if (_isDeathMenu)
+ _screen->fadePalette(_screen->getPalette(0), 0x64);
+ else
+ _screen->setScreenPalette(_screen->getPalette(0));
+}
+
+void GUI_HoF::restorePalette() {
+ memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
+ _screen->setScreenPalette(_screen->getPalette(0));
+}
+
+void GUI_HoF::resetState(int item) {
+ _vm->_timer->resetNextRun();
+ _vm->setNextIdleAnimTimer();
+ _isDeathMenu = false;
+ if (!_loadedSave) {
+ _vm->setHandItem(item);
+ } else {
+ _vm->setHandItem(_vm->_itemInHand);
+ _vm->setTimer1DelaySecs(7);
+ _vm->_shownMessage = " ";
+ _vm->_fadeMessagePalette = false;
+ }
+ _buttonListChanged = true;
+}
+
+void GUI_HoF::drawSliderBar(int slider, const uint8 *shape) {
+ const int menuX = _audioOptions.x;
+ const int menuY = _audioOptions.y;
+ int x = menuX + _sliderBarsPosition[slider*2+0] + 10;
+ int y = menuY + _sliderBarsPosition[slider*2+1];
+
+ int position = 0;
+ if (_vm->gameFlags().isTalkie) {
+ position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+ } else {
+ if (slider < 2)
+ position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+ else if (slider == 2)
+ position = (_vm->_configWalkspeed == 3) ? 97 : 2;
+ else if (slider == 3)
+ position = _vm->_configTextspeed;
+ }
+
+ position = MAX(2, position);
+ position = MIN(97, position);
+ _screen->drawShape(0, shape, x+position, y, 0, 0);
+}
+
+#pragma mark -
+
+int GUI_HoF::quitGame(Button *caller) {
+ updateMenuButton(caller);
+ if (choiceDialog(_vm->gameFlags().isTalkie ? 0xF : 0x17, 1)) {
+ _displayMenu = false;
+ _vm->_runFlag = false;
+ _vm->_sound->beginFadeOut();
+ _screen->fadeToBlack();
+ _screen->clearCurPage();
+ }
+
+ if (_vm->_runFlag) {
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ }
+
+ return 0;
+}
+
+int GUI_HoF::audioOptions(Button *caller) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ initMenu(_audioOptions);
+ const int menuX = _audioOptions.x;
+ const int menuY = _audioOptions.y;
+ const int maxButton = 3; // 2 if voc is disabled
+
+ for (int i = 0; i < maxButton; ++i) {
+ int x = menuX + _sliderBarsPosition[i*2+0];
+ int y = menuY + _sliderBarsPosition[i*2+1];
+ _screen->drawShape(0, _vm->_buttonShapes[16], x, y, 0, 0);
+ drawSliderBar(i, _vm->_buttonShapes[17]);
+ _sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[0][i].x = x;
+ _sliderButtons[0][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
+ _sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[2][i].x = x + 10;
+ _sliderButtons[2][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
+ _sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[1][i].x = x + 120;
+ _sliderButtons[1][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
+ }
+
+ _isOptionsMenu = true;
+ updateAllMenuButtons();
+ bool speechEnabled = _vm->speechEnabled();
+ while (_isOptionsMenu) {
+ processHighlights(_audioOptions, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine::kVolumeSpeech) == 2)) {
+ _vm->_configVoice = 0;
+ choiceDialog(0x1D, 0);
+ }
+
+ _vm->writeSettings();
+
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ return 0;
+}
+
+int GUI_HoF::gameOptions(Button *caller) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ initMenu(_gameOptions);
+ _isOptionsMenu = true;
+
+ const int menuX = _gameOptions.x;
+ const int menuY = _gameOptions.y;
+
+ for (int i = 0; i < 4; ++i) {
+ int x = menuX + _sliderBarsPosition[i*2+0];
+ int y = menuY + _sliderBarsPosition[i*2+1];
+ _screen->drawShape(0, _vm->_buttonShapes[16], x, y, 0, 0);
+ drawSliderBar(i, _vm->_buttonShapes[17]);
+ _sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[0][i].x = x;
+ _sliderButtons[0][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
+ _sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[2][i].x = x + 10;
+ _sliderButtons[2][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
+ _sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[1][i].x = x + 120;
+ _sliderButtons[1][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
+ }
+
+ while (_isOptionsMenu) {
+ processHighlights(_gameOptions, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+
+ _vm->writeSettings();
+
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+
+ return 0;
+}
+
+int GUI_HoF::gameOptionsTalkie(Button *caller) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ bool textEnabled = _vm->textEnabled();
+ int lang = _vm->_lang;
+
+ setupOptionsButtons();
+ initMenu(_gameOptions);
+ _isOptionsMenu = true;
+
+ while (_isOptionsMenu) {
+ processHighlights(_gameOptions, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+
+ if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
+ _vm->_configVoice = 1;
+ _vm->setVolume(KyraEngine::kVolumeSpeech, 75);
+ choiceDialog(0x1E, 0);
+ }
+
+ if (_vm->_lang != lang) {
+ _reloadTemporarySave = true;
+ _vm->saveGame(_vm->getSavegameFilename(999), "Temporary Kyrandia 2 Savegame");
+ _vm->loadCCodeBuffer("C_CODE.XXX");
+ if (_vm->_flags.isTalkie)
+ _vm->loadOptionsBuffer("OPTIONS.XXX");
+ else
+ _vm->_optionsBuffer = _vm->_cCodeBuffer;
+ _vm->loadChapterBuffer(_vm->_newChapterFile);
+ _vm->loadNPCScript();
+ _vm->setupLangButtonShapes();
+ }
+
+ _vm->writeSettings();
+
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ return 0;
+}
+
+int GUI_HoF::changeLanguage(Button *caller) {
+ updateMenuButton(caller);
+ ++_vm->_lang;
+ _vm->_lang %= 3;
+ setupOptionsButtons();
+ renewHighlight(_gameOptions);
+ return 0;
+}
+
+void GUI_HoF::setupOptionsButtons() {
+ if (_vm->_configWalkspeed == 3)
+ _gameOptions.item[0].itemId = 28;
+ else
+ _gameOptions.item[0].itemId = 27;
+
+ if (_vm->textEnabled())
+ _gameOptions.item[2].itemId = 18;
+ else
+ _gameOptions.item[2].itemId = 17;
+
+ switch (_vm->_lang) {
+ case 0:
+ _gameOptions.item[1].itemId = 31;
+ break;
+
+ case 1:
+ _gameOptions.item[1].itemId = 32;
+ break;
+
+ case 2:
+ _gameOptions.item[1].itemId = 33;
+ break;
+
+ default:
+ break;
+ }
+}
+
+int GUI_HoF::sliderHandler(Button *caller) {
+ int button = 0;
+ if (caller->index >= 24 && caller->index <= 27)
+ button = caller->index - 24;
+ else if (caller->index >= 28 && caller->index <= 31)
+ button = caller->index - 28;
+ else
+ button = caller->index - 32;
+
+ assert(button >= 0 && button <= 3);
+
+ int oldVolume = 0;
+
+ if (_vm->gameFlags().isTalkie) {
+ oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ } else {
+ if (button < 2)
+ oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ else if (button == 2)
+ oldVolume = (_vm->_configWalkspeed == 3) ? 97 : 2;
+ else if (button == 3)
+ oldVolume = _vm->_configTextspeed;
+ }
+
+ int newVolume = oldVolume;
+
+ if (caller->index >= 24 && caller->index <= 27)
+ newVolume -= 10;
+ else if (caller->index >= 28 && caller->index <= 31)
+ newVolume += 10;
+ else
+ newVolume = _vm->_mouseX - caller->x - 7;
+
+ newVolume = MAX(2, newVolume);
+ newVolume = MIN(97, newVolume);
+
+ if (newVolume == oldVolume)
+ return 0;
+
+ int lastMusicCommand = -1;
+ bool playSoundEffect = false;
+
+ drawSliderBar(button, _vm->_buttonShapes[18]);
+
+ if (_vm->gameFlags().isTalkie) {
+ if (button == 2) {
+ if (_vm->textEnabled())
+ _vm->_configVoice = 2;
+ else
+ _vm->_configVoice = 1;
+ }
+
+ _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+
+ switch (button) {
+ case 0:
+ lastMusicCommand = _vm->_lastMusicCommand;
+ break;
+
+ case 1:
+ playSoundEffect = true;
+ break;
+
+ case 2:
+ _vm->playVoice(90, 28);
+ break;
+
+ default:
+ return 0;
+ }
+ } else {
+ if (button < 2) {
+ _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+ if (button == 0)
+ lastMusicCommand = _vm->_lastMusicCommand;
+ else
+ playSoundEffect = true;
+ } else if (button == 2) {
+ _vm->_configWalkspeed = (newVolume > 48) ? 3 : 5;
+ _vm->setWalkspeed(_vm->_configWalkspeed);
+ } else if (button == 3) {
+ _vm->_configTextspeed = newVolume;
+ }
+ }
+
+ drawSliderBar(button, _vm->_buttonShapes[17]);
+ if (playSoundEffect)
+ _vm->snd_playSoundEffect(0x18);
+ else if (lastMusicCommand >= 0)
+ _vm->snd_playWanderScoreViaMap(lastMusicCommand, 1);
+
+ _screen->updateScreen();
+ return 0;
+}
+
+int GUI_HoF::loadMenu(Button *caller) {
+ updateSaveList();
+
+ if (!_vm->_menuDirectlyToLoad) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ }
+
+ _savegameOffset = 0;
+ setupSavegameNames(_loadMenu, 5);
+ initMenu(_loadMenu);
+ _isLoadMenu = true;
+ _noLoadProcess = false;
+ _vm->_gameToLoad = -1;
+ updateAllMenuButtons();
+
+ _screen->updateScreen();
+ while (_isLoadMenu) {
+ processHighlights(_loadMenu, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ if (_noLoadProcess) {
+ if (!_vm->_menuDirectlyToLoad) {
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ }
+ } else if (_vm->_gameToLoad >= 0) {
+ restorePage1(_vm->_screenBuffer);
+ restorePalette();
+ _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
+ if (_vm->_gameToLoad == 0) {
+ _restartGame = true;
+ for (int i = 0; i < 23; ++i)
+ _vm->resetCauldronStateTable(i);
+ _vm->runStartScript(1, 1);
+ }
+ _displayMenu = false;
+ _loadedSave = true;
+ }
+
+ return 0;
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/gui_hof.h b/engines/kyra/gui_hof.h
new file mode 100644
index 0000000000..f64336a8f6
--- /dev/null
+++ b/engines/kyra/gui_hof.h
@@ -0,0 +1,86 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA_GUI_HOF_H
+#define KYRA_GUI_HOF_H
+
+#include "kyra/gui_v2.h"
+
+namespace Kyra {
+
+class KyraEngine_HoF;
+class Screen_HoF;
+
+class GUI_HoF : public GUI_v2 {
+friend class KyraEngine_HoF;
+public:
+ GUI_HoF(KyraEngine_HoF *engine);
+
+ void initStaticData();
+
+ int optionsButton(Button *button);
+private:
+ const char *getMenuTitle(const Menu &menu);
+ const char *getMenuItemTitle(const MenuItem &menuItem);
+ const char *getMenuItemLabel(const MenuItem &menuItem);
+
+ uint8 defaultColor1() const { return 0xCF; }
+ uint8 defaultColor2() const { return 0xF8; }
+
+ uint8 textFieldColor1() const { return 0xFD; }
+ uint8 textFieldColor2() const { return 0xFA; }
+ uint8 textFieldColor3() const { return 0xFE; }
+
+ void setupPalette();
+ void restorePalette();
+
+ void resetState(int item);
+
+ char *getTableString(int id);
+
+ KyraEngine_HoF *_vm;
+ Screen_HoF *_screen;
+
+ int quitGame(Button *caller);
+ int loadMenu(Button *caller);
+ int audioOptions(Button *caller);
+ int gameOptions(Button *caller);
+ int gameOptionsTalkie(Button *caller);
+
+ int changeLanguage(Button *caller);
+
+ void setupOptionsButtons();
+
+ int sliderHandler(Button *caller);
+ void drawSliderBar(int slider, const uint8 *shape);
+
+ static const uint16 _menuStringsTalkie[];
+ static const uint16 _menuStringsOther[];
+};
+
+} // end of namespace Kyra
+
+#endif
+
diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp
new file mode 100644
index 0000000000..8d27938aff
--- /dev/null
+++ b/engines/kyra/gui_mr.cpp
@@ -0,0 +1,1223 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/gui_mr.h"
+#include "kyra/kyra_mr.h"
+#include "kyra/text_mr.h"
+#include "kyra/wsamovie.h"
+#include "kyra/resource.h"
+#include "kyra/sound.h"
+#include "kyra/timer.h"
+
+#include "common/savefile.h"
+
+namespace Kyra {
+
+void KyraEngine_MR::loadButtonShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadButtonShapes()");
+ _res->exists("BUTTONS.SHP", true);
+ uint8 *data = _res->fileData("BUTTONS.SHP", 0);
+ assert(data);
+ for (int i = 0; i <= 10; ++i)
+ addShapeToPool(data, 0x1C7+i, i);
+ delete[] data;
+
+ Button::Callback callback1 = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::callbackButton1);
+ Button::Callback callback2 = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::callbackButton2);
+ Button::Callback callback3 = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::callbackButton3);
+
+ _gui->getScrollUpButton()->data0Callback = callback1;
+ _gui->getScrollUpButton()->data1Callback = callback2;
+ _gui->getScrollUpButton()->data2Callback = callback3;
+ _gui->getScrollDownButton()->data0Callback = callback1;
+ _gui->getScrollDownButton()->data1Callback = callback2;
+ _gui->getScrollDownButton()->data2Callback = callback3;
+
+ _mainButtonData[0].data0Callback = callback1;
+ _mainButtonData[0].data1Callback = callback2;
+ _mainButtonData[0].data2Callback = callback3;
+}
+
+int KyraEngine_MR::callbackButton1(Button *button) {
+ const uint8 *shapePtr = 0;
+ if (button->index == 1)
+ shapePtr = getShapePtr(0x1CD);
+ else if (button->index == 22)
+ shapePtr = getShapePtr(0x1C7);
+ else if (button->index == 23)
+ shapePtr = getShapePtr(0x1CA);
+
+ if (shapePtr)
+ _screen->drawShape(0, shapePtr, button->x, button->y, 0, 0, 0);
+
+ return 0;
+}
+
+int KyraEngine_MR::callbackButton2(Button *button) {
+ const uint8 *shapePtr = 0;
+ if (button->index == 1)
+ shapePtr = getShapePtr(0x1CE);
+ else if (button->index == 22)
+ shapePtr = getShapePtr(0x1C9);
+ else if (button->index == 23)
+ shapePtr = getShapePtr(0x1CC);
+
+ if (shapePtr)
+ _screen->drawShape(0, shapePtr, button->x, button->y, 0, 0, 0);
+
+ return 0;
+}
+
+int KyraEngine_MR::callbackButton3(Button *button) {
+ const uint8 *shapePtr = 0;
+ if (button->index == 1)
+ shapePtr = getShapePtr(0x1CE);
+ else if (button->index == 22)
+ shapePtr = getShapePtr(0x1C8);
+ else if (button->index == 23)
+ shapePtr = getShapePtr(0x1CB);
+
+ if (shapePtr)
+ _screen->drawShape(0, shapePtr, button->x, button->y, 0, 0, 0);
+
+ return 0;
+}
+
+void KyraEngine_MR::showMessage(const char *string, uint8 c0, uint8 c1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showMessage('%s', %d, %d)", string, c0, c1);
+ _shownMessage = string;
+ _screen->hideMouse();
+
+ restoreCommandLine();
+ _restoreCommandLine = false;
+
+ if (string) {
+ int x = _text->getCenterStringX(string, 0, 320);
+ int pageBackUp = _screen->_curPage;
+ _screen->_curPage = 0;
+ _text->printText(string, x, _commandLineY, c0, c1, 0);
+ _screen->_curPage = pageBackUp;
+ _screen->updateScreen();
+ setCommandLineRestoreTimer(7);
+ }
+
+ _screen->showMouse();
+}
+
+void KyraEngine_MR::showMessageFromCCode(int string, uint8 c0, int) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showMessageFromCCode(%d, %d, -)", string, c0);
+ showMessage((const char*)getTableEntry(_cCodeFile, string), c0, 0xF0);
+}
+
+void KyraEngine_MR::updateItemCommand(int item, int str, uint8 c0) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateItemCommand(%d, %d, %d)", item, str, c0);
+ char buffer[100];
+ char *src = (char*)getTableEntry(_itemFile, item);
+
+ while (*src != ' ')
+ ++src;
+ ++src;
+
+ *src = toupper(*src);
+
+ strcpy(buffer, src);
+ strcat(buffer, " ");
+ strcat(buffer, (const char*)getTableEntry(_cCodeFile, str));
+
+ showMessage(buffer, c0, 0xF0);
+}
+
+void KyraEngine_MR::updateCommandLine() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCommandLine()");
+ if (_restoreCommandLine) {
+ restoreCommandLine();
+ _restoreCommandLine = false;
+ }
+}
+
+void KyraEngine_MR::restoreCommandLine() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::restoreCommandLine()");
+ int y = _inventoryState ? 144 : 188;
+ _screen->copyBlockToPage(0, 0, y, 320, 12, _interfaceCommandLine);
+}
+
+void KyraEngine_MR::updateCLState() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCLState()");
+ if (_inventoryState)
+ _commandLineY = 145;
+ else
+ _commandLineY = 189;
+}
+
+void KyraEngine_MR::showInventory() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showInventory()");
+ if (!_screen->isMouseVisible())
+ return;
+ if (queryGameFlag(3))
+ return;
+
+ _screen->copyBlockToPage(3, 0, 0, 320, 56, _interface);
+ drawMalcolmsMoodText();
+
+ _inventoryState = true;
+ updateCLState();
+
+ redrawInventory(30);
+ drawMalcolmsMoodPointer(-1, 30);
+ drawScore(30, 215, 191);
+
+ if (queryGameFlag(0x97))
+ drawJestersStaff(1, 30);
+
+ _screen->hideMouse();
+
+ if (_itemInHand < 0) {
+ _handItemSet = -1;
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ }
+
+ _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
+
+ if (_inventoryScrollSpeed == -1) {
+ uint32 endTime = _system->getMillis() + _tickLength * 15;
+ int times = 0;
+ while (_system->getMillis() < endTime) {
+ _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
+ ++times;
+ }
+
+ times = MAX(times, 1);
+
+ int speed = 60 / times;
+ if (speed <= 1)
+ _inventoryScrollSpeed = 1;
+ else if (speed >= 8)
+ _inventoryScrollSpeed = 8;
+ else
+ _inventoryScrollSpeed = speed;
+ }
+
+ int height = 12;
+ int y = 188;
+ int times = 0;
+ uint32 waitTill = _system->getMillis() + _tickLength;
+
+ while (y > 144) {
+ _screen->copyRegion(0, 0, 0, y, 320, height, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+
+ ++times;
+ if (_inventoryScrollSpeed == 1 && times == 3) {
+ while (waitTill > _system->getMillis())
+ _system->delayMillis(10);
+ times = 0;
+ waitTill = _system->getMillis() + _tickLength;
+ }
+
+ height += _inventoryScrollSpeed;
+ y -= _inventoryScrollSpeed;
+ }
+
+ _screen->copyRegion(0, 0, 0, 144, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+
+ initMainButtonList(false);
+
+ restorePage3();
+ _screen->showMouse();
+}
+
+void KyraEngine_MR::hideInventory() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::hideInventory()");
+ if (queryGameFlag(3))
+ return;
+
+ _inventoryState = false;
+ updateCLState();
+ initMainButtonList(true);
+
+ _screen->copyBlockToPage(3, 0, 0, 320, 56, _interface);
+ _screen->hideMouse();
+
+ restorePage3();
+ flagAnimObjsForRefresh();
+ drawAnimObjects();
+ _screen->copyRegion(0, 144, 0, 0, 320, 56, 0, 2, Screen::CR_NO_P_CHECK);
+
+ if (_inventoryScrollSpeed == -1) {
+ uint32 endTime = _system->getMillis() + _tickLength * 15;
+ int times = 0;
+ while (_system->getMillis() < endTime) {
+ _screen->copyRegion(0, 144, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 144, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
+ ++times;
+ }
+
+ times = MAX(times, 1);
+
+ int speed = 60 / times;
+ if (speed <= 1)
+ _inventoryScrollSpeed = 1;
+ else if (speed >= 8)
+ _inventoryScrollSpeed = 8;
+ else
+ _inventoryScrollSpeed = speed;
+ }
+
+ int y = 144;
+ int y2 = 144 + _inventoryScrollSpeed;
+ uint32 waitTill = _system->getMillis() + _tickLength;
+ int times = 0;
+
+ while (y2 < 188) {
+ _screen->copyRegion(0, 0, 0, y2, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, y, 0, y, 320, _inventoryScrollSpeed, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+
+ ++times;
+ if (_inventoryScrollSpeed == 1 && times == 3) {
+ while (waitTill > _system->getMillis())
+ _system->delayMillis(10);
+ times = 0;
+ waitTill = _system->getMillis() + _tickLength;
+ }
+
+ y += _inventoryScrollSpeed;
+ y2 += _inventoryScrollSpeed;
+ }
+
+ _screen->copyRegion(0, 0, 0, 188, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, y, 0, y, 320, 188-y, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->showMouse();
+}
+
+void KyraEngine_MR::drawMalcolmsMoodText() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawMalcolmsMoodText()");
+ static const int stringId[] = { 0x32, 0x37, 0x3C };
+
+ if (queryGameFlag(0x219))
+ return;
+
+ const char *string = (const char*)getTableEntry(_cCodeFile, stringId[_malcolmsMood]);
+
+ Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT);
+ _screen->_charWidth = -2;
+
+ int width = _screen->getTextWidth(string);
+
+ _screen->_charWidth = 0;
+ _screen->setFont(oldFont);
+
+ int pageBackUp = _screen->_curPage;
+ const int x = 280 - (width / 2);
+ int y = 0;
+ if (_inventoryState) {
+ y = 189;
+ _screen->_curPage = 0;
+ } else {
+ y = 45;
+ _screen->_curPage = 2;
+ }
+
+ _screen->hideMouse();
+ _screen->drawShape(_screen->_curPage, getShapePtr(432), 244, 189, 0, 0);
+ _text->printText(string, x, y+1, 0xFF, 0xF0, 0x00);
+ _screen->showMouse();
+ _screen->_curPage = pageBackUp;
+}
+
+void KyraEngine_MR::drawMalcolmsMoodPointer(int frame, int page) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawMalcolmsMoodPointer(%d, %d)", frame, page);
+ static const uint8 stateTable[] = {
+ 1, 6, 11
+ };
+
+ if (frame == -1)
+ frame = stateTable[_malcolmsMood];
+ if (queryGameFlag(0x219))
+ frame = 13;
+
+ if (page == 0) {
+ _invWsa->setX(0);
+ _invWsa->setY(0);
+ _invWsa->setDrawPage(0);
+ _invWsa->displayFrame(frame, 0);
+ _screen->updateScreen();
+ } else if (page == 30) {
+ _invWsa->setX(0);
+ _invWsa->setY(-144);
+ _invWsa->setDrawPage(2);
+ _invWsa->displayFrame(frame, 0);
+ }
+
+ _invWsaFrame = frame;
+}
+
+void KyraEngine_MR::drawJestersStaff(int type, int page) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawJestersStaff(%d, %d)", type, page);
+ int y = 155;
+ if (page == 30) {
+ page = 2;
+ y -= 144;
+ }
+
+ int shape = (type != 0) ? 454 : 453;
+ _screen->drawShape(page, getShapePtr(shape), 217, y, 0, 0);
+}
+
+void KyraEngine_MR::drawScore(int page, int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawScore(%d, %d, %d)", page, x, y);
+ if (page == 30) {
+ page = 2;
+ y -= 144;
+ }
+
+ int shape1 = _score / 100;
+ int shape2 = (_score - shape1*100) / 10;
+ int shape3 = _score % 10;
+
+ _screen->drawShape(page, getShapePtr(shape1+433), x, y, 0, 0);
+ x += 8;
+ _screen->drawShape(page, getShapePtr(shape2+433), x, y, 0, 0);
+ x += 8;
+ _screen->drawShape(page, getShapePtr(shape3+433), x, y, 0, 0);
+}
+
+void KyraEngine_MR::drawScoreCounting(int oldScore, int newScore, int drawOld, const int x) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawScoreCounting(%d, %d, %d, %d)", oldScore, newScore, drawOld, x);
+ int y = 189;
+ if (_inventoryState)
+ y -= 44;
+
+ int old100 = oldScore / 100;
+ int old010 = (oldScore - old100*100) / 10;
+ int old001 = oldScore % 10;
+
+ int new100 = newScore / 100;
+ int new010 = (newScore - new100*100) / 10;
+ int new001 = newScore % 10;
+
+ if (drawOld) {
+ _screen->drawShape(0, getShapePtr(old100+433), x + 0, y, 0, 0);
+ _screen->drawShape(0, getShapePtr(old010+433), x + 8, y, 0, 0);
+ _screen->drawShape(0, getShapePtr(old001+433), x + 16, y, 0, 0);
+ }
+
+ if (old100 != new100)
+ _screen->drawShape(0, getShapePtr(old100+443), x + 0, y, 0, 0);
+
+ if (old010 != new010)
+ _screen->drawShape(0, getShapePtr(old010+443), x + 8, y, 0, 0);
+
+ _screen->drawShape(0, getShapePtr(old001+443), x + 16, y, 0, 0);
+
+ _screen->updateScreen();
+
+ _screen->drawShape(0, getShapePtr(new100+433), x + 0, y, 0, 0);
+ _screen->drawShape(0, getShapePtr(new010+433), x + 8, y, 0, 0);
+ _screen->drawShape(0, getShapePtr(new001+433), x + 16, y, 0, 0);
+}
+
+int KyraEngine_MR::getScoreX(const char *str) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getScoreX('%s')", str);
+ Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT);
+ _screen->_charWidth = -2;
+
+ int width = _screen->getTextWidth(str);
+ int x = 160 + (width / 2) - 32;
+
+ _screen->setFont(oldFont);
+ _screen->_charWidth = 0;
+ return x;
+}
+
+void KyraEngine_MR::redrawInventory(int page) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::redrawInventory(%d)", page);
+ int yOffset = 0;
+
+ if (page == 30) {
+ page = 2;
+ yOffset = -144;
+ }
+
+ int pageBackUp = _screen->_curPage;
+ _screen->_curPage = page;
+ _screen->hideMouse();
+
+ for (int i = 0; i < 10; ++i) {
+ clearInventorySlot(i, page);
+ if (_mainCharacter.inventory[i] != 0xFFFF) {
+ _screen->drawShape(page, getShapePtr(_mainCharacter.inventory[i]+248), _inventoryX[i], _inventoryY[i] + yOffset, 0, 0);
+ drawInventorySlot(page, _mainCharacter.inventory[i], i);
+ }
+ }
+
+ _screen->showMouse();
+ _screen->_curPage = pageBackUp;
+
+ if (page == 0 || page == 1)
+ _screen->updateScreen();
+}
+
+void KyraEngine_MR::clearInventorySlot(int slot, int page) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::clearInventorySlot(%d, %d)", slot, page);
+ int yOffset = 0;
+ if (page == 30) {
+ page = 2;
+ yOffset = -144;
+ }
+
+ _screen->drawShape(page, getShapePtr(slot+422), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0);
+}
+
+void KyraEngine_MR::drawInventorySlot(int page, int item, int slot) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::drawInventorySlot(%d, %d, %d)", page, item, slot);
+ int yOffset = 0;
+ if (page == 30) {
+ page = 2;
+ yOffset = -144;
+ }
+
+ _screen->drawShape(page, getShapePtr(item+248), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0);
+}
+
+int KyraEngine_MR::buttonInventory(Button *button) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::buttonInventory(%p)", (const void*)button);
+ setNextIdleAnimTimer();
+ if (!_enableInventory || !_inventoryState || !_screen->isMouseVisible())
+ return 0;
+
+ const int slot = button->index - 5;
+ const int16 slotItem = (int16)_mainCharacter.inventory[slot];
+ if (_itemInHand == -1) {
+ if (slotItem == -1)
+ return 0;
+
+ _screen->hideMouse();
+ clearInventorySlot(slot, 0);
+ snd_playSoundEffect(0x0B, 0xC8);
+ setMouseCursor(slotItem);
+ updateItemCommand(slotItem, (_lang == 1) ? getItemCommandStringPickUp(slotItem) : 0, 0xFF);
+ _itemInHand = slotItem;
+ _mainCharacter.inventory[slot] = 0xFFFF;
+ _screen->showMouse();
+ } else if (_itemInHand == 27) {
+ if (_chatText)
+ return 0;
+ return buttonJesterStaff(&_mainButtonData[3]);
+ } else {
+ if (slotItem >= 0) {
+ if (itemInventoryMagic(_itemInHand, slot))
+ return 0;
+
+ snd_playSoundEffect(0x0B, 0xC8);
+
+ _screen->hideMouse();
+ clearInventorySlot(slot, 0);
+ drawInventorySlot(0, _itemInHand, slot);
+ setMouseCursor(slotItem);
+ updateItemCommand(slotItem, (_lang == 1) ? getItemCommandStringPickUp(slotItem) : 0, 0xFF);
+ _mainCharacter.inventory[slot] = _itemInHand;
+ _itemInHand = slotItem;
+ _screen->showMouse();
+ } else {
+ snd_playSoundEffect(0x0C, 0xC8);
+ _screen->hideMouse();
+ drawInventorySlot(0, _itemInHand, slot);
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ updateItemCommand(_itemInHand, (_lang == 1) ? getItemCommandStringInv(_itemInHand) : 2, 0xFF);
+ _screen->showMouse();
+ _mainCharacter.inventory[slot] = _itemInHand;
+ _itemInHand = -1;
+ }
+ }
+
+ return 0;
+}
+
+int KyraEngine_MR::buttonMoodChange(Button *button) {
+ if (queryGameFlag(0x219)) {
+ snd_playSoundEffect(0x0D, 0xC8);
+ return 0;
+ }
+
+ static const uint8 frameTable[] = { 1, 6, 11 };
+
+ if (_mouseX >= 245 && _mouseX <= 267 && _mouseY >= 159 && _mouseY <= 198)
+ _malcolmsMood = 0;
+ else if (_mouseX >= 268 && _mouseX <= 289 && _mouseY >= 159 && _mouseY <= 198)
+ _malcolmsMood = 1;
+ else if (_mouseX >= 290 && _mouseX <= 312 && _mouseY >= 159 && _mouseY <= 198)
+ _malcolmsMood = 2;
+
+ int direction = (_invWsaFrame > frameTable[_malcolmsMood]) ? -1 : 1;
+
+ if (_invWsaFrame != frameTable[_malcolmsMood]) {
+ _screen->hideMouse();
+ setGameFlag(3);
+
+ snd_playSoundEffect(0x2E, 0xC8);
+
+ while (_invWsaFrame != frameTable[_malcolmsMood]) {
+ uint32 endTime = _system->getMillis() + 2 * _tickLength;
+ _invWsaFrame += direction;
+
+ drawMalcolmsMoodPointer(_invWsaFrame, 0);
+ _screen->updateScreen();
+
+ while (endTime > _system->getMillis()) {
+ update();
+ _system->delayMillis(10);
+ }
+ }
+
+ resetGameFlag(3);
+ _screen->showMouse();
+
+ drawMalcolmsMoodText();
+ updateDlgIndex();
+
+ EMCData data;
+ EMCState state;
+ memset(&data, 0, sizeof(data));
+ memset(&state, 0, sizeof(state));
+
+ _res->exists("_ACTOR.EMC", true);
+ _emc->load("_ACTOR.EMC", &data, &_opcodes);
+ _emc->init(&state, &data);
+ _emc->start(&state, 1);
+
+ int vocHigh = _vocHigh;
+ _vocHigh = 200;
+ _useActorBuffer = true;
+
+ while (_emc->isValid(&state))
+ _emc->run(&state);
+
+ _useActorBuffer = false;
+ _vocHigh = vocHigh;
+ _emc->unload(&data);
+ }
+
+ return 0;
+}
+
+int KyraEngine_MR::buttonShowScore(Button *button) {
+ strcpy(_stringBuffer, (const char*)getTableEntry(_cCodeFile, 18));
+
+ char *buffer = _stringBuffer;
+
+ while (*buffer != '%')
+ ++buffer;
+
+ buffer[0] = (_score / 100) + '0';
+ buffer[1] = ((_score % 100) / 10) + '0';
+ buffer[2] = (_score % 10) + '0';
+
+ while (*buffer != '%')
+ ++buffer;
+
+ buffer[0] = (_scoreMax / 100) + '0';
+ buffer[1] = ((_scoreMax % 100) / 10) + '0';
+ buffer[2] = (_scoreMax % 10) + '0';
+
+ showMessage(_stringBuffer, 0xFF, 0xF0);
+ return 0;
+}
+
+int KyraEngine_MR::buttonJesterStaff(Button *button) {
+ makeCharFacingMouse();
+ if (_itemInHand == 27) {
+ _screen->hideMouse();
+ removeHandItem();
+ snd_playSoundEffect(0x0C, 0xC8);
+ drawJestersStaff(1, 0);
+ updateItemCommand(27, 2, 0xFF);
+ setGameFlag(0x97);
+ _screen->showMouse();
+ } else if (_itemInHand == -1) {
+ if (queryGameFlag(0x97)) {
+ _screen->hideMouse();
+ snd_playSoundEffect(0x0B, 0xC8);
+ setHandItem(27);
+ drawJestersStaff(0, 0);
+ updateItemCommand(27, 0, 0xFF);
+ resetGameFlag(0x97);
+ _screen->showMouse();
+ } else {
+ if (queryGameFlag(0x2F))
+ objectChat((const char*)getTableEntry(_cCodeFile, 20), 0, 204, 20);
+ else
+ objectChat((const char*)getTableEntry(_cCodeFile, 25), 0, 204, 25);
+ }
+ } else {
+ objectChat((const char*)getTableEntry(_cCodeFile, 30), 0, 204, 30);
+ }
+ return 0;
+}
+
+#pragma mark -
+
+GUI_MR::GUI_MR(KyraEngine_MR *vm) : GUI_v2(vm), _vm(vm), _screen(vm->_screen) {
+}
+
+void GUI_MR::flagButtonEnable(Button *button) {
+ if (!button)
+ return;
+
+ if (button->flags & 8) {
+ button->flags &= ~8;
+ processButton(button);
+ }
+}
+
+void GUI_MR::flagButtonDisable(Button *button) {
+ if (!button)
+ return;
+
+ if (!(button->flags & 8)) {
+ button->flags |= 8;
+ processButton(button);
+ }
+}
+
+const char *GUI_MR::getMenuTitle(const Menu &menu) {
+ if (!menu.menuNameId)
+ return 0;
+
+ return (const char *)_vm->getTableEntry(_vm->_optionsFile, menu.menuNameId);
+}
+
+const char *GUI_MR::getMenuItemTitle(const MenuItem &menuItem) {
+ if (!menuItem.itemId)
+ return 0;
+
+ return (const char *)_vm->getTableEntry(_vm->_optionsFile, menuItem.itemId);
+}
+
+const char *GUI_MR::getMenuItemLabel(const MenuItem &menuItem) {
+ if (!menuItem.labelId)
+ return 0;
+
+ return (const char *)_vm->getTableEntry(_vm->_optionsFile, menuItem.labelId);
+}
+
+char *GUI_MR::getTableString(int id) {
+ return (char *)_vm->getTableEntry(_vm->_optionsFile, id);
+}
+
+int GUI_MR::redrawButtonCallback(Button *button) {
+ if (!_displayMenu)
+ return 0;
+
+ _screen->hideMouse();
+ _screen->drawBox(button->x + 1, button->y + 1, button->x + button->width - 1, button->y + button->height - 1, 0xD0);
+ _screen->showMouse();
+
+ return 0;
+}
+
+int GUI_MR::redrawShadedButtonCallback(Button *button) {
+ if (!_displayMenu)
+ return 0;
+
+ _screen->hideMouse();
+ _screen->drawShadedBox(button->x, button->y, button->x + button->width, button->y + button->height, 0xD1, 0xCF);
+ _screen->showMouse();
+
+ return 0;
+}
+void GUI_MR::resetState(int item) {
+ _vm->_timer->resetNextRun();
+ _vm->setNextIdleAnimTimer();
+ _isDeathMenu = false;
+ if (!_loadedSave) {
+ _vm->setHandItem(item);
+ } else {
+ _vm->setHandItem(_vm->_itemInHand);
+ _vm->setCommandLineRestoreTimer(7);
+ _vm->_shownMessage = " ";
+ _vm->_restoreCommandLine = false;
+ }
+ _buttonListChanged = true;
+}
+
+int GUI_MR::quitGame(Button *caller) {
+ updateMenuButton(caller);
+ if (choiceDialog(0x0F, 1)) {
+ _displayMenu = false;
+ _vm->_runFlag = false;
+ _vm->fadeOutMusic(60);
+ _screen->fadeToBlack(60);
+ _screen->clearCurPage();
+ }
+
+ if (_vm->_runFlag) {
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ }
+
+ return 0;
+}
+
+int GUI_MR::optionsButton(Button *button) {
+ _vm->musicUpdate(0);
+
+ _screen->hideMouse();
+ updateButton(&_vm->_mainButtonData[0]);
+ _screen->showMouse();
+
+ if (!_vm->_inventoryState && button && !_vm->_menuDirectlyToLoad)
+ return 0;
+
+ _restartGame = false;
+ _reloadTemporarySave = false;
+
+ if (!_screen->isMouseVisible() && button && !_vm->_menuDirectlyToLoad)
+ return 0;
+
+ _vm->showMessage(0, 0xF0, 0xF0);
+
+ if (_vm->_handItemSet < -1) {
+ _vm->_handItemSet = -1;
+ _screen->hideMouse();
+ _screen->setMouseCursor(1, 1, _vm->getShapePtr(0));
+ _screen->showMouse();
+ return 0;
+ }
+
+ int oldHandItem = _vm->_itemInHand;
+ _screen->setMouseCursor(0, 0, _vm->getShapePtr(0));
+ _vm->musicUpdate(0);
+
+ _displayMenu = true;
+ for (int i = 0; i < 4; ++i) {
+ if (_vm->_musicSoundChannel != i)
+ _vm->_soundDigital->stopSound(i);
+ }
+
+ for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
+ _menuButtons[i].data0Val1 = _menuButtons[i].data1Val1 = _menuButtons[i].data2Val1 = 4;
+ _menuButtons[i].data0Callback = _redrawShadedButtonFunctor;
+ _menuButtons[i].data1Callback = _menuButtons[i].data2Callback = _redrawButtonFunctor;
+ }
+
+ initMenuLayout(_mainMenu);
+ initMenuLayout(_gameOptions);
+ initMenuLayout(_audioOptions);
+ initMenuLayout(_choiceMenu);
+ _loadMenu.numberOfItems = 6;
+ initMenuLayout(_loadMenu);
+ initMenuLayout(_saveMenu);
+ initMenuLayout(_savenameMenu);
+ initMenuLayout(_deathMenu);
+
+ _currentMenu = &_mainMenu;
+
+ _vm->musicUpdate(0);
+
+ if (_vm->_menuDirectlyToLoad) {
+ backUpPage1(_vm->_screenBuffer);
+
+ _loadedSave = false;
+
+ --_loadMenu.numberOfItems;
+ loadMenu(0);
+ ++_loadMenu.numberOfItems;
+
+ if (_loadedSave) {
+ if (_restartGame)
+ _vm->_itemInHand = -1;
+ } else {
+ restorePage1(_vm->_screenBuffer);
+ }
+
+ resetState(-1);
+ _vm->_menuDirectlyToLoad = false;
+ return 0;
+ }
+
+ if (!button) {
+ _currentMenu = &_deathMenu;
+ _isDeathMenu = true;
+ } else {
+ _isDeathMenu = false;
+ }
+
+ _vm->musicUpdate(0);
+ backUpPage1(_vm->_screenBuffer);
+ initMenu(*_currentMenu);
+ _madeSave = false;
+ _loadedSave = false;
+ _vm->_itemInHand = -1;
+ updateAllMenuButtons();
+
+ if (_isDeathMenu) {
+ while (!_screen->isMouseVisible())
+ _screen->showMouse();
+ }
+
+ while (_displayMenu) {
+ processHighlights(*_currentMenu, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ if (_vm->_runFlag && !_loadedSave && !_madeSave) {
+ restorePalette();
+ restorePage1(_vm->_screenBuffer);
+ }
+
+ if (_vm->_runFlag)
+ updateMenuButton(&_vm->_mainButtonData[0]);
+
+ resetState(oldHandItem);
+
+ if (!_loadedSave && _reloadTemporarySave) {
+ _vm->_unkSceneScreenFlag1 = true;
+ _vm->loadGame(_vm->getSavegameFilename(999));
+ _vm->_saveFileMan->removeSavefile(_vm->getSavegameFilename(999));
+ _vm->_unkSceneScreenFlag1 = false;
+ }
+
+ return 0;
+}
+
+int GUI_MR::loadMenu(Button *caller) {
+ updateSaveList();
+
+ if (!_vm->_menuDirectlyToLoad) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ }
+
+ _savegameOffset = 0;
+ setupSavegameNames(_loadMenu, 5);
+ initMenu(_loadMenu);
+ _isLoadMenu = true;
+ _noLoadProcess = false;
+ _vm->_gameToLoad = -1;
+ updateAllMenuButtons();
+
+ _screen->updateScreen();
+ while (_isLoadMenu) {
+ processHighlights(_loadMenu, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ if (_noLoadProcess) {
+ if (!_vm->_menuDirectlyToLoad) {
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ }
+ } else if (_vm->_gameToLoad >= 0) {
+ restorePage1(_vm->_screenBuffer);
+ restorePalette();
+ _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
+ if (_vm->_gameToLoad == 0) {
+ _restartGame = true;
+ _vm->runStartupScript(1, 1);
+ }
+ _displayMenu = false;
+ _loadedSave = true;
+ }
+
+ return 0;
+}
+
+int GUI_MR::loadSecondChance(Button *button) {
+ updateMenuButton(button);
+
+ _vm->_gameToLoad = 999;
+ restorePage1(_vm->_screenBuffer);
+ _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
+ _displayMenu = false;
+ _loadedSave = true;
+ return 0;
+}
+
+int GUI_MR::gameOptions(Button *caller) {
+ updateMenuButton(caller);
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ bool textEnabled = _vm->textEnabled();
+ int lang = _vm->_lang;
+
+ setupOptionsButtons();
+ initMenu(_gameOptions);
+ _isOptionsMenu = true;
+
+ while (_isOptionsMenu) {
+ processHighlights(_gameOptions, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+
+ if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
+ _vm->_configVoice = 1;
+ _vm->setVolume(KyraEngine::kVolumeSpeech, 75);
+ choiceDialog(0x1E, 0);
+ }
+
+ if (_vm->_lang != lang) {
+ _reloadTemporarySave = true;
+ _vm->saveGame(_vm->getSavegameFilename(999), "Temporary Kyrandia 3 Savegame");
+ if (!_vm->loadLanguageFile("ITEMS.", _vm->_itemFile))
+ error("Couldn't load ITEMS");
+ if (!_vm->loadLanguageFile("SCORE.", _vm->_scoreFile))
+ error("Couldn't load SCORE");
+ if (!_vm->loadLanguageFile("C_CODE.", _vm->_cCodeFile))
+ error("Couldn't load C_CODE");
+ if (!_vm->loadLanguageFile("SCENES.", _vm->_scenesFile))
+ error("Couldn't load SCENES");
+ if (!_vm->loadLanguageFile("OPTIONS.", _vm->_optionsFile))
+ error("Couldn't load OPTIONS");
+ if (!_vm->loadLanguageFile("_ACTOR.", _vm->_actorFile))
+ error("couldn't load _ACTOR");
+ }
+
+ _vm->writeSettings();
+
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ return 0;
+}
+
+void GUI_MR::setupOptionsButtons() {
+ _vm->musicUpdate(0);
+ if (_vm->_configWalkspeed == 3)
+ _gameOptions.item[0].itemId = 28;
+ else
+ _gameOptions.item[0].itemId = 27;
+
+ if (_vm->textEnabled())
+ _gameOptions.item[4].itemId = 18;
+ else
+ _gameOptions.item[4].itemId = 17;
+
+ switch (_vm->_lang) {
+ case 0:
+ _gameOptions.item[1].itemId = 31;
+ break;
+
+ case 1:
+ _gameOptions.item[1].itemId = 32;
+ break;
+
+ case 2:
+ _gameOptions.item[1].itemId = 33;
+ break;
+
+ default:
+ break;
+ }
+
+ if (_vm->_configStudio)
+ _gameOptions.item[2].itemId = 18;
+ else
+ _gameOptions.item[2].itemId = 17;
+
+ if (_vm->_configSkip)
+ _gameOptions.item[3].itemId = 18;
+ else
+ _gameOptions.item[3].itemId = 17;
+}
+
+int GUI_MR::changeLanguage(Button *caller) {
+ updateMenuButton(caller);
+ if (!_vm->queryGameFlag(0x1B2)) {
+ ++_vm->_lang;
+ _vm->_lang %= 3;
+ setupOptionsButtons();
+ renewHighlight(_gameOptions);
+ }
+ return 0;
+}
+
+int GUI_MR::toggleStudioSFX(Button *caller) {
+ updateMenuButton(caller);
+ _vm->_configStudio ^= 1;
+ setupOptionsButtons();
+ renewHighlight(_gameOptions);
+ return 0;
+}
+
+int GUI_MR::toggleSkipSupport(Button *caller) {
+ updateMenuButton(caller);
+ _vm->_configSkip ^= 1;
+ setupOptionsButtons();
+ renewHighlight(_gameOptions);
+ return 0;
+}
+
+int GUI_MR::audioOptions(Button *caller) {
+ updateMenuButton(caller);
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+
+ //if (_configHelium)
+ // _audioOptions.item[3].itemId = 18;
+ //else
+ _audioOptions.item[3].itemId = 17;
+
+ initMenu(_audioOptions);
+
+ const int menuX = _audioOptions.x;
+ const int menuY = _audioOptions.y;
+
+ const int maxButton = 3; // 2 if voc is disabled
+
+ for (int i = 0; i < maxButton; ++i) {
+ int x = menuX + _sliderBarsPosition[i*2+0];
+ int y = menuY + _sliderBarsPosition[i*2+1];
+ _screen->drawShape(0, _vm->getShapePtr(0x1CF), x, y, 0, 0);
+ drawSliderBar(i, _vm->getShapePtr(0x1D0));
+ _sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[0][i].x = x;
+ _sliderButtons[0][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
+ _sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[2][i].x = x + 10;
+ _sliderButtons[2][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
+ _sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
+ _sliderButtons[1][i].x = x + 120;
+ _sliderButtons[1][i].y = y;
+ _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
+ }
+
+ _isOptionsMenu = true;
+ updateAllMenuButtons();
+ bool speechEnabled = _vm->speechEnabled();
+ while (_isOptionsMenu) {
+ processHighlights(_audioOptions, _vm->_mouseX, _vm->_mouseY);
+ getInput();
+ }
+
+ restorePage1(_vm->_screenBuffer);
+ backUpPage1(_vm->_screenBuffer);
+ if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine::kVolumeSpeech) == 2)) {
+ _vm->_configVoice = 0;
+ choiceDialog(0x1D, 0);
+ }
+
+ _vm->writeSettings();
+
+ initMenu(*_currentMenu);
+ updateAllMenuButtons();
+ return 0;
+}
+
+int GUI_MR::sliderHandler(Button *caller) {
+ int button = 0;
+ if (caller->index >= 24 && caller->index <= 27)
+ button = caller->index - 24;
+ else if (caller->index >= 28 && caller->index <= 31)
+ button = caller->index - 28;
+ else
+ button = caller->index - 32;
+
+ assert(button >= 0 && button <= 3);
+
+ int oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ int newVolume = oldVolume;
+
+ if (caller->index >= 24 && caller->index <= 27)
+ newVolume -= 10;
+ else if (caller->index >= 28 && caller->index <= 31)
+ newVolume += 10;
+ else
+ newVolume = _vm->_mouseX - caller->x - 7;
+
+ newVolume = MAX(2, newVolume);
+ newVolume = MIN(97, newVolume);
+
+ if (newVolume == oldVolume)
+ return 0;
+
+ int lastMusicCommand = -1;
+ bool playSoundEffect = false;
+
+ drawSliderBar(button, _vm->getShapePtr(0x1D1));
+
+ if (button == 2) {
+ if (_vm->textEnabled())
+ _vm->_configVoice = 2;
+ else
+ _vm->_configVoice = 1;
+ }
+
+ _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+
+ switch (button) {
+ case 0:
+ lastMusicCommand = _vm->_lastMusicCommand;
+ break;
+
+ case 1:
+ playSoundEffect = true;
+ break;
+
+ case 2:
+ if (_vm->_voiceSoundChannel != _vm->_musicSoundChannel)
+ _vm->_soundDigital->stopSound(_vm->_voiceSoundChannel);
+ _vm->playVoice(200, 943);
+ break;
+
+ default:
+ return 0;
+ }
+
+ drawSliderBar(button, _vm->getShapePtr(0x1D0));
+ if (playSoundEffect)
+ _vm->snd_playSoundEffect(0x18, 0xC8);
+ else if (lastMusicCommand >= 0)
+ _vm->snd_playWanderScoreViaMap(lastMusicCommand, 1);
+
+ _screen->updateScreen();
+ return 0;
+}
+
+void GUI_MR::drawSliderBar(int slider, const uint8 *shape) {
+ const int menuX = _audioOptions.x;
+ const int menuY = _audioOptions.y;
+ int x = menuX + _sliderBarsPosition[slider*2+0] + 10;
+ int y = menuY + _sliderBarsPosition[slider*2+1];
+
+ int position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+
+ position = MAX(2, position);
+ position = MIN(97, position);
+ _screen->drawShape(0, shape, x+position, y, 0, 0);
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/gui_mr.h b/engines/kyra/gui_mr.h
new file mode 100644
index 0000000000..d73b21b73b
--- /dev/null
+++ b/engines/kyra/gui_mr.h
@@ -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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA_GUI_MR_H
+#define KYRA_GUI_MR_H
+
+#include "kyra/gui_v2.h"
+
+namespace Kyra {
+
+class KyraEngine_MR;
+class Screen_MR;
+
+class GUI_MR : public GUI_v2 {
+friend class KyraEngine_MR;
+public:
+ GUI_MR(KyraEngine_MR *engine);
+
+ void initStaticData();
+
+ void flagButtonEnable(Button *button);
+ void flagButtonDisable(Button *button);
+
+ int redrawShadedButtonCallback(Button *button);
+ int redrawButtonCallback(Button *button);
+
+ int optionsButton(Button *button);
+private:
+ const char *getMenuTitle(const Menu &menu);
+ const char *getMenuItemTitle(const MenuItem &menuItem);
+ const char *getMenuItemLabel(const MenuItem &menuItem);
+ char *getTableString(int id);
+
+ uint8 textFieldColor1() const { return 0xFF; }
+ uint8 textFieldColor2() const { return 0xCF; }
+ uint8 textFieldColor3() const { return 0xBA; }
+
+ uint8 defaultColor1() const { return 0xF0; }
+ uint8 defaultColor2() const { return 0xD0; }
+
+ void resetState(int item);
+
+ int quitGame(Button *button);
+ int loadMenu(Button *button);
+ int loadSecondChance(Button *button);
+
+ int gameOptions(Button *button);
+ void setupOptionsButtons();
+
+ int audioOptions(Button *button);
+
+ int sliderHandler(Button *caller);
+ void drawSliderBar(int slider, const uint8 *shape);
+
+ int changeLanguage(Button *caller);
+ int toggleStudioSFX(Button *caller);
+ int toggleSkipSupport(Button *caller);
+
+ KyraEngine_MR *_vm;
+ Screen_MR *_screen;
+};
+
+} // end of namespace Kyra
+
+#endif
+
diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp
index 12c9648f10..e5a0c42281 100644
--- a/engines/kyra/gui_v1.cpp
+++ b/engines/kyra/gui_v1.cpp
@@ -119,15 +119,15 @@ int KyraEngine_v1::buttonAmuletCallback(Button *caller) {
drawJewelsFadeOutStart();
drawJewelsFadeOutEnd(jewel);
- _scriptInterpreter->initScript(_scriptClick, _scriptClickData);
- _scriptClick->regs[3] = 0;
- _scriptClick->regs[6] = jewel;
- _scriptInterpreter->startScript(_scriptClick, 4);
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _scriptClick.regs[3] = 0;
+ _scriptClick.regs[6] = jewel;
+ _emc->start(&_scriptClick, 4);
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
- if (_scriptClick->regs[3])
+ if (_scriptClick.regs[3])
return 1;
_unkAmuletVar = 1;
@@ -624,6 +624,8 @@ int GUI_v1::loadGameMenu(Button *button) {
_displaySubMenu = true;
_cancelSubMenu = false;
+ _vm->_gameToLoad = -1;
+
while (_displaySubMenu && !_vm->_quitFlag) {
getInput();
Common::Point mouse = _vm->getMousePos();
@@ -639,7 +641,8 @@ int GUI_v1::loadGameMenu(Button *button) {
updateAllMenuButtons();
} else {
restorePalette();
- _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
+ if (_vm->_gameToLoad != -1)
+ _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
_displayMenu = false;
_menuRestoreScreen = false;
}
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp
index 2e16de5112..d835c4f8d5 100644
--- a/engines/kyra/gui_v2.cpp
+++ b/engines/kyra/gui_v2.cpp
@@ -11,7 +11,7 @@
* 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
+ * 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
@@ -23,65 +23,19 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/gui_v2.h"
#include "kyra/kyra_v2.h"
-#include "kyra/screen.h"
-#include "kyra/wsamovie.h"
-#include "kyra/timer.h"
-#include "kyra/sound.h"
+#include "kyra/screen_v2.h"
+#include "kyra/text.h"
#include "common/savefile.h"
namespace Kyra {
-void KyraEngine_v2::loadButtonShapes() {
- const uint8 *src = _screen->getCPagePtr(3);
- _screen->loadBitmap("_BUTTONS.CSH", 3, 3, 0);
-
- _gui->_scrollUpButton.data0ShapePtr = _buttonShapes[0] = _screen->makeShapeCopy(src, 0);
- _gui->_scrollUpButton.data2ShapePtr = _buttonShapes[1] = _screen->makeShapeCopy(src, 1);
- _gui->_scrollUpButton.data1ShapePtr = _buttonShapes[2] = _screen->makeShapeCopy(src, 2);
- _gui->_scrollDownButton.data0ShapePtr = _buttonShapes[3] = _screen->makeShapeCopy(src, 3);
- _gui->_scrollDownButton.data2ShapePtr = _buttonShapes[4] = _screen->makeShapeCopy(src, 4);
- _gui->_scrollDownButton.data1ShapePtr = _buttonShapes[5] = _screen->makeShapeCopy(src, 5);
- _buttonShapes[6] = _screen->makeShapeCopy(src, 6);
- _buttonShapes[7] = _screen->makeShapeCopy(src, 7);
- _buttonShapes[8] = _screen->makeShapeCopy(src, 6);
- _buttonShapes[9] = _screen->makeShapeCopy(src, 7);
- _buttonShapes[10] = _screen->makeShapeCopy(src, 10);
- _buttonShapes[11] = _screen->makeShapeCopy(src, 11);
- _buttonShapes[16] = _screen->makeShapeCopy(src, 16);
- _buttonShapes[17] = _screen->makeShapeCopy(src, 17);
- _buttonShapes[18] = _screen->makeShapeCopy(src, 18);
-}
-
-void KyraEngine_v2::setupLangButtonShapes() {
- switch (_lang) {
- case 0:
- _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
- _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
- break;
-
- case 1:
- _inventoryButtons[0].data0ShapePtr = _buttonShapes[8];
- _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[9];
- break;
-
- case 2:
- _inventoryButtons[0].data0ShapePtr = _buttonShapes[10];
- _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[11];
- break;
-
- default:
- _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
- _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
- break;
- }
-}
-
GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) {
_backUpButtonList = _unknownButtonList = 0;
- initStaticData();
+ _buttonListChanged = false;
+
_currentMenu = 0;
_isDeathMenu = false;
_isSaveMenu = false;
@@ -419,584 +373,27 @@ int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag) {
return returnValue;
}
-const char *GUI_v2::getMenuTitle(const Menu &menu) {
- if (!menu.menuNameId)
- return 0;
-
- return _vm->getTableString(menu.menuNameId, _vm->_optionsBuffer, 1);
-}
-
-const char *GUI_v2::getMenuItemTitle(const MenuItem &menuItem) {
- if (!menuItem.itemId)
- return 0;
-
- return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1);
-}
-
-const char *GUI_v2::getMenuItemLabel(const MenuItem &menuItem) {
- if (!menuItem.labelId)
- return 0;
-
- return _vm->getTableString(menuItem.labelId, _vm->_optionsBuffer, 1);
-}
-
-#pragma mark -
-
-
-int KyraEngine_v2::buttonInventory(Button *button) {
- if (!_screen->isMouseVisible())
- return 0;
-
- int inventorySlot = button->index - 6;
-
- uint16 item = _mainCharacter.inventory[inventorySlot];
- if (_itemInHand == -1) {
- if (item == 0xFFFF)
- return 0;
- _screen->hideMouse();
- clearInventorySlot(inventorySlot, 0);
- snd_playSoundEffect(0x0B);
- setMouseCursor(item);
- int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7;
- updateCommandLineEx(item+54, string, 0xD6);
- _itemInHand = (int16)item;
- _screen->showMouse();
- _mainCharacter.inventory[inventorySlot] = 0xFFFF;
- } else {
- if (_mainCharacter.inventory[inventorySlot] != 0xFFFF) {
- if (checkInventoryItemExchange(_itemInHand, inventorySlot))
- return 0;
-
- item = _mainCharacter.inventory[inventorySlot];
- snd_playSoundEffect(0x0B);
- _screen->hideMouse();
- clearInventorySlot(inventorySlot, 0);
- drawInventoryShape(0, _itemInHand, inventorySlot);
- setMouseCursor(item);
- int string = (_lang == 1) ? getItemCommandStringPickUp(item) : 7;
- updateCommandLineEx(item+54, string, 0xD6);
- _screen->showMouse();
- _mainCharacter.inventory[inventorySlot] = _itemInHand;
- setHandItem(item);
- } else {
- snd_playSoundEffect(0x0C);
- _screen->hideMouse();
- drawInventoryShape(0, _itemInHand, inventorySlot);
- _screen->setMouseCursor(0, 0, getShapePtr(0));
- int string = (_lang == 1) ? getItemCommandStringInv(_itemInHand) : 8;
- updateCommandLineEx(_itemInHand+54, string, 0xD6);
- _screen->showMouse();
- _mainCharacter.inventory[inventorySlot] = _itemInHand;
- _itemInHand = -1;
- }
- }
-
- return 0;
-}
-
-int KyraEngine_v2::scrollInventory(Button *button) {
- uint16 *src = _mainCharacter.inventory;
- uint16 *dst = &_mainCharacter.inventory[10];
- uint16 temp[5];
-
- memcpy(temp, src, sizeof(uint16)*5);
- memcpy(src, src+5, sizeof(uint16)*5);
- memcpy(src+5, dst, sizeof(uint16)*5);
- memcpy(dst, dst+5, sizeof(uint16)*5);
- memcpy(dst+5, temp, sizeof(uint16)*5);
- _screen->hideMouse();
- _screen->copyRegion(0x46, 0x90, 0x46, 0x90, 0x71, 0x2E, 0, 2);
- _screen->showMouse();
- redrawInventory(2);
- scrollInventoryWheel();
- return 0;
-}
-
-int KyraEngine_v2::getInventoryItemSlot(uint16 item) {
- for (int i = 0; i < 20; ++i) {
- if (_mainCharacter.inventory[i] == item)
- return i;
- }
- return -1;
-}
-
-int KyraEngine_v2::findFreeVisibleInventorySlot() {
- for (int i = 0; i < 10; ++i) {
- if (_mainCharacter.inventory[i] == 0xFFFF)
- return i;
- }
- return -1;
-}
-
-void KyraEngine_v2::removeItemFromInventory(int slot) {
- _mainCharacter.inventory[slot] = 0xFFFF;
- if (slot < 10) {
- _screen->hideMouse();
- clearInventorySlot(slot, 0);
- _screen->showMouse();
- }
-}
-
-bool KyraEngine_v2::checkInventoryItemExchange(uint16 handItem, int slot) {
- bool removeItem = false;
- uint16 newItem = 0xFFFF;
-
- uint16 invItem = _mainCharacter.inventory[slot];
-
- for (const uint16 *table = _itemMagicTable; *table != 0xFFFF; table += 4) {
- if (table[0] != handItem || table[1] != invItem)
- continue;
-
- if (table[3] == 0xFFFF)
- continue;
-
- removeItem = (table[3] == 1);
- newItem = table[2];
-
- snd_playSoundEffect(0x68);
- _mainCharacter.inventory[slot] = newItem;
- _screen->hideMouse();
- clearInventorySlot(slot, 0);
- drawInventoryShape(0, newItem, slot);
-
- if (removeItem)
- removeHandItem();
-
- _screen->showMouse();
-
- if (_lang != 1)
- updateCommandLineEx(newItem+54, 0x2E, 0xD6);
-
- return true;
- }
-
- return false;
-}
-
-void KyraEngine_v2::drawInventoryShape(int page, uint16 item, int slot) {
- _screen->drawShape(page, getShapePtr(item+64), _inventoryX[slot], _inventoryY[slot], 0, 0);
- _screen->updateScreen();
-}
-
-void KyraEngine_v2::clearInventorySlot(int slot, int page) {
- _screen->drawShape(page, _defaultShapeTable[240+slot], _inventoryX[slot], _inventoryY[slot], 0, 0);
- _screen->updateScreen();
-}
-
-void KyraEngine_v2::redrawInventory(int page) {
- int pageBackUp = _screen->_curPage;
- _screen->_curPage = page;
-
- const uint16 *inventory = _mainCharacter.inventory;
- _screen->hideMouse();
- for (int i = 0; i < 10; ++i) {
- clearInventorySlot(i, page);
- if (inventory[i] != 0xFFFF) {
- _screen->drawShape(page, getShapePtr(inventory[i]+64), _inventoryX[i], _inventoryY[i], 0, 0);
- drawInventoryShape(page, inventory[i], i);
- }
- }
- _screen->showMouse();
- _screen->updateScreen();
-
- _screen->_curPage = pageBackUp;
-}
-
-void KyraEngine_v2::scrollInventoryWheel() {
- WSAMovieV2 movie(this, _screen);
- movie.open("INVWHEEL.WSA", 0, 0);
- int frames = movie.opened() ? movie.frames() : 6;
- memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000);
- uint8 overlay[0x100];
- _screen->generateOverlay(_screen->getPalette(0), overlay, 0, 50);
- _screen->hideMouse();
- _screen->copyRegion(0x46, 0x90, 0x46, 0x79, 0x71, 0x17, 0, 2, Screen::CR_NO_P_CHECK);
- _screen->showMouse();
- snd_playSoundEffect(0x25);
-
- movie.setDrawPage(0);
- movie.setX(0);
- movie.setY(0);
-
- bool breakFlag = false;
- for (int i = 0; i <= 6 && !breakFlag; ++i) {
- if (movie.opened()) {
- _screen->hideMouse();
- movie.displayFrame(i % frames, 0, 0);
- _screen->showMouse();
- _screen->updateScreen();
- }
-
- uint32 endTime = _system->getMillis() + _tickLength;
-
- int y = (i * 981) >> 8;
- if (y >= 23 || i == 6) {
- y = 23;
- breakFlag = true;
- }
-
- _screen->applyOverlay(0x46, 0x79, 0x71, 0x17, 2, overlay);
- _screen->copyRegion(0x46, y+0x79, 0x46, 0x90, 0x71, 0x2E, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- delayUntil(endTime);
- }
-
- _screen->copyBlockToPage(2, 0, 0, 320, 200, _screenBuffer);
- movie.close();
-}
-
-// spellbook specific code
-
-int KyraEngine_v2::bookButton(Button *button) {
- if (!queryGameFlag(1)) {
- objectChat(getTableString(0xEB, _cCodeBuffer, 1), 0, 0x83, 0xEB);
- return 0;
- }
-
- if (!_screen->isMouseVisible())
- return 0;
-
- if (queryGameFlag(0xE5)) {
- snd_playSoundEffect(0x0D);
- return 0;
- }
-
- if (_itemInHand == 72) {
- if (!queryGameFlag(0xE2)) {
- _bookMaxPage += 2;
- removeHandItem();
- snd_playSoundEffect(0x6C);
- setGameFlag(0xE2);
- }
-
- if (!queryGameFlag(0x18A) && queryGameFlag(0x170)) {
- _bookMaxPage += 2;
- removeHandItem();
- snd_playSoundEffect(0x6C);
- setGameFlag(0x18A);
- }
-
- return 0;
- }
-
- if (_handItemSet != -1) {
- snd_playSoundEffect(0x0D);
- return 0;
- }
-
- _screen->hideMouse();
- showMessage(0, 0xCF);
- displayInvWsaLastFrame();
- _bookNewPage = _bookCurPage;
-
- if (_screenBuffer) {
- _screen->hideMouse();
- memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000);
- _screen->showMouse();
- }
-
- memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
- _screen->fadeToBlack(7, &_updateFunctor);
- _res->loadFileToBuf("_BOOK.COL", _screen->getPalette(0), 768);
- loadBookBkgd();
- showBookPage();
- _screen->copyRegion(0, 0, 0, 0, 0x140, 0xC8, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- int oldItemInHand = _itemInHand;
- removeHandItem();
- _screen->fadePalette(_screen->getPalette(0), 7);
- _screen->showMouse();
-
- bookLoop();
-
- _screen->fadeToBlack(7);
- _screen->hideMouse();
- setHandItem(oldItemInHand);
- updateMouse();
- restorePage3();
-
- if (_screenBuffer) {
- _screen->hideMouse();
- _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer);
- _screen->showMouse();
- }
-
- setHandItem(_itemInHand);
- memcpy(_screen->getPalette(0), _screen->getPalette(2), 768);
- _screen->fadePalette(_screen->getPalette(0), 7, &_updateFunctor);
- _screen->showMouse();
-
- if (!queryGameFlag(4) && !queryGameFlag(0xB8)) {
- objectChat(getTableString(0xEC, _cCodeBuffer, 1), 0, 0x83, 0xEC);
- objectChat(getTableString(0xED, _cCodeBuffer, 1), 0, 0x83, 0xED);
- objectChat(getTableString(0xEE, _cCodeBuffer, 1), 0, 0x83, 0xEE);
- objectChat(getTableString(0xEF, _cCodeBuffer, 1), 0, 0x83, 0xEF);
- setGameFlag(4);
- }
-
- return 0;
-}
-
-void KyraEngine_v2::loadBookBkgd() {
- char filename[16];
+void GUI_v2::updateButton(Button *button) {
+ if (!button || (button->flags & 8))
+ return;
- if (_flags.isTalkie)
- strcpy(filename, (_bookBkgd == 0) ? "_XBOOKD.CPS" : "_XBOOKC.CPS");
+ if (button->flags2 & 1)
+ button->flags2 |= 8;
else
- strcpy(filename, (_bookBkgd == 0) ? "_BOOKD.CPS" : "_BOOKC.CPS");
-
- _bookBkgd ^= 1;
-
- if (_flags.isTalkie) {
- if (!_bookCurPage)
- strcpy(filename, "_XBOOKB.CPS");
- if (_bookCurPage == _bookMaxPage)
- strcpy(filename, "_XBOOKA.CPS");
-
- switch (_lang) {
- case 0:
- filename[1] = 'E';
- break;
-
- case 1:
- filename[1] = 'F';
- break;
-
- case 2:
- filename[1] = 'G';
- break;
-
- default:
- warning("loadBookBkgd unsupported language");
- filename[1] = 'E';
- break;
- }
- } else {
- if (!_bookCurPage)
- strcpy(filename, "_BOOKB.CPS");
- if (_bookCurPage == _bookMaxPage)
- strcpy(filename, "_BOOKA.CPS");
- }
-
- _screen->loadBitmap(filename, 3, 3, 0);
-}
-
-void KyraEngine_v2::showBookPage() {
- char filename[16];
-
- sprintf(filename, "PAGE%.01X.", _bookCurPage);
- strcat(filename, _languageExtension[_lang]);
- uint8 *leftPage = _res->fileData(filename, 0);
- int leftPageY = _bookPageYOffset[_bookCurPage];
-
- sprintf(filename, "PAGE%.01X.", _bookCurPage+1);
- strcat(filename, _languageExtension[_lang]);
- uint8 *rightPage = (_bookCurPage != _bookMaxPage) ? _res->fileData(filename, 0) : 0;
- int rightPageY = _bookPageYOffset[_bookCurPage+1];
-
- _screen->hideMouse();
- if (leftPage) {
- bookDecodeText(leftPage);
- bookPrintText(2, leftPage, 20, leftPageY+20, 0x31);
- delete [] leftPage;
- }
-
- if (rightPage) {
- bookDecodeText(rightPage);
- bookPrintText(2, rightPage, 176, rightPageY+20, 0x31);
- delete [] rightPage;
- }
- _screen->showMouse();
-}
-
-void KyraEngine_v2::bookLoop() {
- Button bookButtons[5];
-
- GUI_V2_BUTTON(bookButtons[0], 0x24, 0, 0, 1, 1, 1, 0x4487, 0, 0x82, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- bookButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookPrevPage);
- GUI_V2_BUTTON(bookButtons[1], 0x25, 0, 0, 1, 1, 1, 0x4487, 0, 0xB1, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- bookButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookNextPage);
- GUI_V2_BUTTON(bookButtons[2], 0x26, 0, 0, 1, 1, 1, 0x4487, 0, 0x8F, 0xBE, 0x21, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- bookButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookClose);
- GUI_V2_BUTTON(bookButtons[3], 0x27, 0, 0, 1, 1, 1, 0x4487, 0, 0x08, 0x08, 0x90, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- bookButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookPrevPage);
- GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookNextPage);
-
- Button *buttonList = 0;
-
- for (uint i = 0; i < ARRAYSIZE(bookButtons); ++i)
- buttonList = _gui->addButtonToList(buttonList, &bookButtons[i]);
-
- showBookPage();
- _bookShown = true;
- while (_bookShown && !_quitFlag) {
- checkInput(buttonList);
- removeInputTop();
-
- if (_bookCurPage != _bookNewPage) {
- _bookCurPage = _bookNewPage;
- _screen->clearPage(2);
- loadBookBkgd();
- showBookPage();
- snd_playSoundEffect(0x64);
- _screen->hideMouse();
- _screen->copyRegion(0, 0, 0, 0, 0x140, 0xC8, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- _screen->showMouse();
- }
- }
- _screen->clearPage(2);
-}
-
-void KyraEngine_v2::bookDecodeText(uint8 *str) {
- uint8 *dst = str, *op = str;
- while (*op != 0x1A) {
- while (*op != 0x1A && *op != 0x0D)
- *dst++ = *op++;
-
- if (*op == 0x1A)
- break;
-
- op += 2;
- *dst++ = 0x0D;
- }
- *dst = 0;
-}
-
-void KyraEngine_v2::bookPrintText(int dstPage, const uint8 *str, int x, int y, uint8 color) {
- int curPageBackUp = _screen->_curPage;
- _screen->_curPage = dstPage;
-
- _screen->setTextColor(_bookTextColorMap, 0, 3);
- Screen::FontId oldFont = _screen->setFont(Screen::FID_BOOKFONT_FNT);
- _screen->_charWidth = -2;
-
- _screen->hideMouse();
- _screen->printText((const char*)str, x, y, color, (_flags.lang == Common::JA_JPN) ? 0xf6 : 0);
- _screen->showMouse();
-
- _screen->_charWidth = 0;
- _screen->setFont(oldFont);
- _screen->_curPage = curPageBackUp;
-}
+ button->flags2 |= ~8;
-int KyraEngine_v2::bookPrevPage(Button *button) {
- _bookNewPage = MAX<int>(_bookCurPage-2, 0);
- return 0;
-}
-
-int KyraEngine_v2::bookNextPage(Button *button) {
- _bookNewPage = MIN<int>(_bookCurPage+2, _bookMaxPage);
- return 0;
-}
-
-int KyraEngine_v2::bookClose(Button *button) {
- _bookShown = false;
- return 0;
-}
-
-// cauldron specific code
-
-int KyraEngine_v2::cauldronClearButton(Button *button) {
- if (!queryGameFlag(2)) {
- updateCharFacing();
- objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
- return 0;
- }
-
- if (queryGameFlag(0xE4)) {
- snd_playSoundEffect(0x0D);
- return 0;
- }
-
- _screen->hideMouse();
- displayInvWsaLastFrame();
- snd_playSoundEffect(0x25);
- loadInvWsa("PULL.WSA", 1, 6, 0, -1, -1, 1);
- loadInvWsa("CAULD00.WSA", 1, 7, 0, 0xD4, 0x0F, 1);
- showMessage(0, 0xCF);
- setCauldronState(0, 0);
- clearCauldronTable();
- snd_playSoundEffect(0x57);
- loadInvWsa("CAULDFIL.WSA", 1, 7, 0, -1, -1, 1);
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v2::cauldronButton(Button *button) {
- if (!queryGameFlag(2)) {
- objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
- return 0;
- }
+ button->flags2 &= ~1;
- if (!_screen->isMouseVisible() || _handItemSet < -1)
- return 0;
-
- if (queryGameFlag(0xE4)) {
- snd_playSoundEffect(0x0D);
- return 0;
- }
-
- updateCharFacing();
-
- for (int i = 0; _cauldronProtectedItems[i] != -1; ++i) {
- if (_itemInHand == _cauldronProtectedItems[i]) {
- objectChat(getTableString(0xF1, _cCodeBuffer, 1), 0, 0x83, 0xF1);
- return 0;
- }
- }
-
- if (_itemInHand == -1) {
- listItemsInCauldron();
- return 0;
- }
-
- for (int i = 0; _cauldronBowlTable[i] != -1; i += 2) {
- if (_itemInHand == _cauldronBowlTable[i]) {
- addFrontCauldronTable(_itemInHand);
- setHandItem(_cauldronBowlTable[i+1]);
- if (!updateCauldron()) {
- _cauldronState = 0;
- cauldronRndPaletteFade();
- }
- return 0;
- }
- }
+ if (button->flags2 & 4)
+ button->flags2 |= 0x10;
+ else
+ button->flags2 &= ~0x10;
- if (_itemInHand == 18) {
- const int16 *magicTable = (_mainCharacter.sceneId == 77) ? _cauldronMagicTableScene77 : _cauldronMagicTable;
- while (magicTable[0] != -1) {
- if (_cauldronState == magicTable[0]) {
- setHandItem(magicTable[1]);
- snd_playSoundEffect(0x6C);
- ++_cauldronUseCount;
- if (_cauldronStateTable[_cauldronState] <= _cauldronUseCount && _cauldronUseCount) {
- showMessage(0, 0xCF);
- setCauldronState(0, true);
- clearCauldronTable();
- }
- return 0;
- }
- magicTable += 2;
- }
- } else if (_itemInHand >= 0) {
- int item = _itemInHand;
- cauldronItemAnim(item);
- addFrontCauldronTable(item);
- if (!updateCauldron()) {
- _cauldronState = 0;
- cauldronRndPaletteFade();
- }
- }
+ button->flags2 &= ~4;
- return 0;
+ processButton(button);
}
-#pragma mark -
-
void GUI_v2::getInput() {
if (!_displayMenu)
return;
@@ -1012,119 +409,6 @@ void GUI_v2::getInput() {
}
}
-int GUI_v2::optionsButton(Button *button) {
- _restartGame = false;
- _reloadTemporarySave = false;
-
- _screen->hideMouse();
- updateButton(&_vm->_inventoryButtons[0]);
- _screen->showMouse();
-
- if (!_screen->isMouseVisible() && button)
- return 0;
-
- _vm->showMessage(0, 0xCF);
-
- if (_vm->_handItemSet < -1) {
- _vm->_handItemSet = -1;
- _screen->hideMouse();
- _screen->setMouseCursor(1, 1, _vm->getShapePtr(0));
- _screen->showMouse();
- return 0;
- }
-
- int oldHandItem = _vm->_itemInHand;
- _screen->setMouseCursor(0, 0, _vm->getShapePtr(0));
- _vm->displayInvWsaLastFrame();
- //XXX
- _displayMenu = true;
-
- for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
- _menuButtons[i].data0Val1 = _menuButtons[i].data1Val1 = _menuButtons[i].data2Val1 = 4;
- _menuButtons[i].data0Callback = _redrawShadedButtonFunctor;
- _menuButtons[i].data1Callback = _menuButtons[i].data2Callback = _redrawButtonFunctor;
- }
-
- initMenuLayout(_mainMenu);
- initMenuLayout(_gameOptions);
- initMenuLayout(_audioOptions);
- initMenuLayout(_choiceMenu);
- _loadMenu.numberOfItems = 6;
- initMenuLayout(_loadMenu);
- initMenuLayout(_saveMenu);
- initMenuLayout(_savenameMenu);
- initMenuLayout(_deathMenu);
-
- _currentMenu = &_mainMenu;
-
- if (_vm->_menuDirectlyToLoad) {
- backUpPage1(_vm->_screenBuffer);
- setupPalette();
-
- _loadedSave = false;
-
- loadMenu(0);
-
- if (_loadedSave) {
- if (_restartGame)
- _vm->_itemInHand = -1;
- } else {
- restorePage1(_vm->_screenBuffer);
- restorePalette();
- }
-
- resetState(-1);
- _vm->_menuDirectlyToLoad = false;
- return 0;
- }
-
- if (!button) {
- _currentMenu = &_deathMenu;
- _isDeathMenu = true;
- } else {
- _isDeathMenu = false;
- }
-
- backUpPage1(_vm->_screenBuffer);
- setupPalette();
- initMenu(*_currentMenu);
- _madeSave = false;
- _loadedSave = false;
- _vm->_itemInHand = -1;
- updateAllMenuButtons();
-
- if (_isDeathMenu) {
- while (!_screen->isMouseVisible())
- _screen->showMouse();
- }
-
- while (_displayMenu) {
- processHighlights(*_currentMenu, _vm->_mouseX, _vm->_mouseY);
- getInput();
- }
-
- if (_vm->_runFlag && !_loadedSave && !_madeSave) {
- restorePalette();
- restorePage1(_vm->_screenBuffer);
- }
-
- if (_vm->_runFlag)
- updateMenuButton(&_vm->_inventoryButtons[0]);
-
- resetState(oldHandItem);
-
- if (!_loadedSave && _reloadTemporarySave) {
- _vm->_unkSceneScreenFlag1 = true;
- _vm->loadGame(_vm->getSavegameFilename(999));
- _vm->_saveFileMan->removeSavefile(_vm->getSavegameFilename(999));
- _vm->_unkSceneScreenFlag1 = false;
- }
-
- return 0;
-}
-
-#pragma mark -
-
void GUI_v2::renewHighlight(Menu &menu) {
if (!_displayMenu)
return;
@@ -1138,29 +422,6 @@ void GUI_v2::renewHighlight(Menu &menu) {
_screen->updateScreen();
}
-void GUI_v2::setupPalette() {
- memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
-
- uint8 *palette = _screen->getPalette(0);
- for (int i = 0; i < 768; ++i)
- palette[i] >>= 1;
-
- static const uint8 guiPal[] = { 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFc, 0xFD, 0xFE };
-
- for (uint i = 0; i < ARRAYSIZE(guiPal); ++i)
- memcpy(_screen->getPalette(0)+guiPal[i]*3, _screen->getPalette(1)+guiPal[i]*3, 3);
-
- if (_isDeathMenu)
- _screen->fadePalette(_screen->getPalette(0), 0x64);
- else
- _screen->setScreenPalette(_screen->getPalette(0));
-}
-
-void GUI_v2::restorePalette() {
- memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
- _screen->setScreenPalette(_screen->getPalette(0));
-}
-
void GUI_v2::backUpPage1(uint8 *buffer) {
_screen->copyRegionToBuffer(1, 0, 0, 320, 200, buffer);
}
@@ -1169,24 +430,9 @@ void GUI_v2::restorePage1(const uint8 *buffer) {
_screen->copyBlockToPage(1, 0, 0, 320, 200, buffer);
}
-void GUI_v2::resetState(int item) {
- _vm->_timer->resetNextRun();
- _vm->setNextIdleAnimTimer();
- _isDeathMenu = false;
- if (!_loadedSave) {
- _vm->setHandItem(item);
- } else {
- _vm->setHandItem(_vm->_itemInHand);
- _vm->setTimer1DelaySecs(7);
- _vm->_shownMessage = " ";
- _vm->_fadeMessagePalette = false;
- }
- _buttonListChanged = true;
-}
-
void GUI_v2::setupSavegameNames(Menu &menu, int num) {
for (int i = 0; i < num; ++i) {
- strcpy(_vm->getTableString(menu.item[i].itemId, _vm->_optionsBuffer, 0), "");
+ strcpy(getTableString(menu.item[i].itemId), "");
menu.item[i].saveSlot = -1;
menu.item[i].enabled = false;
}
@@ -1199,7 +445,7 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
Common::InSaveFile *in;
for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); ++i) {
if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) {
- strncpy(_vm->getTableString(menu.item[i].itemId, _vm->_optionsBuffer, 0), header.description.c_str(), 80);
+ strncpy(getTableString(menu.item[i].itemId), header.description.c_str(), 80);
menu.item[i].saveSlot = _saveSlots[i + _savegameOffset];
menu.item[i].enabled = true;
delete in;
@@ -1208,14 +454,14 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
if (_savegameOffset == 0) {
if (_isSaveMenu) {
- char *dst = _vm->getTableString(menu.item[0].itemId, _vm->_optionsBuffer, 0);
- const char *src = _vm->getTableString(_vm->gameFlags().isTalkie ? 10 : 18, _vm->_optionsBuffer, 0);
+ char *dst = getTableString(menu.item[0].itemId);
+ const char *src = getTableString(_vm->gameFlags().isTalkie ? 10 : 18);
strcpy(dst, src);
menu.item[0].saveSlot = -2;
menu.item[0].enabled = true;
} else {
- char *dst = _vm->getTableString(menu.item[0].itemId, _vm->_optionsBuffer, 0);
- const char *src = _vm->getTableString(_vm->gameFlags().isTalkie ? 34 : 42, _vm->_optionsBuffer, 0);
+ char *dst = getTableString(menu.item[0].itemId);
+ const char *src = getTableString(_vm->gameFlags().isTalkie ? 34 : 42);
strcpy(dst, src);
}
}
@@ -1261,121 +507,12 @@ int GUI_v2::scrollDownButton(Button *button) {
return 0;
}
-#pragma mark -
-
-int GUI_v2::quitGame(Button *caller) {
- updateMenuButton(caller);
- if (choiceDialog(_vm->gameFlags().isTalkie ? 0xF : 0x17, 1)) {
- _displayMenu = false;
- _vm->_runFlag = false;
- _vm->_sound->beginFadeOut();
- _screen->fadeToBlack();
- _screen->clearCurPage();
- }
-
- if (_vm->_runFlag) {
- initMenu(*_currentMenu);
- updateAllMenuButtons();
- }
-
- return 0;
-}
-
int GUI_v2::resumeGame(Button *caller) {
updateMenuButton(caller);
_displayMenu = false;
return 0;
}
-int GUI_v2::gameOptions(Button *caller) {
- updateMenuButton(caller);
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- initMenu(_gameOptions);
- _isOptionsMenu = true;
-
- const int menuX = _gameOptions.x;
- const int menuY = _gameOptions.y;
-
- for (int i = 0; i < 4; ++i) {
- int x = menuX + _sliderBarsPosition[i*2+0];
- int y = menuY + _sliderBarsPosition[i*2+1];
- _screen->drawShape(0, _vm->_buttonShapes[16], x, y, 0, 0);
- drawSliderBar(i, _vm->_buttonShapes[17]);
- _sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[0][i].x = x;
- _sliderButtons[0][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
- _sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[2][i].x = x + 10;
- _sliderButtons[2][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
- _sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[1][i].x = x + 120;
- _sliderButtons[1][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
- }
-
- while (_isOptionsMenu) {
- processHighlights(_gameOptions, _vm->_mouseX, _vm->_mouseY);
- getInput();
- }
-
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
-
- _vm->writeSettings();
-
- initMenu(*_currentMenu);
- updateAllMenuButtons();
-
- return 0;
-}
-
-int GUI_v2::gameOptionsTalkie(Button *caller) {
- updateMenuButton(caller);
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- bool textEnabled = _vm->textEnabled();
- int lang = _vm->_lang;
-
- setupOptionsButtons();
- initMenu(_gameOptions);
- _isOptionsMenu = true;
-
- while (_isOptionsMenu) {
- processHighlights(_gameOptions, _vm->_mouseX, _vm->_mouseY);
- getInput();
- }
-
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
-
- if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
- _vm->_configVoice = 1;
- choiceDialog(0x1E, 0);
- }
-
- if (_vm->_lang != lang) {
- _reloadTemporarySave = true;
- _vm->saveGame(_vm->getSavegameFilename(999), "Temporary Kyrandia 2 Savegame");
- _vm->loadCCodeBuffer("C_CODE.XXX");
- if (_vm->_flags.isTalkie)
- _vm->loadOptionsBuffer("OPTIONS.XXX");
- else
- _vm->_optionsBuffer = _vm->_cCodeBuffer;
- _vm->loadChapterBuffer(_vm->_newChapterFile);
- _vm->loadNPCScript();
- _vm->setupLangButtonShapes();
- }
-
- _vm->writeSettings();
-
- initMenu(*_currentMenu);
- updateAllMenuButtons();
- return 0;
-}
-
int GUI_v2::quitOptionsMenu(Button *caller) {
updateMenuButton(caller);
_isOptionsMenu = false;
@@ -1388,16 +525,7 @@ int GUI_v2::toggleWalkspeed(Button *caller) {
_vm->_configWalkspeed = 3;
else
_vm->_configWalkspeed = 5;
- _vm->_timer->setDelay(0, _vm->_configWalkspeed);
- setupOptionsButtons();
- renewHighlight(_gameOptions);
- return 0;
-}
-
-int GUI_v2::changeLanguage(Button *caller) {
- updateMenuButton(caller);
- ++_vm->_lang;
- _vm->_lang %= 3;
+ _vm->setWalkspeed(_vm->_configWalkspeed);
setupOptionsButtons();
renewHighlight(_gameOptions);
return 0;
@@ -1423,256 +551,12 @@ int GUI_v2::toggleText(Button *caller) {
return 0;
}
-void GUI_v2::setupOptionsButtons() {
- if (_vm->_configWalkspeed == 3)
- _gameOptions.item[0].itemId = 28;
- else
- _gameOptions.item[0].itemId = 27;
-
- if (_vm->textEnabled())
- _gameOptions.item[2].itemId = 18;
- else
- _gameOptions.item[2].itemId = 17;
-
- switch (_vm->_lang) {
- case 0:
- _gameOptions.item[1].itemId = 31;
- break;
-
- case 1:
- _gameOptions.item[1].itemId = 32;
- break;
-
- case 2:
- _gameOptions.item[1].itemId = 33;
- break;
-
- default:
- break;
- }
-}
-
-int GUI_v2::audioOptions(Button *caller) {
- updateMenuButton(caller);
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- initMenu(_audioOptions);
- const int menuX = _audioOptions.x;
- const int menuY = _audioOptions.y;
- const int maxButton = 3; // 2 if voc is disabled
-
- for (int i = 0; i < maxButton; ++i) {
- int x = menuX + _sliderBarsPosition[i*2+0];
- int y = menuY + _sliderBarsPosition[i*2+1];
- _screen->drawShape(0, _vm->_buttonShapes[16], x, y, 0, 0);
- drawSliderBar(i, _vm->_buttonShapes[17]);
- _sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[0][i].x = x;
- _sliderButtons[0][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
- _sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[2][i].x = x + 10;
- _sliderButtons[2][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
- _sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
- _sliderButtons[1][i].x = x + 120;
- _sliderButtons[1][i].y = y;
- _menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
- }
-
- _isOptionsMenu = true;
- updateAllMenuButtons();
- bool speechEnabled = _vm->speechEnabled();
- while (_isOptionsMenu) {
- processHighlights(_audioOptions, _vm->_mouseX, _vm->_mouseY);
- getInput();
- }
-
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine::kVolumeSpeech) == 2)) {
- _vm->_configVoice = 0;
- _vm->setVolume(KyraEngine::kVolumeSpeech, 75);
- choiceDialog(0x1D, 0);
- }
-
- _vm->writeSettings();
-
- initMenu(*_currentMenu);
- updateAllMenuButtons();
- return 0;
-}
-
-int GUI_v2::sliderHandler(Button *caller) {
- int button = 0;
- if (caller->index >= 24 && caller->index <= 27)
- button = caller->index - 24;
- else if (caller->index >= 28 && caller->index <= 31)
- button = caller->index - 28;
- else
- button = caller->index - 32;
-
- assert(button >= 0 && button <= 3);
-
- int oldVolume = 0;
-
- if (_vm->gameFlags().isTalkie) {
- oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
- } else {
- if (button < 2)
- oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
- else if (button == 2)
- oldVolume = (_vm->_configWalkspeed == 3) ? 97 : 2;
- else if (button == 3)
- oldVolume = _vm->_configTextspeed;
- }
-
- int newVolume = oldVolume;
-
- if (caller->index >= 24 && caller->index <= 27)
- newVolume -= 10;
- else if (caller->index >= 28 && caller->index <= 31)
- newVolume += 10;
- else
- newVolume = _vm->_mouseX - caller->x - 7;
-
- newVolume = MAX(2, newVolume);
- newVolume = MIN(97, newVolume);
-
- if (newVolume == oldVolume)
- return 0;
-
- int lastMusicCommand = -1;
- bool playSoundEffect = false;
-
- drawSliderBar(button, _vm->_buttonShapes[18]);
-
- if (_vm->gameFlags().isTalkie) {
- if (button == 2) {
- if (_vm->textEnabled())
- _vm->_configVoice = 2;
- else
- _vm->_configVoice = 1;
- }
-
- _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
-
- switch (button) {
- case 0:
- lastMusicCommand = _vm->_lastMusicCommand;
- break;
-
- case 1:
- playSoundEffect = true;
- break;
-
- case 2:
- _vm->playVoice(90, 28);
- break;
-
- default:
- return 0;
- }
- } else {
- if (button < 2) {
- _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
- if (button == 0)
- lastMusicCommand = _vm->_lastMusicCommand;
- else
- playSoundEffect = true;
- } else if (button == 2) {
- _vm->_configWalkspeed = (newVolume > 48) ? 3 : 5;
- _vm->setWalkspeed(_vm->_configWalkspeed);
- } else if (button == 3) {
- _vm->_configTextspeed = newVolume;
- }
- }
-
- drawSliderBar(button, _vm->_buttonShapes[17]);
- if (playSoundEffect)
- _vm->snd_playSoundEffect(0x18);
- else if (lastMusicCommand >= 0)
- _vm->snd_playWanderScoreViaMap(lastMusicCommand, 1);
-
- _screen->updateScreen();
- return 0;
-}
-
-void GUI_v2::drawSliderBar(int slider, const uint8 *shape) {
- const int menuX = _audioOptions.x;
- const int menuY = _audioOptions.y;
- int x = menuX + _sliderBarsPosition[slider*2+0] + 10;
- int y = menuY + _sliderBarsPosition[slider*2+1];
-
- int position = 0;
- if (_vm->gameFlags().isTalkie) {
- position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
- } else {
- if (slider < 2)
- position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
- else if (slider == 2)
- position = (_vm->_configWalkspeed == 3) ? 97 : 2;
- else if (slider == 3)
- position = _vm->_configTextspeed;
- }
-
- position = MAX(2, position);
- position = MIN(97, position);
- _screen->drawShape(0, shape, x+position, y, 0, 0);
-}
-
-int GUI_v2::loadMenu(Button *caller) {
- updateSaveList();
-
- if (!_vm->_menuDirectlyToLoad) {
- updateMenuButton(caller);
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- }
-
- _savegameOffset = 0;
- setupSavegameNames(_loadMenu, 5);
- initMenu(_loadMenu);
- _isLoadMenu = true;
- _noLoadProcess = false;
- _vm->_gameToLoad = -1;
- updateAllMenuButtons();
-
- _screen->updateScreen();
- while (_isLoadMenu) {
- processHighlights(_loadMenu, _vm->_mouseX, _vm->_mouseY);
- getInput();
- }
-
- if (_noLoadProcess) {
- if (!_vm->_menuDirectlyToLoad) {
- restorePage1(_vm->_screenBuffer);
- backUpPage1(_vm->_screenBuffer);
- initMenu(*_currentMenu);
- updateAllMenuButtons();
- }
- } else if (_vm->_gameToLoad >= 0) {
- restorePage1(_vm->_screenBuffer);
- restorePalette();
- _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
- if (_vm->_gameToLoad == 0) {
- _restartGame = true;
- for (int i = 0; i < 23; ++i)
- _vm->resetCauldronStateTable(i);
- _vm->runStartScript(1, 1);
- }
- _displayMenu = false;
- _loadedSave = true;
- }
-
- return 0;
-}
-
int GUI_v2::clickLoadSlot(Button *caller) {
updateMenuButton(caller);
-
- assert((caller->index-0x10) >= 0 && (caller->index-0x10 <= 6));
- MenuItem &item = _loadMenu.item[caller->index-0x10];
+
+ int index = caller->index - _menuButtons[0].index;
+ assert(index >= 0 && index <= 6);
+ MenuItem &item = _loadMenu.item[index];
if (item.saveSlot >= 0) {
_vm->_gameToLoad = item.saveSlot;
@@ -1733,8 +617,9 @@ int GUI_v2::saveMenu(Button *caller) {
int GUI_v2::clickSaveSlot(Button *caller) {
updateMenuButton(caller);
- assert((caller->index-0x10) >= 0 && (caller->index-0x10 <= 6));
- MenuItem &item = _saveMenu.item[caller->index-0x10];
+ int index = caller->index - _menuButtons[0].index;
+ assert(index >= 0 && index <= 6);
+ MenuItem &item = _saveMenu.item[index];
if (item.saveSlot >= 0) {
if (_isDeleteMenu) {
@@ -1743,7 +628,7 @@ int GUI_v2::clickSaveSlot(Button *caller) {
return 0;
} else {
_saveSlot = item.saveSlot;
- strcpy(_saveDescription, _vm->getTableString(item.itemId, _vm->_optionsBuffer, 0));
+ strcpy(_saveDescription, getTableString(item.itemId));
}
} else if (item.saveSlot == -2) {
_saveSlot = getNextSavegameSlot();
@@ -1754,8 +639,8 @@ int GUI_v2::clickSaveSlot(Button *caller) {
backUpPage1(_vm->_screenBuffer);
initMenu(_savenameMenu);
- _screen->fillRect(0x26, 0x5B, 0x11F, 0x66, 0xFA);
- const char *desc = nameInputProcess(_saveDescription, 0x27, 0x5C, 0xFD, 0xFA, 0xFE, 0x50);
+ _screen->fillRect(0x26, 0x5B, 0x11F, 0x66, textFieldColor2());
+ const char *desc = nameInputProcess(_saveDescription, 0x27, 0x5C, textFieldColor1(), textFieldColor2(), textFieldColor3(), 0x50);
restorePage1(_vm->_screenBuffer);
backUpPage1(_vm->_screenBuffer);
if (desc) {
diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h
index b5a25d29bf..4e94b58742 100644
--- a/engines/kyra/gui_v2.h
+++ b/engines/kyra/gui_v2.h
@@ -28,6 +28,8 @@
#include "kyra/gui.h"
+namespace Kyra {
+
#define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t) \
button.nextButton = 0; \
button.index = a; \
@@ -89,34 +91,46 @@
item.labelY = p; \
item.unk1F = q
-namespace Kyra {
-
class KyraEngine_v2;
class Screen_v2;
class GUI_v2 : public GUI {
-friend class KyraEngine_v2;
public:
- GUI_v2(KyraEngine_v2 *engine);
+ GUI_v2(KyraEngine_v2 *vm);
+
+ virtual void initStaticData() = 0;
Button *addButtonToList(Button *list, Button *newButton);
void processButton(Button *button);
int processButtonList(Button *button, uint16 inputFlag);
- int optionsButton(Button *button);
-private:
+protected:
+ void updateButton(Button *button);
+
+ KyraEngine_v2 *_vm;
+ Screen_v2 *_screen;
+
+ bool _buttonListChanged;
+ Button *_backUpButtonList;
+ Button *_unknownButtonList;
+
+protected:
+ virtual void setupPalette() {}
+ virtual void restorePalette() {}
+
+ virtual char *getTableString(int id) = 0;
+
+ virtual uint8 textFieldColor1() const = 0;
+ virtual uint8 textFieldColor2() const = 0;
+ virtual uint8 textFieldColor3() const = 0;
+protected:
void getInput();
Button _menuButtons[7];
Button _scrollUpButton;
Button _scrollDownButton;
Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _savenameMenu, _deathMenu;
- void initStaticData();
-
- const char *getMenuTitle(const Menu &menu);
- const char *getMenuItemTitle(const MenuItem &menuItem);
- const char *getMenuItemLabel(const MenuItem &menuItem);
Button *getButtonListData() { return _menuButtons; }
@@ -132,26 +146,11 @@ private:
Button _sliderButtons[3][4];
- uint8 defaultColor1() const { return 0xCF; }
- uint8 defaultColor2() const { return 0xF8; }
-
void renewHighlight(Menu &menu);
- void setupPalette();
- void restorePalette();
-
void backUpPage1(uint8 *buffer);
void restorePage1(const uint8 *buffer);
- void resetState(int item);
-
- KyraEngine_v2 *_vm;
- Screen_v2 *_screen;
-
- bool _buttonListChanged;
- Button *_backUpButtonList;
- Button *_unknownButtonList;
-
Menu *_currentMenu;
bool _isLoadMenu;
bool _isDeathMenu;
@@ -169,33 +168,13 @@ private:
void setupSavegameNames(Menu &menu, int num);
// main menu
- int quitGame(Button *caller);
int resumeGame(Button *caller);
- // options menu
- int gameOptions(Button *caller);
- int gameOptionsTalkie(Button *caller);
- int quitOptionsMenu(Button *caller);
-
- int toggleWalkspeed(Button *caller);
- int changeLanguage(Button *caller);
- int toggleText(Button *caller);
-
- void setupOptionsButtons();
-
// audio menu
- int audioOptions(Button *caller);
-
- Button::Callback _sliderHandlerFunctor;
- int sliderHandler(Button *caller);
-
- void drawSliderBar(int slider, const uint8 *shape);
-
static const int _sliderBarsPosition[];
// load menu
bool _noLoadProcess;
- int loadMenu(Button *caller);
int clickLoadSlot(Button *caller);
int cancelLoadMenu(Button *caller);
@@ -212,6 +191,18 @@ private:
int _slotToDelete;
int deleteMenu(Button *caller);
+ // options menu
+ int quitOptionsMenu(Button *caller);
+
+ int toggleWalkspeed(Button *caller);
+ int toggleText(Button *caller);
+
+ virtual void setupOptionsButtons() = 0;
+
+ // audio options
+ Button::Callback _sliderHandlerFunctor;
+ virtual int sliderHandler(Button *caller) = 0;
+
// savename menu
bool _finishNameInput, _cancelNameInput;
Common::KeyState _keyPressed;
@@ -232,8 +223,6 @@ private:
int choiceYes(Button *caller);
int choiceNo(Button *caller);
- static const uint16 _menuStringsTalkie[];
- static const uint16 _menuStringsOther[];
};
} // end of namespace Kyra
diff --git a/engines/kyra/gui_v3.cpp b/engines/kyra/gui_v3.cpp
deleted file mode 100644
index c797ca0812..0000000000
--- a/engines/kyra/gui_v3.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "kyra/kyra_v3.h"
-#include "kyra/text_v3.h"
-#include "kyra/wsamovie.h"
-
-namespace Kyra {
-
-void KyraEngine_v3::showMessage(const char *string, uint8 c0, uint8 c1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::showMessage('%s', %d, %d)", string, c0, c1);
- _shownMessage = string;
- _screen->hideMouse();
-
- restoreCommandLine();
- _restoreCommandLine = false;
-
- if (string) {
- int x = _text->getCenterStringX(string, 0, 320);
- int pageBackUp = _screen->_curPage;
- _screen->_curPage = 0;
- _text->printText(string, x, _commandLineY, c0, c1, 0);
- _screen->_curPage = pageBackUp;
- _screen->updateScreen();
- setCommandLineRestoreTimer(7);
- }
-
- _screen->showMouse();
-}
-
-void KyraEngine_v3::showMessageFromCCode(int string, uint8 c0, int) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::showMessageFromCCode(%d, %d, -)", string, c0);
- showMessage((const char*)getTableEntry(_cCodeFile, string), c0, 0xF0);
-}
-
-void KyraEngine_v3::updateItemCommand(int item, int str, uint8 c0) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateItemCommand(%d, %d, %d)", item, str, c0);
- char buffer[100];
- char *src = (char*)getTableEntry(_itemFile, item);
-
- while (*src != ' ')
- ++src;
- ++src;
-
- *src = toupper(*src);
-
- strcpy(buffer, src);
- strcat(buffer, " ");
- strcat(buffer, (const char*)getTableEntry(_cCodeFile, str));
-
- showMessage(buffer, c0, 0xF0);
-}
-
-void KyraEngine_v3::updateCommandLine() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCommandLine()");
- if (_restoreCommandLine) {
- restoreCommandLine();
- _restoreCommandLine = false;
- }
-}
-
-void KyraEngine_v3::restoreCommandLine() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::restoreCommandLine()");
- int y = _inventoryState ? 144 : 188;
- _screen->copyBlockToPage(0, 0, y, 320, 12, _interfaceCommandLine);
-}
-
-void KyraEngine_v3::updateCLState() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCLState()");
- if (_inventoryState)
- _commandLineY = 145;
- else
- _commandLineY = 189;
-}
-
-void KyraEngine_v3::showInventory() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::showInventory()");
- if (!_screen->isMouseVisible())
- return;
- if (queryGameFlag(3))
- return;
-
- _screen->copyBlockToPage(3, 0, 0, 320, 56, _interface);
- drawMalcolmsMoodText();
-
- _inventoryState = true;
- updateCLState();
-
- redrawInventory(30);
- drawMalcolmsMoodPointer(-1, 30);
- //XXX
-
- if (queryGameFlag(0x97))
- drawJestersStaff(1, 30);
-
- _screen->hideMouse();
-
- if (_itemInHand < 0) {
- _handItemSet = -1;
- _screen->setMouseCursor(0, 0, getShapePtr(0));
- }
-
- _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
-
- if (_inventoryScrollSpeed == -1) {
- uint32 endTime = _system->getMillis() + _tickLength * 15;
- int times = 0;
- while (_system->getMillis() < endTime) {
- _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
- _screen->copyRegion(0, 188, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
- ++times;
- }
-
- times = MAX(times, 1);
-
- int speed = 60 / times;
- if (speed <= 1)
- _inventoryScrollSpeed = 1;
- else if (speed >= 8)
- _inventoryScrollSpeed = 8;
- else
- _inventoryScrollSpeed = speed;
- }
-
- int height = 12;
- int y = 188;
- int times = 0;
- uint32 waitTill = _system->getMillis() + _tickLength;
-
- while (y > 144) {
- _screen->copyRegion(0, 0, 0, y, 320, height, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- ++times;
- if (_inventoryScrollSpeed == 1 && times == 3) {
- while (waitTill > _system->getMillis())
- _system->delayMillis(10);
- times = 0;
- waitTill = _system->getMillis() + _tickLength;
- }
-
- height += _inventoryScrollSpeed;
- y -= _inventoryScrollSpeed;
- }
-
- _screen->copyRegion(0, 0, 0, 144, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- //initInventoryButtonList(0);
-
- restorePage3();
- _screen->showMouse();
-}
-
-void KyraEngine_v3::hideInventory() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::hideInventory()");
- if (queryGameFlag(3))
- return;
-
- _inventoryState = false;
- updateCLState();
- //initInventoryButtonList(1);
-
- _screen->copyBlockToPage(3, 0, 0, 320, 56, _interface);
- _screen->hideMouse();
-
- restorePage3();
- flagAnimObjsForRefresh();
- drawAnimObjects();
- _screen->copyRegion(0, 144, 0, 0, 320, 56, 0, 2, Screen::CR_NO_P_CHECK);
-
- if (_inventoryScrollSpeed == -1) {
- uint32 endTime = _system->getMillis() + _tickLength * 15;
- int times = 0;
- while (_system->getMillis() < endTime) {
- _screen->copyRegion(0, 144, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
- _screen->copyRegion(0, 144, 0, 0, 320, 12, 0, 2, Screen::CR_NO_P_CHECK);
- ++times;
- }
-
- times = MAX(times, 1);
-
- int speed = 60 / times;
- if (speed <= 1)
- _inventoryScrollSpeed = 1;
- else if (speed >= 8)
- _inventoryScrollSpeed = 8;
- else
- _inventoryScrollSpeed = speed;
- }
-
- int y = 144;
- int y2 = 144 + _inventoryScrollSpeed;
- uint32 waitTill = _system->getMillis() + _tickLength;
- int times = 0;
-
- while (y2 < 188) {
- _screen->copyRegion(0, 0, 0, y2, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->copyRegion(0, y, 0, y, 320, _inventoryScrollSpeed, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- ++times;
- if (_inventoryScrollSpeed == 1 && times == 3) {
- while (waitTill > _system->getMillis())
- _system->delayMillis(10);
- times = 0;
- waitTill = _system->getMillis() + _tickLength;
- }
-
- y += _inventoryScrollSpeed;
- y2 += _inventoryScrollSpeed;
- }
-
- _screen->copyRegion(0, 0, 0, 188, 320, 56, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->copyRegion(0, y, 0, y, 320, 188-y, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->showMouse();
-}
-
-void KyraEngine_v3::drawMalcolmsMoodText() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodText()");
- static const int stringId[] = { 0x32, 0x37, 0x3C };
-
- if (queryGameFlag(0x219))
- return;
-
- const char *string = (const char*)getTableEntry(_cCodeFile, stringId[_malcolmsMood]);
-
- Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT);
- _screen->_charWidth = -2;
-
- int width = _screen->getTextWidth(string);
-
- _screen->_charWidth = 0;
- _screen->setFont(oldFont);
-
- int pageBackUp = _screen->_curPage;
- const int x = 280 - (width / 2);
- int y = 0;
- if (_inventoryState) {
- y = 189;
- _screen->_curPage = 0;
- } else {
- y = 45;
- _screen->_curPage = 2;
- }
-
- _screen->hideMouse();
- _screen->drawShape(_screen->_curPage, getShapePtr(432), 244, 189, 0, 0);
- _text->printText(string, x, y+1, 0xFF, 0xF0, 0x00);
- _screen->showMouse();
- _screen->_curPage = pageBackUp;
-}
-
-void KyraEngine_v3::drawMalcolmsMoodPointer(int frame, int page) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodPointer(%d, %d)", frame, page);
- static const int stateTable[] = {
- 1, 6, 11
- };
-
- if (frame == -1)
- frame = stateTable[_malcolmsMood];
- if (queryGameFlag(0x219))
- frame = 13;
-
- if (page == 0) {
- _invWsa->setX(0);
- _invWsa->setY(0);
- _invWsa->setDrawPage(0);
- _invWsa->displayFrame(frame, 0);
- _screen->updateScreen();
- } else if (page == 30) {
- _invWsa->setX(0);
- _invWsa->setY(-144);
- _invWsa->setDrawPage(2);
- _invWsa->displayFrame(frame, 0);
- }
-
- _invWsaFrame = frame;
-}
-
-void KyraEngine_v3::drawJestersStaff(int type, int page) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::drawJestersStaff(%d, %d)", type, page);
- int y = 155;
- if (page == 30) {
- page = 2;
- y -= 144;
- }
-
- int shape = (type != 0) ? 454 : 453;
- _screen->drawShape(page, getShapePtr(shape), 217, y, 0, 0);
-}
-
-void KyraEngine_v3::redrawInventory(int page) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::redrawInventory(%d)", page);
- int yOffset = 0;
-
- if (page == 30) {
- page = 2;
- yOffset = -144;
- }
-
- int pageBackUp = _screen->_curPage;
- _screen->_curPage = page;
- _screen->hideMouse();
-
- for (int i = 0; i < 10; ++i) {
- clearInventorySlot(i, page);
- if (_mainCharacter.inventory[i] != 0xFFFF) {
- _screen->drawShape(page, getShapePtr(_mainCharacter.inventory[i]+248), _inventoryX[i], _inventoryY[i] + yOffset, 0, 0);
- drawInventorySlot(page, _mainCharacter.inventory[i], i);
- }
- }
-
- _screen->showMouse();
- _screen->_curPage = pageBackUp;
-
- if (page == 0 || page == 1)
- _screen->updateScreen();
-}
-
-void KyraEngine_v3::clearInventorySlot(int slot, int page) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::clearInventorySlot(%d, %d)", slot, page);
- int yOffset = 0;
- if (page == 30) {
- page = 2;
- yOffset = -144;
- }
-
- _screen->drawShape(page, getShapePtr(slot+422), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0);
-}
-
-void KyraEngine_v3::drawInventorySlot(int page, int item, int slot) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::drawInventorySlot(%d, %d, %d)", page, item, slot);
- int yOffset = 0;
- if (page == 30) {
- page = 2;
- yOffset = -144;
- }
-
- _screen->drawShape(page, getShapePtr(item+248), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0);
-}
-
-} // end of namespace Kyra
-
diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp
new file mode 100644
index 0000000000..da3062fe2c
--- /dev/null
+++ b/engines/kyra/items_hof.cpp
@@ -0,0 +1,448 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_hof.h"
+
+namespace Kyra {
+
+int KyraEngine_HoF::checkItemCollision(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::checkItemCollision(%d, %d)", x, y);
+ int itemPos = -1, yPos = -1;
+
+ for (int i = 0; i < 30; ++i) {
+ const Item &curItem = _itemList[i];
+
+ if (curItem.id == 0xFFFF || curItem.sceneId != _mainCharacter.sceneId)
+ continue;
+
+ int itemX1 = curItem.x - 8 - 3;
+ int itemX2 = curItem.x + 7 + 3;
+
+ if (x < itemX1 || x > itemX2)
+ continue;
+
+ int itemY1 = curItem.y - _itemHtDat[curItem.id] - 3;
+ int itemY2 = curItem.y + 3;
+
+ if (y < itemY1 || y > itemY2)
+ continue;
+
+ if (curItem.y >= yPos) {
+ itemPos = i;
+ yPos = curItem.y;
+ }
+ }
+
+ return itemPos;
+}
+
+void KyraEngine_HoF::updateWaterFlasks() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::updateWaterFlasks()");
+ for (int i = 22; i < 24; i++) {
+ if (_itemInHand == i)
+ setHandItem(i - 1);
+
+ for (int ii = 0; ii < 20; ii++) {
+ if (_mainCharacter.inventory[ii] == i) {
+ _mainCharacter.inventory[ii]--;
+ if (ii < 10) {
+ clearInventorySlot(ii, 0);
+ _screen->drawShape(0, getShapePtr(i + 63), _inventoryX[ii], _inventoryY[ii], 0, 0);
+ }
+ }
+ }
+
+ for (int ii = 0; ii < 30; ii++) {
+ if (_itemList[ii].id == i)
+ _itemList[ii].id--;
+ }
+ }
+}
+
+bool KyraEngine_HoF::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::dropItem(%d, %u, %d, %d, %d)", unk1, item, x, y, unk2);
+ if (_handItemSet <= -1)
+ return false;
+
+ bool success = processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2);
+ if (!success) {
+ snd_playSoundEffect(0x0d);
+ if (countAllItems() >= 30)
+ showMessageFromCCode(5, 0x84, 0);
+ }
+
+ return success;
+}
+
+bool KyraEngine_HoF::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::processItemDrop(%u, %u, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
+ int itemPos = checkItemCollision(x, y);
+
+ if (unk1)
+ itemPos = -1;
+
+ if (itemPos >= 0) {
+ exchangeMouseItem(itemPos);
+ return false;
+ }
+
+ int freeItemSlot = -1;
+
+ if (unk1 != 3) {
+ for (int i = 0; i < 30; ++i) {
+ if (_itemList[i].id == 0xFFFF) {
+ freeItemSlot = i;
+ break;
+ }
+ }
+ }
+
+ if (freeItemSlot == -1)
+ return false;
+
+ if (sceneId != _mainCharacter.sceneId) {
+ _itemList[freeItemSlot].x = x;
+ _itemList[freeItemSlot].y = y;
+ _itemList[freeItemSlot].id = item;
+ _itemList[freeItemSlot].sceneId = sceneId;
+ return true;
+ }
+
+ int itemHeight = _itemHtDat[item];
+
+ // no idea why it's '&&' here and not single checks for x and y
+ if (x == -1 && y == -1) {
+ x = _rnd.getRandomNumberRng(0x10, 0x130);
+ y = _rnd.getRandomNumberRng(0x10, 0x87);
+ }
+
+ int posX = x, posY = y;
+ int itemX = -1, itemY = -1;
+ bool needRepositioning = true;
+
+ while (needRepositioning) {
+ if ((_screen->getDrawLayer(posX, posY) <= 1 && _screen->getDrawLayer2(posX, posY, itemHeight) <= 1 && isDropable(posX, posY)) || posY == 136) {
+ int posX2 = posX, posX3 = posX;
+ bool repositioning = true;
+
+ while (repositioning) {
+ if (isDropable(posX3, posY) && _screen->getDrawLayer(posX3, posY) < 7 && checkItemCollision(posX3, posY) == -1) {
+ itemX = posX3;
+ itemY = posY;
+ needRepositioning = false;
+ repositioning = false;
+ }
+
+ if (isDropable(posX2, posY) && _screen->getDrawLayer(posX2, posY) < 7 && checkItemCollision(posX2, posY) == -1) {
+ itemX = posX2;
+ itemY = posY;
+ needRepositioning = false;
+ repositioning = false;
+ }
+
+ if (repositioning) {
+ posX3 = MAX(posX3 - 2, 16);
+ posX2 = MIN(posX2 + 2, 304);
+
+ if (posX3 <= 16 && posX2 >= 304)
+ repositioning = false;
+ }
+ }
+ }
+
+ if (posY == 136)
+ needRepositioning = false;
+ else
+ posY = MIN(posY + 2, 136);
+ }
+
+ if (itemX == -1 || itemY == -1)
+ return false;
+
+ if (unk1 == 3) {
+ _itemList[freeItemSlot].x = itemX;
+ _itemList[freeItemSlot].y = itemY;
+ return true;
+ } else if (unk1 == 2) {
+ itemDropDown(x, y, itemX, itemY, freeItemSlot, item);
+ }
+
+ if (!unk1)
+ removeHandItem();
+
+ itemDropDown(x, y, itemX, itemY, freeItemSlot, item);
+
+ if (!unk1 && unk2) {
+ int itemStr = 3;
+ if (_lang == 1)
+ itemStr = getItemCommandStringDrop(item);
+ updateCommandLineEx(item+54, itemStr, 0xD6);
+ }
+
+ return true;
+}
+
+void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::itemDropDown(%d, %d, %d, %d, %d, %u)", startX, startY, dstX, dstY, itemSlot, item);
+ uint8 *itemShape = getShapePtr(item + 64);
+
+ if (startX == dstX && startY == dstY) {
+ if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
+ updateCharFacing();
+ snd_playSoundEffect(0x2d);
+ removeHandItem();
+ objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
+ } else {
+ _itemList[itemSlot].x = dstX;
+ _itemList[itemSlot].y = dstY;
+ _itemList[itemSlot].id = item;
+ _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
+ snd_playSoundEffect(0x0c);
+ addItemToAnimList(itemSlot);
+ }
+ } else {
+ _screen->hideMouse();
+
+ if (startY <= dstY) {
+ int speed = 2;
+ int curY = startY;
+ int curX = startX - 8;
+
+ backUpGfxRect24x24(curX, curY-16);
+ while (curY < dstY) {
+ restoreGfxRect24x24(curX, curY-16);
+
+ curY = MIN(curY + speed, dstY);
+ ++speed;
+
+ backUpGfxRect24x24(curX, curY-16);
+ uint32 endDelay = _system->getMillis() + _tickLength;
+
+ _screen->drawShape(0, itemShape, curX, curY-16, 0, 0);
+ _screen->updateScreen();
+
+ // XXX: original doesn't update game state while delaying
+ // our implementation *could* do it, so maybe check this again
+ delayUntil(endDelay);
+ }
+
+ if (dstX != dstY || (dstY - startY > 16)) {
+ snd_playSoundEffect(0x69);
+ speed = MAX(speed, 6);
+ int speedX = ((dstX - startX) << 4) / speed;
+ int origSpeed = speed;
+ speed >>= 1;
+
+ if (dstY - startY <= 8)
+ speed >>= 1;
+
+ speed = -speed;
+
+ curX = startX << 4;
+
+ int x = 0, y = 0;
+ while (--origSpeed) {
+ x = (curX >> 4) - 8;
+ y = curY - 16;
+
+ restoreGfxRect24x24(x, y);
+ curY = MIN(curY + speed, dstY);
+ curX += speedX;
+ ++speed;
+
+ x = (curX >> 4) - 8;
+ y = curY - 16;
+ backUpGfxRect24x24(x, y);
+
+ uint16 endDelay = _system->getMillis() + _tickLength;
+ _screen->drawShape(0, itemShape, x, y, 0, 0);
+ _screen->updateScreen();
+
+ // XXX: original doesn't update game state while delaying
+ // our implementation *could* do it, so maybe check this again
+ delayUntil(endDelay);
+ }
+
+ restoreGfxRect24x24(x, y);
+ } else {
+ restoreGfxRect24x24(curX, curY-16);
+ }
+ }
+
+ if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
+ updateCharFacing();
+ snd_playSoundEffect(0x2d);
+ removeHandItem();
+ _screen->showMouse();
+ objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
+ } else {
+ _itemList[itemSlot].x = dstX;
+ _itemList[itemSlot].y = dstY;
+ _itemList[itemSlot].id = item;
+ _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
+ snd_playSoundEffect(0x0c);
+ addItemToAnimList(itemSlot);
+ _screen->showMouse();
+ }
+ }
+}
+
+void KyraEngine_HoF::exchangeMouseItem(int itemPos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::exchangeMouseItem(%d)", itemPos);
+ _screen->hideMouse();
+
+ deleteItemAnimEntry(itemPos);
+
+ int itemId = _itemList[itemPos].id;
+ _itemList[itemPos].id = _itemInHand;
+ _itemInHand = itemId;
+
+ addItemToAnimList(itemPos);
+ snd_playSoundEffect(0x0b);
+ setMouseCursor(_itemInHand);
+ int str2 = 7;
+
+ if (_lang == 1)
+ str2 = getItemCommandStringPickUp(itemId);
+
+ updateCommandLineEx(itemId + 54, str2, 0xD6);
+ _screen->showMouse();
+
+ runSceneScript6();
+}
+
+bool KyraEngine_HoF::pickUpItem(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::pickUpItem(%d, %d)", x, y);
+ int itemPos = checkItemCollision(x, y);
+
+ if (itemPos <= -1)
+ return false;
+
+ if (_itemInHand >= 0) {
+ exchangeMouseItem(itemPos);
+ } else {
+ _screen->hideMouse();
+ deleteItemAnimEntry(itemPos);
+ int itemId = _itemList[itemPos].id;
+ _itemList[itemPos].id = 0xFFFF;
+ snd_playSoundEffect(0x0b);
+ setMouseCursor(itemId);
+ int str2 = 7;
+
+ if (_lang == 1)
+ str2 = getItemCommandStringPickUp(itemId);
+
+ updateCommandLineEx(itemId + 54, str2, 0xD6);
+ _itemInHand = itemId;
+ _screen->showMouse();
+
+ runSceneScript6();
+ }
+
+ return true;
+}
+
+bool KyraEngine_HoF::isDropable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::isDropable(%d, %d)", x, y);
+ if (x < 14 || x > 304 || y < 14 || y > 136)
+ return false;
+
+ x -= 8;
+ y -= 1;
+
+ for (int xpos = x; xpos < x + 16; ++xpos) {
+ if (_screen->getShapeFlag1(xpos, y) == 0)
+ return false;
+ }
+
+ return true;
+}
+
+int KyraEngine_HoF::getItemCommandStringDrop(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringDrop(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+
+ static const int dropStringIds[] = {
+ 0x2D, 0x103, 0x003, 0x106
+ };
+ assert(stringId < ARRAYSIZE(dropStringIds));
+
+ return dropStringIds[stringId];
+}
+
+int KyraEngine_HoF::getItemCommandStringPickUp(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringPickUp(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+
+ static const int pickUpStringIds[] = {
+ 0x02B, 0x102, 0x007, 0x105
+ };
+ assert(stringId < ARRAYSIZE(pickUpStringIds));
+
+ return pickUpStringIds[stringId];
+}
+
+int KyraEngine_HoF::getItemCommandStringInv(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringInv(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+
+ static const int pickUpStringIds[] = {
+ 0x02C, 0x104, 0x008, 0x107
+ };
+ assert(stringId < ARRAYSIZE(pickUpStringIds));
+
+ return pickUpStringIds[stringId];
+}
+
+bool KyraEngine_HoF::itemIsFlask(int item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::itemIsFlask(%d)", item);
+ for (int i = 0; _flaskTable[i] != -1; ++i) {
+ if (_flaskTable[i] == item)
+ return true;
+ }
+
+ return false;
+}
+
+void KyraEngine_HoF::setMouseCursor(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::setMouseCursor(%u)", item);
+ int shape = 0;
+ int hotX = 1;
+ int hotY = 1;
+
+ if (item != 0xFFFF) {
+ hotX = 8;
+ hotY = 15;
+ shape = item+64;
+ }
+
+ _screen->setMouseCursor(hotX, hotY, getShapePtr(shape));
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/items_v3.cpp b/engines/kyra/items_mr.cpp
index 23162514c2..8ace9f8a3c 100644
--- a/engines/kyra/items_v3.cpp
+++ b/engines/kyra/items_mr.cpp
@@ -18,33 +18,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL $
+ * $URL$
* $Id$
*
*/
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_mr.h"
#include "kyra/timer.h"
namespace Kyra {
-void KyraEngine_v3::resetItem(int index) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::resetItem(%d)", index);
- _itemList[index].id = 0xFFFF;
- _itemList[index].sceneId = 0xFFFF;
- _itemList[index].x = 0;
- _itemList[index].y = 0;
- _itemList[index].unk8 = 0;
-}
-
-void KyraEngine_v3::resetItemList() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::resetItemList()");
- for (int i = 0; i < 50; ++i)
- resetItem(i);
-}
-
-void KyraEngine_v3::removeTrashItems() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::removeTrashItems()");
+void KyraEngine_MR::removeTrashItems() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::removeTrashItems()");
for (int i = 0; _trashItemList[i] != 0xFF; ++i) {
for (int item = findItem(_trashItemList[i]); item != -1; item = findItem(_trashItemList[i])) {
if (_itemList[item].sceneId != _mainCharacter.sceneId)
@@ -55,47 +40,17 @@ void KyraEngine_v3::removeTrashItems() {
}
}
-int KyraEngine_v3::findFreeItem() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::findFreeItem()");
- for (int i = 0; i < 50; ++i) {
- if (_itemList[i].id == 0xFFFF)
- return i;
- }
- return -1;
-}
-
-int KyraEngine_v3::findItem(uint16 sceneId, uint16 id) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::findItem(%u, %u)", sceneId, id);
- for (int i = 0; i < 50; ++i) {
- if (_itemList[i].id == id && _itemList[i].sceneId == sceneId)
- return i;
- }
- return -1;
-}
-
-int KyraEngine_v3::findItem(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::findItem(%u)", item);
- for (int i = 0; i < 50; ++i) {
- if (_itemList[i].id == item)
+int KyraEngine_MR::findFreeInventorySlot() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::findFreeInventorySlot()");
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == 0xFFFF)
return i;
}
return -1;
}
-int KyraEngine_v3::countAllItems() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::countAllItems()");
- int count = 0;
-
- for (int i = 0; i < 50; ++i) {
- if (_itemList[i].id != 0xFFFF)
- ++count;
- }
-
- return count;
-}
-
-int KyraEngine_v3::checkItemCollision(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::checkItemCollision(%d, %d)", x, y);
+int KyraEngine_MR::checkItemCollision(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::checkItemCollision(%d, %d)", x, y);
int itemIndex = -1;
int maxItemY = -1;
@@ -124,8 +79,8 @@ int KyraEngine_v3::checkItemCollision(int x, int y) {
return itemIndex;
}
-void KyraEngine_v3::setMouseCursor(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::setMouseCursor(%u)", item);
+void KyraEngine_MR::setMouseCursor(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::setMouseCursor(%u)", item);
int shape = 0;
int hotX = 1;
int hotY = 1;
@@ -140,8 +95,8 @@ void KyraEngine_v3::setMouseCursor(uint16 item) {
_screen->setMouseCursor(hotX, hotY, getShapePtr(shape));
}
-void KyraEngine_v3::setItemMouseCursor() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::setItemMouseCursor()");
+void KyraEngine_MR::setItemMouseCursor() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::setItemMouseCursor()");
_handItemSet = _itemInHand;
if (_itemInHand == -1)
_screen->setMouseCursor(0, 0, _gameShapes[0]);
@@ -149,31 +104,8 @@ void KyraEngine_v3::setItemMouseCursor() {
_screen->setMouseCursor(12, 19, _gameShapes[_itemInHand+248]);
}
-void KyraEngine_v3::setHandItem(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::setHandItem(%u)", item);
- _screen->hideMouse();
-
- if (item == 0xFFFF) {
- removeHandItem();
- } else {
- setMouseCursor(item);
- _itemInHand = item;
- }
-
- _screen->showMouse();
-}
-
-void KyraEngine_v3::removeHandItem() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::removeHandItem()");
- _screen->hideMouse();
- _screen->setMouseCursor(0, 0, _gameShapes[0]);
- _itemInHand = -1;
- _handItemSet = -1;
- _screen->showMouse();
-}
-
-bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
+bool KyraEngine_MR::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
if (_handItemSet <= -1)
return false;
@@ -181,7 +113,7 @@ bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
if (processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2))
return true;
- playSoundEffect(13, 200);
+ snd_playSoundEffect(13, 200);
if (countAllItems() >= 50) {
removeTrashItems();
@@ -193,12 +125,12 @@ bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
}
if (!_chatText)
- playSoundEffect(13, 200);
+ snd_playSoundEffect(13, 200);
return false;
}
-bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
+bool KyraEngine_MR::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
int itemPos = checkItemCollision(x, y);
@@ -228,7 +160,6 @@ bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, i
_itemList[freeItemSlot].x = x;
_itemList[freeItemSlot].y = y;
_itemList[freeItemSlot].id = item;
- _itemList[freeItemSlot].unk8 = 1;
_itemList[freeItemSlot].sceneId = sceneId;
return true;
}
@@ -304,14 +235,14 @@ bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, i
return true;
}
-void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item, int remove) {
+void KyraEngine_MR::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item, int remove) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::itemDropDown(%d, %d, %d, %d, %d, %u, %d)", startX, startY, dstX, dstY, itemSlot, item, remove);
if (startX == dstX && startY == dstY) {
_itemList[itemSlot].x = dstX;
_itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
addItemToAnimList(itemSlot);
} else {
uint8 *itemShape = getShapePtr(item + 248);
@@ -340,7 +271,7 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
restoreGfxRect32x32(curX, curY-16);
if (dstX != dstY || (dstY - startY > 16)) {
- playSoundEffect(0x11, 0xC8);
+ snd_playSoundEffect(0x11, 0xC8);
speed = MAX(speed, 6);
int speedX = ((dstX - startX) << 4) / speed;
int origSpeed = speed;
@@ -380,7 +311,7 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
_itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- playSoundEffect(0x0C, 0xC8);
+ snd_playSoundEffect(0x0C, 0xC8);
addItemToAnimList(itemSlot);
_screen->showMouse();
}
@@ -389,9 +320,8 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int
removeHandItem();
}
-void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::exchangeMouseItem(%d, %d)", itemPos, runScript);
- _screen->hideMouse();
+void KyraEngine_MR::exchangeMouseItem(int itemPos, int runScript) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::exchangeMouseItem(%d, %d)", itemPos, runScript);
if (itemListMagic(_itemInHand, itemPos))
return;
@@ -401,6 +331,7 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
return;
}
+ _screen->hideMouse();
deleteItemAnimEntry(itemPos);
int itemId = _itemList[itemPos].id;
@@ -408,7 +339,7 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
_itemInHand = itemId;
addItemToAnimList(itemPos);
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setMouseCursor(_itemInHand);
int str2 = 0;
@@ -422,8 +353,8 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
runSceneScript6();
}
-bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::pickUpItem(%d, %d, %d)", x, y, runScript);
+bool KyraEngine_MR::pickUpItem(int x, int y, int runScript) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::pickUpItem(%d, %d, %d)", x, y, runScript);
int itemPos = checkItemCollision(x, y);
if (itemPos <= -1)
@@ -436,7 +367,7 @@ bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) {
deleteItemAnimEntry(itemPos);
int itemId = _itemList[itemPos].id;
_itemList[itemPos].id = 0xFFFF;
- playSoundEffect(0x0B, 0xC8);
+ snd_playSoundEffect(0x0B, 0xC8);
setMouseCursor(itemId);
int itemString = 0;
@@ -454,8 +385,8 @@ bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) {
return true;
}
-bool KyraEngine_v3::isDropable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::isDropable(%d, %d)", x, y);
+bool KyraEngine_MR::isDropable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::isDropable(%d, %d)", x, y);
if (y < 14 || y > 187)
return false;
@@ -469,12 +400,12 @@ bool KyraEngine_v3::isDropable(int x, int y) {
return true;
}
-bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::itemListMagic(%d, %d)", handItem, itemSlot);
+bool KyraEngine_MR::itemListMagic(int handItem, int itemSlot) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::itemListMagic(%d, %d)", handItem, itemSlot);
uint16 item = _itemList[itemSlot].id;
- if (_curChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) {
- //eelScript();
+ if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) {
+ eelScript();
return true;
} else if ((handItem == 6 || handItem == 7) && item == 2) {
int animObjIndex = -1;
@@ -486,11 +417,11 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
assert(animObjIndex != -1);
_screen->hideMouse();
- playSoundEffect(0x93, 0xC8);
+ snd_playSoundEffect(0x93, 0xC8);
for (int i = 109; i <= 141; ++i) {
- _animObjects[animObjIndex].shapeIndex = i+248;
+ _animObjects[animObjIndex].shapeIndex1 = i+248;
_animObjects[animObjIndex].needRefresh = true;
- delay(1, true);
+ delay(1*_tickLength, true);
}
deleteItemAnimEntry(itemSlot);
@@ -520,9 +451,9 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
uint8 resItem = _itemMagicTable[i+2];
uint8 newItem = _itemMagicTable[i+3];
- playSoundEffect(0x0F, 0xC8);
+ snd_playSoundEffect(0x0F, 0xC8);
- _itemList[itemSlot].id = resItem;
+ _itemList[itemSlot].id = (resItem == 0xFF) ? 0xFFFF : resItem;
_screen->hideMouse();
deleteItemAnimEntry(itemSlot);
@@ -537,28 +468,95 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
if (_lang != 1)
updateItemCommand(resItem, 3, 0xFF);
+ // Unlike the original we give points for when combining with scene items
+ if (resItem == 7) {
+ updateScore(35, 100);
+ delay(60*_tickLength, true);
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+bool KyraEngine_MR::itemInventoryMagic(int handItem, int invSlot) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::itemInventoryMagic(%d, %d)", handItem, invSlot);
+
+ uint16 item = _mainCharacter.inventory[invSlot];
+ if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) {
+ eelScript();
+ return true;
+ } else if ((handItem == 6 || handItem == 7) && item == 2) {
+ _screen->hideMouse();
+ snd_playSoundEffect(0x93, 0xC8);
+ for (int i = 109; i <= 141; ++i) {
+ _mainCharacter.inventory[invSlot] = i;
+ _screen->drawShape(2, getShapePtr(invSlot+422), 0, 144, 0, 0);
+ _screen->drawShape(2, getShapePtr(i+248), 0, 144, 0, 0);
+ _screen->copyRegion(0, 144, _inventoryX[invSlot], _inventoryY[invSlot], 24, 20, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delay(1*_tickLength, true);
+ }
+
+ _mainCharacter.inventory[invSlot] = 0xFFFF;
+ clearInventorySlot(invSlot, 0);
+ _screen->showMouse();
+ return true;
+ }
+
+ for (int i = 0; _itemMagicTable[i] != 0xFF; i += 4) {
+ if (_itemMagicTable[i+0] != handItem || _itemMagicTable[i+1] != item)
+ continue;
+
+ uint8 resItem = _itemMagicTable[i+2];
+ uint8 newItem = _itemMagicTable[i+3];
+
+ snd_playSoundEffect(0x0F, 0xC8);
+
+ _mainCharacter.inventory[invSlot] = (resItem == 0xFF) ? 0xFFFF : resItem;
+
+ _screen->hideMouse();
+ clearInventorySlot(invSlot, 0);
+ drawInventorySlot(0, resItem, invSlot);
+
+ if (newItem == 0xFE)
+ removeHandItem();
+ else if (newItem != 0xFF)
+ setHandItem(newItem);
+ _screen->showMouse();
+
+ if (_lang != 1)
+ updateItemCommand(resItem, 3, 0xFF);
+
+ // Unlike the original we give points for every language
+ if (resItem == 7) {
+ updateScore(35, 100);
+ delay(60*_tickLength, true);
+ }
+
return true;
}
return false;
}
-int KyraEngine_v3::getItemCommandStringDrop(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringDrop(%u)", item);
+int KyraEngine_MR::getItemCommandStringDrop(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringDrop(%u)", item);
assert(item < _itemStringMapSize);
int stringId = _itemStringMap[item];
return _itemStringDrop[stringId];
}
-int KyraEngine_v3::getItemCommandStringPickUp(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringPickUp(%u)", item);
+int KyraEngine_MR::getItemCommandStringPickUp(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringPickUp(%u)", item);
assert(item < _itemStringMapSize);
int stringId = _itemStringMap[item];
return _itemStringPickUp[stringId];
}
-int KyraEngine_v3::getItemCommandStringInv(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringInv(%u)", item);
+int KyraEngine_MR::getItemCommandStringInv(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringInv(%u)", item);
assert(item < _itemStringMapSize);
int stringId = _itemStringMap[item];
return _itemStringInv[stringId];
diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp
index ee010b62e6..78768c70ab 100644
--- a/engines/kyra/items_v2.cpp
+++ b/engines/kyra/items_v2.cpp
@@ -24,12 +24,25 @@
*/
#include "kyra/kyra_v2.h"
+#include "kyra/screen_v2.h"
namespace Kyra {
+void KyraEngine_v2::initItemList(int size) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::initItemList(%d)", size);
+ delete [] _itemList;
+
+ _itemList = new Item[size];
+ assert(_itemList);
+ memset(_itemList, 0, sizeof(Item)*size);
+ _itemListSize = size;
+
+ resetItemList();
+}
+
int KyraEngine_v2::findFreeItem() {
debugC(9, kDebugLevelMain, "KyraEngine_v2::findFreeItem()");
- for (int i = 0; i < 30; ++i) {
+ for (int i = 0; i < _itemListSize; ++i) {
if (_itemList[i].id == 0xFFFF)
return i;
}
@@ -39,7 +52,7 @@ int KyraEngine_v2::findFreeItem() {
int KyraEngine_v2::countAllItems() {
debugC(9, kDebugLevelMain, "KyraEngine_v2::countAllItems()");
int num = 0;
- for (int i = 0; i < 30; ++i) {
+ for (int i = 0; i < _itemListSize; ++i) {
if (_itemList[i].id != 0xFFFF)
++num;
}
@@ -48,435 +61,40 @@ int KyraEngine_v2::countAllItems() {
int KyraEngine_v2::findItem(uint16 sceneId, uint16 id) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::findItem(%u, %u)", sceneId, id);
- for (int i = 0; i < 30; ++i) {
+ for (int i = 0; i < _itemListSize; ++i) {
if (_itemList[i].id == id && _itemList[i].sceneId == sceneId)
return i;
}
return -1;
}
-int KyraEngine_v2::checkItemCollision(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::checkItemCollision(%d, %d)", x, y);
- int itemPos = -1, yPos = -1;
-
- for (int i = 0; i < 30; ++i) {
- const Item &curItem = _itemList[i];
-
- if (curItem.id == 0xFFFF || curItem.sceneId != _mainCharacter.sceneId)
- continue;
-
- int itemX1 = curItem.x - 8 - 3;
- int itemX2 = curItem.x + 7 + 3;
-
- if (x < itemX1 || x > itemX2)
- continue;
-
- int itemY1 = curItem.y - _itemHtDat[curItem.id] - 3;
- int itemY2 = curItem.y + 3;
-
- if (y < itemY1 || y > itemY2)
- continue;
-
- if (curItem.y >= yPos) {
- itemPos = i;
- yPos = curItem.y;
- }
+int KyraEngine_v2::findItem(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::findItem(%u)", item);
+ for (int i = 0; i < _itemListSize; ++i) {
+ if (_itemList[i].id == item)
+ return i;
}
-
- return itemPos;
+ return -1;
}
void KyraEngine_v2::resetItemList() {
debugC(9, kDebugLevelMain, "KyraEngine_v2::resetItemList()");
- for (int i = 0; i < 30; ++i) {
- _itemList[i].id = 0xFFFF;
- _itemList[i].sceneId = 0xFFFF;
- _itemList[i].x = 0;
- _itemList[i].y = 0;
- _itemList[i].unk7 = 0;
- }
+ for (int i = 0; i < _itemListSize; ++i)
+ resetItem(i);
}
-void KyraEngine_v2::updateWaterFlasks() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::updateWaterFlasks()");
- for (int i = 22; i < 24; i++) {
- if (_itemInHand == i)
- setHandItem(i - 1);
-
- for (int ii = 0; ii < 20; ii++) {
- if (_mainCharacter.inventory[ii] == i) {
- _mainCharacter.inventory[ii]--;
- if (ii < 10) {
- clearInventorySlot(ii, 0);
- _screen->drawShape(0, getShapePtr(i + 63), _inventoryX[ii], _inventoryY[ii], 0, 0);
- }
- }
- }
-
- for (int ii = 0; ii < 30; ii++) {
- if (_itemList[ii].id == i)
- _itemList[ii].id--;
- }
- }
-}
-
-bool KyraEngine_v2::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::dropItem(%d, %u, %d, %d, %d)", unk1, item, x, y, unk2);
- if (_handItemSet <= -1)
- return false;
-
- bool success = processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2);
- if (!success) {
- snd_playSoundEffect(0x0d);
- if (countAllItems() >= 30)
- showMessageFromCCode(5, 0x84, 0);
- }
-
- return success;
-}
-
-bool KyraEngine_v2::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::processItemDrop(%u, %u, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
- int itemPos = checkItemCollision(x, y);
-
- if (unk1)
- itemPos = -1;
-
- if (itemPos >= 0) {
- exchangeMouseItem(itemPos);
- return false;
- }
-
- int freeItemSlot = -1;
-
- if (unk1 != 3) {
- for (int i = 0; i < 30; ++i) {
- if (_itemList[i].id == 0xFFFF) {
- freeItemSlot = i;
- break;
- }
- }
- }
-
- if (freeItemSlot == -1)
- return false;
-
- if (sceneId != _mainCharacter.sceneId) {
- _itemList[freeItemSlot].x = x;
- _itemList[freeItemSlot].y = y;
- _itemList[freeItemSlot].id = item;
- _itemList[freeItemSlot].unk7 = 1;
- _itemList[freeItemSlot].sceneId = sceneId;
- return true;
- }
-
- int itemHeight = _itemHtDat[item];
-
- // no idea why it's '&&' here and not single checks for x and y
- if (x == -1 && y == -1) {
- x = _rnd.getRandomNumberRng(0x10, 0x130);
- y = _rnd.getRandomNumberRng(0x10, 0x87);
- }
-
- int posX = x, posY = y;
- int itemX = -1, itemY = -1;
- bool needRepositioning = true;
-
- while (needRepositioning) {
- if ((_screen->getDrawLayer(posX, posY) <= 1 && _screen->getDrawLayer2(posX, posY, itemHeight) <= 1 && isDropable(posX, posY)) || posY == 136) {
- int posX2 = posX, posX3 = posX;
- bool repositioning = true;
-
- while (repositioning) {
- if (isDropable(posX3, posY) && _screen->getDrawLayer(posX3, posY) < 7 && checkItemCollision(posX3, posY) == -1) {
- itemX = posX3;
- itemY = posY;
- needRepositioning = false;
- repositioning = false;
- }
-
- if (isDropable(posX2, posY) && _screen->getDrawLayer(posX2, posY) < 7 && checkItemCollision(posX2, posY) == -1) {
- itemX = posX2;
- itemY = posY;
- needRepositioning = false;
- repositioning = false;
- }
-
- if (repositioning) {
- posX3 = MAX(posX3 - 2, 16);
- posX2 = MIN(posX2 + 2, 304);
-
- if (posX3 <= 16 && posX2 >= 304)
- repositioning = false;
- }
- }
- }
-
- if (posY == 136)
- needRepositioning = false;
- else
- posY = MIN(posY + 2, 136);
- }
-
- if (itemX == -1 || itemY == -1)
- return false;
-
- if (unk1 == 3) {
- _itemList[freeItemSlot].x = itemX;
- _itemList[freeItemSlot].y = itemY;
- return true;
- } else if (unk1 == 2) {
- itemDropDown(x, y, itemX, itemY, freeItemSlot, item);
- }
-
- if (!unk1)
- removeHandItem();
-
- itemDropDown(x, y, itemX, itemY, freeItemSlot, item);
-
- if (!unk1 && unk2) {
- int itemStr = 3;
- if (_lang == 1)
- itemStr = getItemCommandStringDrop(item);
- updateCommandLineEx(item+54, itemStr, 0xD6);
- }
-
- return true;
-}
-
-void KyraEngine_v2::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::itemDropDown(%d, %d, %d, %d, %d, %u)", startX, startY, dstX, dstY, itemSlot, item);
- uint8 *itemShape = getShapePtr(item + 64);
-
- if (startX == dstX && startY == dstY) {
- if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
- updateCharFacing();
- snd_playSoundEffect(0x2d);
- removeHandItem();
- objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
- } else {
- _itemList[itemSlot].x = dstX;
- _itemList[itemSlot].y = dstY;
- _itemList[itemSlot].id = item;
- _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- snd_playSoundEffect(0x0c);
- addItemToAnimList(itemSlot);
- }
- } else {
- _screen->hideMouse();
-
- if (startY <= dstY) {
- int speed = 2;
- int curY = startY;
- int curX = startX - 8;
-
- backUpGfxRect24x24(curX, curY-16);
- while (curY < dstY) {
- restoreGfxRect24x24(curX, curY-16);
-
- curY = MIN(curY + speed, dstY);
- ++speed;
-
- backUpGfxRect24x24(curX, curY-16);
- uint32 endDelay = _system->getMillis() + _tickLength;
-
- _screen->drawShape(0, itemShape, curX, curY-16, 0, 0);
- _screen->updateScreen();
-
- // XXX: original doesn't update game state while delaying
- // our implementation *could* do it, so maybe check this again
- delayUntil(endDelay);
- }
-
- if (dstX != dstY || (dstY - startY > 16)) {
- snd_playSoundEffect(0x69);
- speed = MAX(speed, 6);
- int speedX = ((dstX - startX) << 4) / speed;
- int origSpeed = speed;
- speed >>= 1;
-
- if (dstY - startY <= 8)
- speed >>= 1;
-
- speed = -speed;
-
- curX = startX << 4;
-
- int x = 0, y = 0;
- while (--origSpeed) {
- x = (curX >> 4) - 8;
- y = curY - 16;
-
- restoreGfxRect24x24(x, y);
- curY = MIN(curY + speed, dstY);
- curX += speedX;
- ++speed;
-
- x = (curX >> 4) - 8;
- y = curY - 16;
- backUpGfxRect24x24(x, y);
-
- uint16 endDelay = _system->getMillis() + _tickLength;
- _screen->drawShape(0, itemShape, x, y, 0, 0);
- _screen->updateScreen();
-
- // XXX: original doesn't update game state while delaying
- // our implementation *could* do it, so maybe check this again
- delayUntil(endDelay);
- }
-
- restoreGfxRect24x24(x, y);
- } else {
- restoreGfxRect24x24(curX, curY-16);
- }
- }
-
- if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
- updateCharFacing();
- snd_playSoundEffect(0x2d);
- removeHandItem();
- _screen->showMouse();
- objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
- } else {
- _itemList[itemSlot].x = dstX;
- _itemList[itemSlot].y = dstY;
- _itemList[itemSlot].id = item;
- _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
- snd_playSoundEffect(0x0c);
- addItemToAnimList(itemSlot);
- _screen->showMouse();
- }
- }
-}
-
-void KyraEngine_v2::exchangeMouseItem(int itemPos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::exchangeMouseItem(%d)", itemPos);
- _screen->hideMouse();
-
- deleteItemAnimEntry(itemPos);
-
- int itemId = _itemList[itemPos].id;
- _itemList[itemPos].id = _itemInHand;
- _itemInHand = itemId;
-
- addItemToAnimList(itemPos);
- snd_playSoundEffect(0x0b);
- setMouseCursor(_itemInHand);
- int str2 = 7;
-
- if (_lang == 1)
- str2 = getItemCommandStringPickUp(itemId);
-
- updateCommandLineEx(itemId + 54, str2, 0xD6);
- _screen->showMouse();
-
- runSceneScript6();
-}
-
-bool KyraEngine_v2::pickUpItem(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::pickUpItem(%d, %d)", x, y);
- int itemPos = checkItemCollision(x, y);
-
- if (itemPos <= -1)
- return false;
-
- if (_itemInHand >= 0) {
- exchangeMouseItem(itemPos);
- } else {
- _screen->hideMouse();
- deleteItemAnimEntry(itemPos);
- int itemId = _itemList[itemPos].id;
- _itemList[itemPos].id = 0xFFFF;
- snd_playSoundEffect(0x0b);
- setMouseCursor(itemId);
- int str2 = 7;
-
- if (_lang == 1)
- str2 = getItemCommandStringPickUp(itemId);
-
- updateCommandLineEx(itemId + 54, str2, 0xD6);
- _itemInHand = itemId;
- _screen->showMouse();
-
- runSceneScript6();
- }
-
- return true;
-}
-
-bool KyraEngine_v2::isDropable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::isDropable(%d, %d)", x, y);
- if (x < 14 || x > 304 || y < 14 || y > 136)
- return false;
-
- x -= 8;
- y -= 1;
-
- for (int xpos = x; xpos < x + 16; ++xpos) {
- if (_screen->getShapeFlag1(xpos, y) == 0)
- return false;
- }
-
- return true;
-}
-
-int KyraEngine_v2::getItemCommandStringDrop(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringDrop(%u)", item);
- assert(item < _itemStringMapSize);
- int stringId = _itemStringMap[item];
-
- static const int dropStringIds[] = {
- 0x2D, 0x103, 0x003, 0x106
- };
- assert(stringId < ARRAYSIZE(dropStringIds));
-
- return dropStringIds[stringId];
-}
-
-int KyraEngine_v2::getItemCommandStringPickUp(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringPickUp(%u)", item);
- assert(item < _itemStringMapSize);
- int stringId = _itemStringMap[item];
-
- static const int pickUpStringIds[] = {
- 0x02B, 0x102, 0x007, 0x105
- };
- assert(stringId < ARRAYSIZE(pickUpStringIds));
-
- return pickUpStringIds[stringId];
-}
-
-int KyraEngine_v2::getItemCommandStringInv(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringInv(%u)", item);
- assert(item < _itemStringMapSize);
- int stringId = _itemStringMap[item];
-
- static const int pickUpStringIds[] = {
- 0x02C, 0x104, 0x008, 0x107
- };
- assert(stringId < ARRAYSIZE(pickUpStringIds));
-
- return pickUpStringIds[stringId];
-}
-
-void KyraEngine_v2::setMouseCursor(uint16 item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::setMouseCursor(%u)", item);
- int shape = 0;
- int hotX = 1;
- int hotY = 1;
-
- if (item != 0xFFFF) {
- hotX = 8;
- hotY = 15;
- shape = item+64;
- }
-
- _screen->setMouseCursor(hotX, hotY, getShapePtr(shape));
+void KyraEngine_v2::resetItem(int index) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::resetItem(%d)", index);
+ _itemList[index].id = 0xFFFF;
+ _itemList[index].sceneId = 0xFFFF;
+ _itemList[index].x = 0;
+ _itemList[index].y = 0;
}
void KyraEngine_v2::setHandItem(uint16 item) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::setHandItem(%u)", item);
- _screen->hideMouse();
+ Screen *scr = screen();
+ scr->hideMouse();
if (item == 0xFFFF) {
removeHandItem();
@@ -485,27 +103,18 @@ void KyraEngine_v2::setHandItem(uint16 item) {
_itemInHand = item;
}
- _screen->showMouse();
+ scr->showMouse();
}
void KyraEngine_v2::removeHandItem() {
debugC(9, kDebugLevelMain, "KyraEngine_v2::removeHandItem()");
- _screen->hideMouse();
- _screen->setMouseCursor(0, 0, _defaultShapeTable[0]);
+ Screen *scr = screen();
+ scr->hideMouse();
+ scr->setMouseCursor(0, 0, getShapePtr(0));
_itemInHand = -1;
_handItemSet = -1;
- _screen->showMouse();
-}
-
-bool KyraEngine_v2::itemIsFlask(int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::itemIsFlask(%d)", item);
- for (int i = 0; _flaskTable[i] != -1; ++i) {
- if (_flaskTable[i] == item)
- return true;
- }
-
- return false;
+ scr->showMouse();
}
-} // end of namespace Kyra
+} // end of namesapce Kyra
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 5ee2c1ed0c..05d8b79a4e 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -39,15 +39,14 @@
namespace Kyra {
KyraEngine::KyraEngine(OSystem *system, const GameFlags &flags)
- : Engine(system) {
+ : Engine(system), _flags(flags) {
_res = 0;
_sound = 0;
_text = 0;
_staticres = 0;
_timer = 0;
- _scriptInterpreter = 0;
+ _emc = 0;
- _flags = flags;
_gameSpeed = 60;
_tickLength = (uint8)(1000.0 / _gameSpeed);
@@ -87,50 +86,53 @@ int KyraEngine::init() {
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- // We prefer AdLib over native MIDI, since our AdLib playback code is much
- // more mature than our MIDI player. For example we are missing MT-32 support
- // and it seems our MIDI playback code has threading issues (see bug #1506583
- // "KYRA1: Crash on exceeded polyphony" for more information).
- int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
-
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
- // TODO: currently we don't support the PC98 sound data,
- // but since it has the FM-Towns data files, we just use the
- // FM-Towns driver
- if (_flags.gameID == GI_KYRA1)
- _sound = new SoundTowns(this, _mixer);
- else
- _sound = new SoundTowns_v2(this, _mixer);
- } else if (midiDriver == MD_ADLIB) {
- _sound = new SoundAdlibPC(this, _mixer);
- assert(_sound);
- } else {
- bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
-
- MidiDriver *driver = MidiDriver::createMidi(midiDriver);
- assert(driver);
- if (native_mt32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
-
- SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
- _sound = soundMidiPc;
- assert(_sound);
- soundMidiPc->hasNativeMT32(native_mt32);
-
- // Unlike some SCUMM games, it's not that the MIDI sounds are
- // missing. It's just that at least at the time of writing they
- // are decidedly inferior to the Adlib ones.
- if (ConfMan.getBool("multi_midi")) {
- SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
- assert(adlib);
-
- _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ if (!_flags.useDigSound) {
+ // We prefer AdLib over native MIDI, since our AdLib playback code is much
+ // more mature than our MIDI player. For example we are missing MT-32 support
+ // and it seems our MIDI playback code has threading issues (see bug #1506583
+ // "KYRA1: Crash on exceeded polyphony" for more information).
+ int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
+
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
+ // TODO: currently we don't support the PC98 sound data,
+ // but since it has the FM-Towns data files, we just use the
+ // FM-Towns driver
+ if (_flags.gameID == GI_KYRA1)
+ _sound = new SoundTowns(this, _mixer);
+ else
+ _sound = new SoundTowns_v2(this, _mixer);
+ } else if (midiDriver == MD_ADLIB) {
+ _sound = new SoundAdlibPC(this, _mixer);
+ assert(_sound);
+ } else {
+ bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
+
+ MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+ assert(driver);
+ if (native_mt32)
+ driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+
+ SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
+ _sound = soundMidiPc;
assert(_sound);
+ soundMidiPc->hasNativeMT32(native_mt32);
+
+ // Unlike some SCUMM games, it's not that the MIDI sounds are
+ // missing. It's just that at least at the time of writing they
+ // are decidedly inferior to the Adlib ones.
+ if (ConfMan.getBool("multi_midi")) {
+ SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
+ assert(adlib);
+
+ _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ assert(_sound);
+ }
}
}
if (_sound)
_sound->updateVolumeSettings();
+
_res = new Resource(this);
assert(_res);
_res->reset();
@@ -143,8 +145,8 @@ int KyraEngine::init() {
_timer = new TimerManager(this, _system);
assert(_timer);
setupTimers();
- _scriptInterpreter = new ScriptHelper(this);
- assert(_scriptInterpreter);
+ _emc = new EMCInterpreter(this);
+ assert(_emc);
setupOpcodeTable();
readSettings();
@@ -198,7 +200,7 @@ KyraEngine::~KyraEngine() {
delete _sound;
delete _text;
delete _timer;
- delete _scriptInterpreter;
+ delete _emc;
}
void KyraEngine::quitGame() {
@@ -271,8 +273,10 @@ void KyraEngine::readSettings() {
}
_configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1;
- _sound->enableMusic(_configMusic);
- _sound->enableSFX(_configSounds);
+ if (_sound) {
+ _sound->enableMusic(_configMusic);
+ _sound->enableSFX(_configSounds);
+ }
bool speechMute = ConfMan.getBool("speech_mute");
bool subtitles = ConfMan.getBool("subtitles");
@@ -311,11 +315,12 @@ void KyraEngine::writeSettings() {
break;
}
- if (!_configMusic)
- _sound->beginFadeOut();
-
- _sound->enableMusic(_configMusic);
- _sound->enableSFX(_configSounds);
+ if (_sound) {
+ if (!_configMusic)
+ _sound->beginFadeOut();
+ _sound->enableMusic(_configMusic);
+ _sound->enableSFX(_configSounds);
+ }
ConfMan.setBool("speech_mute", speechMute);
ConfMan.setBool("subtitles", subtitles);
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 0fee9e4e3e..18a4a52fe2 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -28,10 +28,8 @@
#include "engines/engine.h"
-#include "common/rect.h"
#include "common/array.h"
#include "common/events.h"
-#include "common/func.h"
#include "kyra/script.h"
@@ -47,16 +45,14 @@ namespace Kyra {
struct GameFlags {
Common::Language lang;
Common::Platform platform;
- bool isDemo;
- bool useAltShapeHeader; // alternative shape header (uses 2 bytes more, those are unused though)
- bool isTalkie;
- bool useHiResOverlay;
- byte gameID;
-};
-struct Rect {
- int x, y;
- int x2, y2;
+ bool isDemo : 1;
+ bool useAltShapeHeader : 1; // alternative shape header (uses 2 bytes more, those are unused though)
+ bool isTalkie : 1;
+ bool useHiResOverlay : 1;
+ bool useDigSound : 1;
+
+ byte gameID;
};
enum {
@@ -76,7 +72,7 @@ struct AudioDataStruct {
// in the future we maybe merge some flags and/or create new ones
enum kDebugLevels {
kDebugLevelScriptFuncs = 1 << 0, // prints debug output of o#_* functions
- kDebugLevelScript = 1 << 1, // prints debug output of "ScriptHelper" functions
+ kDebugLevelScript = 1 << 1, // prints debug output of "EMCInterpreter" functions
kDebugLevelSprites = 1 << 2, // prints debug output of "Sprites" functions
kDebugLevelScreen = 1 << 3, // prints debug output of "Screen" functions
kDebugLevelSound = 1 << 4, // prints debug output of "Sound" functions
@@ -125,8 +121,6 @@ public:
uint32 tickLength() const { return _tickLength; }
- virtual Movie *createWSAMovie() = 0;
-
Common::RandomSource _rnd;
// input
@@ -157,7 +151,7 @@ public:
// sound
virtual void snd_playTheme(int file, int track);
- virtual void snd_playSoundEffect(int id);
+ virtual void snd_playSoundEffect(int id, int volume=0xFF);
virtual void snd_playWanderScoreViaMap(int command, int restart);
virtual void snd_playVoiceFile(int id) = 0;
virtual bool snd_voiceIsPlaying();
@@ -181,7 +175,7 @@ protected:
TextDisplayer *_text;
StaticResource *_staticres;
TimerManager *_timer;
- ScriptHelper *_scriptInterpreter;
+ EMCInterpreter *_emc;
// config specific
virtual void registerDefaultSettings();
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
new file mode 100644
index 0000000000..c25af91bec
--- /dev/null
+++ b/engines/kyra/kyra_hof.cpp
@@ -0,0 +1,2013 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra.h"
+#include "kyra/kyra_hof.h"
+#include "kyra/screen.h"
+#include "kyra/resource.h"
+#include "kyra/wsamovie.h"
+#include "kyra/sound.h"
+#include "kyra/script.h"
+#include "kyra/script_tim.h"
+#include "kyra/text_hof.h"
+#include "kyra/timer.h"
+#include "kyra/debugger.h"
+
+#include "common/system.h"
+#include "common/config-manager.h"
+
+namespace Kyra {
+
+const KyraEngine_v2::EngineDesc KyraEngine_HoF::_hofEngineDesc = {
+ // Generic shape related
+ 64,
+ KyraEngine_HoF::_characterFrameTable,
+
+ // Scene script
+ 8,
+
+ // Animation script specific
+ 33
+};
+
+KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _hofEngineDesc), _updateFunctor(this, &KyraEngine_HoF::update) {
+ _mouseSHPBuf = 0;
+ _screen = 0;
+ _text = 0;
+
+ _seqProcessedString = 0;
+ _activeWSA = 0;
+ _activeText = 0;
+ _seqWsa = 0;
+ _sequences = 0;
+ _sequenceSoundList = 0;
+
+ _gamePlayBuffer = 0;
+ _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0;
+
+ _overwriteSceneFacing = false;
+ _mainCharX = _mainCharY = -1;
+ _drawNoShapeFlag = false;
+ _charPalEntry = 0;
+ _itemInHand = -1;
+ _unkSceneScreenFlag1 = false;
+ _noScriptEnter = true;
+ _currentChapter = 0;
+ _newChapterFile = 1;
+ _oldTalkFile = -1;
+ _currentTalkFile = 0;
+ _lastSfxTrack = -1;
+ _handItemSet = -1;
+ _unkHandleSceneChangeFlag = false;
+ _pathfinderFlag = 0;
+ _mouseX = _mouseY = 0;
+
+ _lastIdleScript = -1;
+
+ _currentTalkSections.STATim = 0;
+ _currentTalkSections.TLKTim = 0;
+ _currentTalkSections.ENDTim = 0;
+
+ memset(&_invWsa, 0, sizeof(_invWsa));
+ _itemAnimData = 0;
+ _demoAnimData = 0;
+ _nextAnimItem = 0;
+
+ for (int i = 0; i < 15; i++)
+ memset(&_activeItemAnim[i], 0, sizeof(ActiveItemAnim));
+
+ _colorCodeFlag1 = 0;
+ _colorCodeFlag2 = -1;
+ _scriptCountDown = 0;
+ _dbgPass = 0;
+
+ _gamePlayBuffer = 0;
+ _unkBuf500Bytes = 0;
+ _inventorySaved = false;
+ _unkBuf200kByte = 0;
+ memset(&_sceneShapeTable, 0, sizeof(_sceneShapeTable));
+
+ _talkObjectList = 0;
+ _shapeDescTable = 0;
+ _gfxBackUpRect = 0;
+ _sceneList = 0;
+ memset(&_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
+ memset(&_wsaSlots, 0, sizeof(_wsaSlots));
+ memset(&_buttonShapes, 0, sizeof(_buttonShapes));
+
+ _configTextspeed = 50;
+
+ _inventoryButtons = _buttonList = 0;
+
+ _dlgBuffer = 0;
+ _conversationState = new int8*[19];
+ for (int i = 0; i < 19; i++)
+ _conversationState[i] = new int8[14];
+ _npcTalkChpIndex = _npcTalkDlgIndex = -1;
+ _mainCharacter.dlgIndex = 0;
+ setDlgIndex(-1);
+
+ _bookMaxPage = 6;
+ _bookCurPage = 0;
+ _bookNewPage = 0;
+ _bookBkgd = 0;
+
+ _cauldronState = 0;
+ _cauldronUseCount = 0;
+ memset(_cauldronStateTables, 0, sizeof(_cauldronStateTables));
+
+ _menuDirectlyToLoad = false;
+ _menu = 0;
+}
+
+KyraEngine_HoF::~KyraEngine_HoF() {
+ cleanup();
+ seq_uninit();
+
+ delete [] _mouseSHPBuf;
+ delete _screen;
+ delete _text;
+ delete _gui;
+ delete _tim;
+ _text = 0;
+ delete _invWsa.wsa;
+
+ if (_sequenceSoundList) {
+ for (int i = 0; i < _sequenceSoundListSize; i++) {
+ if (_sequenceSoundList[i])
+ delete [] _sequenceSoundList[i];
+ }
+ delete [] _sequenceSoundList;
+ _sequenceSoundList = NULL;
+ }
+
+ if (_dlgBuffer)
+ delete [] _dlgBuffer;
+ for (int i = 0; i < 19; i++)
+ delete [] _conversationState[i];
+ delete [] _conversationState;
+
+ for (Common::Array<const TIMOpcode*>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i)
+ delete *i;
+ _timOpcodes.clear();
+}
+
+int KyraEngine_HoF::init() {
+ _screen = new Screen_HoF(this, _system);
+ assert(_screen);
+ _screen->setResolution();
+
+ KyraEngine::init();
+ initStaticResource();
+
+ _debugger = new Debugger_HoF(this);
+ assert(_debugger);
+ _text = new TextDisplayer_HoF(this, _screen);
+ assert(_text);
+ _gui = new GUI_HoF(this);
+ assert(_gui);
+ _gui->initStaticData();
+ _tim = new TIMInterpreter(this, _system);
+ assert(_tim);
+
+ if (_flags.isDemo && !_flags.isTalkie) {
+ _screen->loadFont(_screen->FID_8_FNT, "FONT9P.FNT");
+ } else {
+ _screen->loadFont(_screen->FID_6_FNT, "6.FNT");
+ _screen->loadFont(_screen->FID_8_FNT, "8FAT.FNT");
+ _screen->loadFont(_screen->FID_BOOKFONT_FNT, "BOOKFONT.FNT");
+ }
+ _screen->loadFont(_screen->FID_GOLDFONT_FNT, "GOLDFONT.FNT");
+
+ _screen->setAnimBlockPtr(3504);
+ _screen->setScreenDim(0);
+
+ if (!_sound->init())
+ error("Couldn't init sound");
+
+ _abortIntroFlag = false;
+
+ if (_sequenceStrings) {
+ for (int i = 0; i < 33; i++)
+ _sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8;
+ }
+
+ // No mouse display in demo
+ if (_flags.isDemo && !_flags.isTalkie)
+ return 0;
+
+ _mouseSHPBuf = _res->fileData("PWGMOUSE.SHP", 0);
+ assert(_mouseSHPBuf);
+
+ for (int i = 0; i < 2; i++)
+ addShapeToPool(_screen->getPtrToShape(_mouseSHPBuf, i), i);
+
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ return 0;
+}
+
+int KyraEngine_HoF::go() {
+ if (_gameToLoad == -1) {
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
+ seq_showStarcraftLogo();
+
+ if (_flags.isDemo && !_flags.isTalkie) {
+ seq_playSequences(kSequenceDemoVirgin, kSequenceDemoFisher);
+ _menuChoice = 4;
+ } else {
+ seq_playSequences(kSequenceVirgin, kSequenceZanfaun);
+ }
+ } else {
+ _menuChoice = 1;
+ }
+
+ _res->unloadAllPakFiles();
+
+ if (_menuChoice != 4) {
+ // load just the pak files needed for ingame
+ _res->loadPakFile(StaticResource::staticDataFilename());
+ if (_flags.platform == Common::kPlatformPC && _flags.isTalkie)
+ _res->loadFileList("FILEDATA.FDT");
+ else
+ _res->loadFileList(_ingamePakList, _ingamePakListSize);
+ }
+
+ _menuDirectlyToLoad = (_menuChoice == 3) ? true : false;
+ _menuDirectlyToLoad &= saveFileLoadable(0);
+
+ if (_menuChoice & 1) {
+ startup();
+ if (!quit())
+ runLoop();
+ cleanup();
+
+ if (_showOutro)
+ seq_playSequences(kSequenceFunters, kSequenceFrash);
+ }
+
+ return 0;
+}
+
+void KyraEngine_HoF::startup() {
+ _sound->setSoundList(&_soundData[kMusicIngame]);
+ // The track map is exactly the same
+ // for FM-TOWNS and DOS
+ _trackMap = _dosTrackMap;
+ _trackMapSize = _dosTrackMapSize;
+
+ allocAnimObjects(1, 10, 30);
+
+ _screen->_curPage = 0;
+ delete [] _mouseSHPBuf;
+ _mouseSHPBuf = 0;
+
+ _gameShapes.clear();
+ memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
+ _gamePlayBuffer = new uint8[46080];
+ _unkBuf500Bytes = new uint8[500];
+
+ loadMouseShapes();
+ loadItemShapes();
+
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+
+ _screenBuffer = new uint8[64000];
+ _unkBuf200kByte = new uint8[200000];
+
+ loadChapterBuffer(_newChapterFile);
+
+ loadCCodeBuffer("C_CODE.XXX");
+
+ if (_flags.isTalkie) {
+ loadOptionsBuffer("OPTIONS.XXX");
+
+ showMessageFromCCode(265, 150, 0);
+ _screen->updateScreen();
+ openTalkFile(0);
+ _currentTalkFile = 1;
+ openTalkFile(1);
+ } else {
+ _optionsBuffer = _cCodeBuffer;
+ }
+
+ showMessage(0, 207);
+
+ _screen->setShapePages(5, 3);
+
+ memset(&_mainCharacter, 0, sizeof(_mainCharacter));
+ _mainCharacter.height = 0x30;
+ _mainCharacter.facing = 4;
+ _mainCharacter.animFrame = 0x12;
+ memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
+
+ memset(_sceneAnims, 0, sizeof(_sceneAnims));
+ for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
+ _sceneAnimMovie[i] = new WSAMovieV2(this, _screen);
+ memset(_wsaSlots, 0, sizeof(_wsaSlots));
+ for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i)
+ _wsaSlots[i] = new WSAMovieV2(this, _screen);
+
+ _screen->_curPage = 0;
+
+ _talkObjectList = new TalkObject[72];
+ memset(_talkObjectList, 0, sizeof(TalkObject)*72);
+ _shapeDescTable = new ShapeDesc[55];
+ memset(_shapeDescTable, 0, sizeof(ShapeDesc)*55);
+
+ for (int i = 9; i <= 32; ++i) {
+ _shapeDescTable[i-9].width = 30;
+ _shapeDescTable[i-9].height = 55;
+ _shapeDescTable[i-9].xAdd = -15;
+ _shapeDescTable[i-9].yAdd = -50;
+ }
+
+ for (int i = 19; i <= 24; ++i) {
+ _shapeDescTable[i-9].width = 53;
+ _shapeDescTable[i-9].yAdd = -51;
+ }
+
+ _gfxBackUpRect = new uint8[_screen->getRectSize(32, 32)];
+ initItemList(30);
+ loadButtonShapes();
+ resetItemList();
+ _characterShapeFile = 1;
+ loadCharacterShapes(_characterShapeFile);
+ initInventoryButtonList();
+ setupLangButtonShapes();
+ loadInventoryShapes();
+
+ _res->loadFileToBuf("PALETTE.COL", _screen->_currentPalette, 0x300);
+ _screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
+ _screen->copyPage(3, 0);
+ _screen->showMouse();
+ _screen->hideMouse();
+
+ clearAnimObjects();
+
+ for (int i = 0; i < 19; ++i)
+ memset(_conversationState[i], -1, sizeof(int8)*14);
+ clearCauldronTable();
+ memset(_inputColorCode, -1, sizeof(_inputColorCode));
+ memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
+ for (int i = 0; i < 23; ++i)
+ resetCauldronStateTable(i);
+
+ _sceneList = new SceneDesc[86];
+ memset(_sceneList, 0, sizeof(SceneDesc)*86);
+ _sceneListSize = 86;
+ runStartScript(1, 0);
+ loadNPCScript();
+
+ if (_gameToLoad == -1) {
+ snd_playWanderScoreViaMap(52, 1);
+ enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
+ saveGame(getSavegameFilename(0), "New Game");
+ } else {
+ loadGame(getSavegameFilename(_gameToLoad));
+ }
+
+ _screen->showMouse();
+
+ if (_menuDirectlyToLoad)
+ (*_inventoryButtons[0].buttonCallback)(&_inventoryButtons[0]);
+
+ setNextIdleAnimTimer();
+ //XXX
+ setWalkspeed(_configWalkspeed);
+}
+
+void KyraEngine_HoF::runLoop() {
+ _screen->updateScreen();
+
+ _quitFlag = false;
+ _runFlag = true;
+ while (!_quitFlag && _runFlag) {
+ if (_deathHandler >= 0) {
+ removeHandItem();
+ delay(5);
+ _drawNoShapeFlag = 0;
+ _gui->optionsButton(0);
+ _deathHandler = -1;
+ }
+
+ if (_system->getMillis() > _nextIdleAnim)
+ showIdleAnim();
+
+ if (queryGameFlag(0x159)) {
+ dinoRide();
+ resetGameFlag(0x159);
+ }
+
+ if (queryGameFlag(0x124) && !queryGameFlag(0x125)) {
+ _mainCharacter.animFrame = 32;
+ enterNewScene(39, -1, 0, 0, 0);
+ }
+
+ if (queryGameFlag(0xD8)) {
+ resetGameFlag(0xD8);
+ if (_mainCharacter.sceneId == 34) {
+ if (queryGameFlag(0xD1)) {
+ initTalkObject(28);
+ npcChatSequence(getTableString(0xFA, _cCodeBuffer, 1), 28, 0x83, 0xFA);
+ deinitTalkObject(28);
+ enterNewScene(35, 4, 0, 0, 0);
+ } else if (queryGameFlag(0xD0)) {
+ initTalkObject(29);
+ npcChatSequence(getTableString(0xFB, _cCodeBuffer, 1), 29, 0x83, 0xFB);
+ deinitTalkObject(29);
+ enterNewScene(33, 6, 0, 0, 0);
+ }
+ }
+ }
+
+ int inputFlag = checkInput(_buttonList, true);
+ removeInputTop();
+
+ update();
+
+ if (inputFlag == 198 || inputFlag == 199) {
+ _unk3 = _handItemSet;
+ handleInput(_mouseX, _mouseY);
+ }
+
+ //if (queryGameFlag(0x1EE) && inputFlag)
+ // sub_13B19(inputFlag);
+
+ _system->delayMillis(10);
+ }
+}
+
+void KyraEngine_HoF::handleInput(int x, int y) {
+ setNextIdleAnimTimer();
+ if (_unk5) {
+ _unk5 = 0;
+ return;
+ }
+
+ if (!_screen->isMouseVisible())
+ return;
+
+ if (_unk3 == -2) {
+ snd_playSoundEffect(13);
+ return;
+ }
+
+ setNextIdleAnimTimer();
+
+ if (x <= 6 || x >= 312 || y <= 6 || y >= 135) {
+ bool exitOk = false;
+ assert(_unk3 + 6 >= 0);
+ switch (_unk3 + 6) {
+ case 0:
+ if (_sceneExit1 != 0xFFFF)
+ exitOk = true;
+ break;
+
+ case 1:
+ if (_sceneExit2 != 0xFFFF)
+ exitOk = true;
+ break;
+
+ case 2:
+ if (_sceneExit3 != 0xFFFF)
+ exitOk = true;
+ break;
+
+ case 3:
+ if (_sceneExit4 != 0xFFFF)
+ exitOk = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (exitOk) {
+ inputSceneChange(x, y, 1, 1);
+ return;
+ }
+ }
+
+ if (checkCharCollision(x, y) && _unk3 >= -1) {
+ runSceneScript2();
+ return;
+ } else if (pickUpItem(x, y)) {
+ return;
+ } else {
+ int skipHandling = 0;
+
+ if (checkItemCollision(x, y) == -1) {
+ resetGameFlag(0x1EF);
+ skipHandling = handleInputUnkSub(x, y) ? 1 : 0;
+
+ if (queryGameFlag(0x1EF)) {
+ resetGameFlag(0x1EF);
+ return;
+ }
+
+ if (_unk5) {
+ _unk5 = 0;
+ return;
+ }
+ }
+
+ if (_deathHandler > -1)
+ skipHandling = 1;
+
+ if (skipHandling)
+ return;
+
+ if (checkCharCollision(x, y)) {
+ runSceneScript2();
+ return;
+ }
+
+ if (_itemInHand >= 0) {
+ if (y > 136)
+ return;
+
+ dropItem(0, _itemInHand, x, y, 1);
+ } else {
+ if (_unk3 == -2 || y > 135)
+ return;
+
+ if (!_unk5) {
+ inputSceneChange(x, y, 1, 1);
+ return;
+ }
+
+ _unk5 = 0;
+ }
+ }
+}
+
+bool KyraEngine_HoF::handleInputUnkSub(int x, int y) {
+ if (y > 143 || _deathHandler > -1 || queryGameFlag(0x164))
+ return false;
+
+ if (_handItemSet <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) {
+ updateCharFacing();
+ objectChat(getTableString(0xFC, _cCodeBuffer, 1), 0, 0x83, 0xFC);
+ return true;
+ } else {
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
+
+ _sceneScriptState.regs[1] = x;
+ _sceneScriptState.regs[2] = y;
+ _sceneScriptState.regs[3] = 0;
+ _sceneScriptState.regs[4] = _itemInHand;
+
+ _emc->start(&_sceneScriptState, 1);
+
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+
+ //XXXsys_unkKeyboad (flush? wait? whatever...)
+
+ if (queryGameFlag(0x1ED)) {
+ _sound->beginFadeOut();
+ _screen->fadeToBlack();
+ _showOutro = true;
+ _runFlag = false;
+ }
+
+ return _sceneScriptState.regs[3] != 0;
+ }
+}
+
+void KyraEngine_HoF::update() {
+ updateInput();
+
+ refreshAnimObjectsIfNeed();
+ updateMouse();
+ updateSpecialSceneScripts();
+ _timer->update();
+ updateItemAnimations();
+ updateInvWsa();
+ fadeMessagePalette();
+ _screen->updateScreen();
+}
+
+void KyraEngine_HoF::updateWithText() {
+ updateInput();
+
+ updateMouse();
+ fadeMessagePalette();
+ updateSpecialSceneScripts();
+ _timer->update();
+ updateItemAnimations();
+ updateInvWsa();
+ restorePage3();
+ drawAnimObjects();
+
+ if (textEnabled() && _chatText) {
+ int pageBackUp = _screen->_curPage;
+ _screen->_curPage = 2;
+ objectChatPrintText(_chatText, _chatObject);
+ _screen->_curPage = pageBackUp;
+ }
+
+ refreshAnimObjects(0);
+ _screen->updateScreen();
+}
+
+void KyraEngine_HoF::updateMouse() {
+ int shapeIndex = 0;
+ int type = 0;
+ int xOffset = 0, yOffset = 0;
+ Common::Point mouse = getMousePos();
+
+ if (mouse.y <= 145) {
+ if (mouse.x <= 6) {
+ if (_sceneExit4 != 0xFFFF) {
+ type = -3;
+ shapeIndex = 4;
+ xOffset = 1;
+ yOffset = 5;
+ } else {
+ type = -2;
+ }
+ } else if (mouse.x >= 312) {
+ if (_sceneExit2 != 0xFFFF) {
+ type = -5;
+ shapeIndex = 2;
+ xOffset = 7;
+ yOffset = 5;
+ } else {
+ type = -2;
+ }
+ } else if (mouse.y >= 135) {
+ if (_sceneExit3 != 0xFFFF) {
+ type = -4;
+ shapeIndex = 3;
+ xOffset = 5;
+ yOffset = 10;
+ } else {
+ type = -2;
+ }
+ } else if (mouse.y <= 6) {
+ if (_sceneExit1 != 0xFFFF) {
+ type = -6;
+ shapeIndex = 1;
+ xOffset = 5;
+ yOffset = 1;
+ } else {
+ type = -2;
+ }
+ }
+ }
+
+ for (int i = 0; i < _specialExitCount; ++i) {
+ if (checkSpecialSceneExit(i, mouse.x, mouse.y)) {
+ switch (_specialExitTable[20+i]) {
+ case 0:
+ type = -6;
+ shapeIndex = 1;
+ xOffset = 5;
+ yOffset = 1;
+ break;
+
+ case 2:
+ type = -5;
+ shapeIndex = 2;
+ xOffset = 7;
+ yOffset = 5;
+ break;
+
+ case 4:
+ type = -4;
+ shapeIndex = 3;
+ xOffset = 5;
+ yOffset = 7;
+ break;
+
+ case 6:
+ type = -3;
+ shapeIndex = 4;
+ xOffset = 1;
+ yOffset = 5;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (type == -2) {
+ shapeIndex = 5;
+ xOffset = 5;
+ yOffset = 9;
+ }
+
+ if (type != 0 && _handItemSet != type && _screen->isMouseVisible()) {
+ _mouseState = _handItemSet = type;
+ _screen->hideMouse();
+ _screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex));
+ _screen->showMouse();
+ }
+
+ if (type == 0 && _handItemSet != _itemInHand && _screen->isMouseVisible()) {
+ if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) {
+ _mouseState = 0;
+ _handItemSet = _itemInHand;
+ _screen->hideMouse();
+ if (_itemInHand == -1)
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ else
+ _screen->setMouseCursor(8, 15, getShapePtr(_itemInHand+64));
+ _screen->showMouse();
+ }
+ }
+}
+
+void KyraEngine_HoF::delay(uint32 amount, bool updateGame, bool isMainLoop) {
+ uint32 start = _system->getMillis();
+ do {
+ if (updateGame) {
+ if (_chatText)
+ updateWithText();
+ else
+ update();
+ } else {
+ updateInput();
+ }
+
+ if (amount > 0)
+ _system->delayMillis(amount > 10 ? 10 : amount);
+ } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
+}
+
+void KyraEngine_HoF::cleanup() {
+ delete [] _inventoryButtons; _inventoryButtons = 0;
+
+ delete [] _gamePlayBuffer; _gamePlayBuffer = 0;
+ delete [] _unkBuf500Bytes; _unkBuf500Bytes = 0;
+ delete [] _unkBuf200kByte; _unkBuf200kByte = 0;
+
+ freeSceneShapePtrs();
+
+ if (_optionsBuffer != _cCodeBuffer)
+ delete [] _optionsBuffer;
+ _optionsBuffer = 0;
+ delete [] _cCodeBuffer; _cCodeBuffer = 0;
+ delete [] _chapterBuffer; _chapterBuffer = 0;
+
+ delete [] _talkObjectList; _talkObjectList = 0;
+ delete [] _shapeDescTable; _shapeDescTable = 0;
+
+ delete [] _gfxBackUpRect; _gfxBackUpRect = 0;
+
+ delete [] _sceneList; _sceneList = 0;
+
+ for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) {
+ delete _sceneAnimMovie[i];
+ _sceneAnimMovie[i] = 0;
+ }
+ for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i) {
+ delete _wsaSlots[i];
+ _wsaSlots[i] = 0;
+ }
+ for (int i = 0; i < ARRAYSIZE(_buttonShapes); ++i) {
+ delete [] _buttonShapes[i];
+ _buttonShapes[i] = 0;
+ }
+}
+
+#pragma mark - Localization
+
+void KyraEngine_HoF::loadCCodeBuffer(const char *file) {
+ char tempString[13];
+ strcpy(tempString, file);
+ changeFileExtension(tempString);
+
+ delete [] _cCodeBuffer;
+ _cCodeBuffer = _res->fileData(tempString, 0);
+}
+
+void KyraEngine_HoF::loadOptionsBuffer(const char *file) {
+ char tempString[13];
+ strcpy(tempString, file);
+ changeFileExtension(tempString);
+
+ delete [] _optionsBuffer;
+ _optionsBuffer = _res->fileData(tempString, 0);
+}
+
+void KyraEngine_HoF::loadChapterBuffer(int chapter) {
+ char tempString[14];
+
+ static const char *chapterFilenames[] = {
+ "CH1.XXX", "CH2.XXX", "CH3.XXX", "CH4.XXX", "CH5.XXX"
+ };
+
+ assert(chapter >= 1 && chapter <= ARRAYSIZE(chapterFilenames));
+ strcpy(tempString, chapterFilenames[chapter-1]);
+ changeFileExtension(tempString);
+
+ delete [] _chapterBuffer;
+ _chapterBuffer = _res->fileData(tempString, 0);
+ _currentChapter = chapter;
+}
+
+void KyraEngine_HoF::changeFileExtension(char *buffer) {
+ while (*buffer != '.')
+ ++buffer;
+
+ ++buffer;
+ strcpy(buffer, _languageExtension[_lang]);
+}
+
+uint8 *KyraEngine_HoF::getTableEntry(uint8 *buffer, int id) {
+ return buffer + READ_LE_UINT16(buffer + (id<<1));
+}
+
+char *KyraEngine_HoF::getTableString(int id, uint8 *buffer, int decode) {
+ char *string = (char*)getTableEntry(buffer, id);
+
+ if (decode && _flags.lang != Common::JA_JPN) {
+ decodeString1(string, _internStringBuf);
+ decodeString2(_internStringBuf, _internStringBuf);
+ string = _internStringBuf;
+ }
+
+ return string;
+}
+
+const char *KyraEngine_HoF::getChapterString(int id) {
+ if (_currentChapter != _newChapterFile)
+ loadChapterBuffer(_newChapterFile);
+
+ return getTableString(id, _chapterBuffer, 1);
+}
+
+int KyraEngine_HoF::decodeString1(const char *src, char *dst) {
+ static const uint8 decodeTable1[] = {
+ 0x20, 0x65, 0x74, 0x61, 0x69, 0x6E, 0x6F, 0x73, 0x72, 0x6C, 0x68,
+ 0x63, 0x64, 0x75, 0x70, 0x6D
+ };
+
+ static const uint8 decodeTable2[] = {
+ 0x74, 0x61, 0x73, 0x69, 0x6F, 0x20, 0x77, 0x62, 0x20, 0x72, 0x6E,
+ 0x73, 0x64, 0x61, 0x6C, 0x6D, 0x68, 0x20, 0x69, 0x65, 0x6F, 0x72,
+ 0x61, 0x73, 0x6E, 0x72, 0x74, 0x6C, 0x63, 0x20, 0x73, 0x79, 0x6E,
+ 0x73, 0x74, 0x63, 0x6C, 0x6F, 0x65, 0x72, 0x20, 0x64, 0x74, 0x67,
+ 0x65, 0x73, 0x69, 0x6F, 0x6E, 0x72, 0x20, 0x75, 0x66, 0x6D, 0x73,
+ 0x77, 0x20, 0x74, 0x65, 0x70, 0x2E, 0x69, 0x63, 0x61, 0x65, 0x20,
+ 0x6F, 0x69, 0x61, 0x64, 0x75, 0x72, 0x20, 0x6C, 0x61, 0x65, 0x69,
+ 0x79, 0x6F, 0x64, 0x65, 0x69, 0x61, 0x20, 0x6F, 0x74, 0x72, 0x75,
+ 0x65, 0x74, 0x6F, 0x61, 0x6B, 0x68, 0x6C, 0x72, 0x20, 0x65, 0x69,
+ 0x75, 0x2C, 0x2E, 0x6F, 0x61, 0x6E, 0x73, 0x72, 0x63, 0x74, 0x6C,
+ 0x61, 0x69, 0x6C, 0x65, 0x6F, 0x69, 0x72, 0x61, 0x74, 0x70, 0x65,
+ 0x61, 0x6F, 0x69, 0x70, 0x20, 0x62, 0x6D
+ };
+
+ int size = 0;
+ uint cChar = 0;
+ while ((cChar = *src++) != 0) {
+ if (cChar & 0x80) {
+ cChar &= 0x7F;
+ int index = (cChar & 0x78) >> 3;
+ *dst++ = decodeTable1[index];
+ ++size;
+ assert(cChar < sizeof(decodeTable2));
+ cChar = decodeTable2[cChar];
+ }
+
+ *dst++ = cChar;
+ ++size;
+ }
+
+ *dst++ = 0;
+ return size;
+}
+
+void KyraEngine_HoF::decodeString2(const char *src, char *dst) {
+ if (!src || !dst)
+ return;
+
+ char out = 0;
+ while ((out = *src) != 0) {
+ if (*src == 0x1B) {
+ ++src;
+ out = *src + 0x7F;
+ }
+ *dst++ = out;
+ ++src;
+ }
+
+ *dst = 0;
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) {
+ const char *string = getTableString(id, _cCodeBuffer, 1);
+ showMessage(string, palIndex);
+}
+
+void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) {
+ _shownMessage = string;
+ _screen->hideMouse();
+ _screen->fillRect(0, 190, 319, 199, 0xCF);
+
+ if (string) {
+ if (palIndex != -1 || _fadeMessagePalette) {
+ palIndex *= 3;
+ memcpy(_messagePal, _screen->_currentPalette + palIndex, 3);
+ memmove(_screen->_currentPalette + 765, _screen->_currentPalette + palIndex, 3);
+ _screen->setScreenPalette(_screen->_currentPalette);
+ }
+
+ int x = _text->getCenterStringX(string, 0, 320);
+ _text->printText(string, x, 190, 255, 207, 0);
+
+ setTimer1DelaySecs(7);
+ }
+
+ _fadeMessagePalette = false;
+ _screen->showMouse();
+}
+
+void KyraEngine_HoF::showChapterMessage(int id, int16 palIndex) {
+ showMessage(getChapterString(id), palIndex);
+}
+
+void KyraEngine_HoF::updateCommandLineEx(int str1, int str2, int16 palIndex) {
+ char buffer[0x51];
+ char *src = buffer;
+
+ strcpy(src, getTableString(str1, _cCodeBuffer, 1));
+
+ if (_flags.lang != Common::JA_JPN) {
+ while (*src != 0x20)
+ ++src;
+ ++src;
+ *src = toupper(*src);
+ }
+
+ strcpy((char*)_unkBuf500Bytes, src);
+
+ if (str2 > 0) {
+ if (_flags.lang != Common::JA_JPN)
+ strcat((char*)_unkBuf500Bytes, " ");
+ strcat((char*)_unkBuf500Bytes, getTableString(str2, _cCodeBuffer, 1));
+ }
+
+ showMessage((char*)_unkBuf500Bytes, palIndex);
+}
+
+void KyraEngine_HoF::fadeMessagePalette() {
+ if (!_fadeMessagePalette)
+ return;
+
+ bool updatePalette = false;
+ for (int i = 0; i < 3; ++i) {
+ if (_messagePal[i] >= 4) {
+ _messagePal[i] -= 4;
+ updatePalette = true;
+ } else if (_messagePal[i] != 0) {
+ _messagePal[i] = 0;
+ updatePalette = true;
+ }
+ }
+
+ if (updatePalette) {
+ memcpy(_screen->getPalette(0) + 765, _messagePal, 3);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ } else {
+ _fadeMessagePalette = false;
+ }
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::loadMouseShapes() {
+ _screen->loadBitmap("_MOUSE.CSH", 3, 3, 0);
+
+ for (int i = 0; i <= 8; ++i)
+ addShapeToPool(_screen->makeShapeCopy(_screen->getCPagePtr(3), i), i);
+}
+
+void KyraEngine_HoF::loadItemShapes() {
+ _screen->loadBitmap("_ITEMS.CSH", 3, 3, 0);
+
+ for (int i = 64; i <= 239; ++i)
+ addShapeToPool(_screen->getCPagePtr(3), i, i-64);
+
+ _res->loadFileToBuf("_ITEMHT.DAT", _itemHtDat, sizeof(_itemHtDat));
+ assert(_res->getFileSize("_ITEMHT.DAT") == sizeof(_itemHtDat));
+
+ _screen->_curPage = 0;
+}
+
+void KyraEngine_HoF::loadCharacterShapes(int shapes) {
+ char file[10];
+ strcpy(file, "_ZX.SHP");
+
+ _characterShapeFile = shapes;
+ file[2] = '0' + shapes;
+
+ uint8 *data = _res->fileData(file, 0);
+ for (int i = 9; i <= 32; ++i)
+ addShapeToPool(data, i, i-9);
+ delete [] data;
+
+ _characterShapeFile = shapes;
+}
+
+void KyraEngine_HoF::loadInventoryShapes() {
+ int curPageBackUp = _screen->_curPage;
+ _screen->_curPage = 2;
+
+ _screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
+
+ for (int i = 0; i < 10; ++i)
+ addShapeToPool(_screen->encodeShape(_inventoryX[i], _inventoryY[i], 16, 16, 0), 240+i);
+
+ _screen->_curPage = curPageBackUp;
+}
+
+void KyraEngine_HoF::runStartScript(int script, int unk1) {
+ char filename[14];
+ strcpy(filename, "_START0X.EMC");
+ filename[7] = script + '0';
+
+ EMCData scriptData;
+ EMCState scriptState;
+ memset(&scriptData, 0, sizeof(EMCData));
+ memset(&scriptState, 0, sizeof(EMCState));
+
+ _emc->load(filename, &scriptData, &_opcodes);
+ _emc->init(&scriptState, &scriptData);
+ scriptState.regs[6] = unk1;
+ _emc->start(&scriptState, 0);
+ while (_emc->isValid(&scriptState))
+ _emc->run(&scriptState);
+ _emc->unload(&scriptData);
+}
+
+void KyraEngine_HoF::loadNPCScript() {
+ char filename[12];
+ strcpy(filename, "_NPC.EMC");
+
+ if (_flags.platform != Common::kPlatformPC || _flags.isTalkie) {
+ switch (_lang) {
+ case 0:
+ filename[5] = 'E';
+ break;
+
+ case 1:
+ filename[5] = 'F';
+ break;
+
+ case 2:
+ filename[5] = 'G';
+ break;
+
+ case 3:
+ filename[5] = 'J';
+ break;
+
+ default:
+ break;
+ };
+ }
+
+ _emc->load(filename, &_npcScriptData, &_opcodes);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::resetScaleTable() {
+ Common::set_to(_scaleTable, _scaleTable + ARRAYSIZE(_scaleTable), 0x100);
+}
+
+void KyraEngine_HoF::setScaleTableItem(int item, int data) {
+ if (item >= 1 || item <= 15)
+ _scaleTable[item-1] = (data << 8) / 100;
+}
+
+int KyraEngine_HoF::getScale(int x, int y) {
+ return _scaleTable[_screen->getLayer(x, y) - 1];
+}
+
+void KyraEngine_HoF::setDrawLayerTableEntry(int entry, int data) {
+ if (entry >= 1 || entry <= 15)
+ _drawLayerTable[entry-1] = data;
+}
+
+int KyraEngine_HoF::getDrawLayer(int x, int y) {
+ int layer = _screen->getLayer(x, y);
+ layer = _drawLayerTable[layer-1];
+ if (layer < 0)
+ layer = 0;
+ else if (layer >= 7)
+ layer = 6;
+ return layer;
+}
+
+void KyraEngine_HoF::backUpPage0() {
+ if (_screenBuffer) {
+ _screen->hideMouse();
+ memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000);
+ _screen->showMouse();
+ }
+}
+
+void KyraEngine_HoF::restorePage0() {
+ restorePage3();
+ if (_screenBuffer)
+ _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer);
+}
+
+void KyraEngine_HoF::updateCharPal(int unk1) {
+ static bool unkVar1 = false;
+
+ if (!_useCharPal)
+ return;
+
+ int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1);
+ int palEntry = _charPalTable[layer];
+
+ if (palEntry != _charPalEntry && unk1) {
+ const uint8 *src = &_scenePal[(palEntry << 4) * 3];
+ uint8 *ptr = _screen->getPalette(0) + 336;
+ for (int i = 0; i < 48; ++i) {
+ *ptr -= (*ptr - *src) >> 1;
+ ++ptr;
+ ++src;
+ }
+ _screen->setScreenPalette(_screen->getPalette(0));
+ unkVar1 = true;
+ _charPalEntry = palEntry;
+ } else if (unkVar1 || !unk1) {
+ memcpy(_screen->getPalette(0) + 336, &_scenePal[(palEntry << 4) * 3], 48);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ unkVar1 = false;
+ }
+}
+
+void KyraEngine_HoF::setCharPalEntry(int entry, int value) {
+ if (entry > 15 || entry < 1)
+ entry = 1;
+ if (value > 8 || value < 0)
+ value = 0;
+ _charPalTable[entry] = value;
+ _useCharPal = 1;
+ _charPalEntry = 0;
+}
+
+int KyraEngine_HoF::inputSceneChange(int x, int y, int unk1, int unk2) {
+ bool refreshNPC = false;
+ uint16 curScene = _mainCharacter.sceneId;
+ _pathfinderFlag = 15;
+
+ if (!_unkHandleSceneChangeFlag) {
+ if (_unk3 == -3) {
+ if (_sceneList[curScene].exit4 != 0xFFFF) {
+ x = 4;
+ y = _sceneEnterY4;
+ _pathfinderFlag = 7;
+ }
+ } else if (_unk3 == -5) {
+ if (_sceneList[curScene].exit2 != 0xFFFF) {
+ x = 316;
+ y = _sceneEnterY2;
+ _pathfinderFlag = 7;
+ }
+ } else if (_unk3 == -6) {
+ if (_sceneList[curScene].exit1 != 0xFFFF) {
+ x = _sceneEnterX1;
+ y = _sceneEnterY1 - 2;
+ _pathfinderFlag = 14;
+ }
+ } else if (_unk3 == -4) {
+ if (_sceneList[curScene].exit3 != 0xFFFF) {
+ x = _sceneEnterX3;
+ y = 147;
+ _pathfinderFlag = 11;
+ }
+ }
+ }
+
+ int strId = 0;
+ int vocH = _flags.isTalkie ? 131 : -1;
+
+ if (_pathfinderFlag) {
+ if (findItem(curScene, 13) >= 0 && _unk3 <= -3) {
+ strId = 252;
+ } else if (_itemInHand == 72) {
+ strId = 257;
+ } else if (findItem(curScene, 72) >= 0 && _unk3 <= -3) {
+ strId = 256;
+ } else if (getInventoryItemSlot(72) != -1 && _unk3 <= -3) {
+ strId = 257;
+ }
+ }
+
+ if (strId) {
+ updateCharFacing();
+ objectChat(getTableString(strId, _cCodeBuffer, 1), 0, vocH, strId);
+ _pathfinderFlag = 0;
+ return 0;
+ }
+
+ if (ABS(_mainCharacter.x1 - x) < 4 && ABS(_mainCharacter.y1 - y) < 2) {
+ _pathfinderFlag = 0;
+ return 0;
+ }
+
+ int curX = _mainCharacter.x1 & ~3;
+ int curY = _mainCharacter.y1 & ~1;
+ int dstX = x & ~3;
+ int dstY = y & ~1;
+
+ int wayLength = findWay(curX, curY, dstX, dstY, _movFacingTable, 600);
+ _pathfinderFlag = 0;
+ _timer->disable(5);
+
+ if (wayLength != 0 && wayLength != 0x7D00)
+ refreshNPC = (trySceneChange(_movFacingTable, unk1, unk2) != 0);
+
+ int charLayer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1);
+ if (_layerFlagTable[charLayer] != 0 && !queryGameFlag(0x163)) {
+ if (queryGameFlag(0x164)) {
+ _screen->hideMouse();
+ _timer->disable(5);
+ runAnimationScript("_ZANBURN.EMC", 0, 1, 1, 0);
+ _deathHandler = 7;
+ snd_playWanderScoreViaMap(0x53, 1);
+ } else {
+ objectChat(getTableString(0xFD, _cCodeBuffer, 1), 0, 0x83, 0xFD);
+ setGameFlag(0x164);
+ _timer->enable(5);
+ _timer->setCountdown(5, 120);
+ }
+ } else if (queryGameFlag(0x164)) {
+ objectChat(getTableString(0xFE, _cCodeBuffer, 1), 0, 0x83, 0xFE);
+ resetGameFlag(0x164);
+ _timer->disable(5);
+ }
+
+ if (refreshNPC)
+ enterNewSceneUnk2(0);
+
+ _pathfinderFlag = 0;
+ return refreshNPC;
+}
+
+int KyraEngine_HoF::getCharacterWalkspeed() const {
+ return _timer->getDelay(0);
+}
+
+void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) {
+ static int unkTable1[] = { 0, 0 };
+ static const int unkTable2[] = { 17, 0 };
+ static const int unkTable3[] = { 10, 0 };
+ static const int unkTable4[] = { 24, 0 };
+ static const int unkTable5[] = { 19, 0 };
+ static const int unkTable6[] = { 21, 0 };
+ static const int unkTable7[] = { 31, 0 };
+ static const int unkTable8[] = { 26, 0 };
+
+ Character *character = &_mainCharacter;
+ ++character->animFrame;
+
+ int facing = character->facing;
+
+ if (table) {
+ if (table[0] != table[-1] && table[-1] == table[1]) {
+ facing = getOppositeFacingDirection(table[-1]);
+ table[0] = table[-1];
+ }
+ }
+
+ if (!facing) {
+ ++unkTable1[charId];
+ } else if (facing == 4) {
+ ++unkTable1[charId+1];
+ } else if (facing == 7 || facing == 1 || facing == 5 || facing == 3) {
+ if (facing == 7 || facing == 1) {
+ if (unkTable1[charId] > 2)
+ facing = 0;
+ } else {
+ if (unkTable1[charId+1] > 2)
+ facing = 4;
+ }
+
+ unkTable1[charId] = 0;
+ unkTable1[charId+1] = 0;
+ }
+
+ if (facing == 0) {
+ if (character->animFrame < unkTable8[charId])
+ character->animFrame = unkTable8[charId];
+
+ if (character->animFrame > unkTable7[charId])
+ character->animFrame = unkTable8[charId];
+ } else if (facing == 4) {
+ if (character->animFrame < unkTable5[charId])
+ character->animFrame = unkTable5[charId];
+
+ if (character->animFrame > unkTable4[charId])
+ character->animFrame = unkTable5[charId];
+ } else {
+ if (character->animFrame > unkTable5[charId])
+ character->animFrame = unkTable6[charId];
+
+ if (character->animFrame == unkTable2[charId])
+ character->animFrame = unkTable3[charId];
+
+ if (character->animFrame > unkTable2[charId])
+ character->animFrame = unkTable3[charId] + 2;
+ }
+
+ updateCharacterAnim(charId);
+}
+
+bool KyraEngine_HoF::checkCharCollision(int x, int y) {
+ int scale1 = 0, scale2 = 0, scale3 = 0;
+ int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
+ scale1 = getScale(_mainCharacter.x1, _mainCharacter.y1);
+ scale2 = (scale1 * 24) >> 8;
+ scale3 = (scale1 * 48) >> 8;
+
+ x1 = _mainCharacter.x1 - (scale2 >> 1);
+ x2 = _mainCharacter.x1 + (scale2 >> 1);
+ y1 = _mainCharacter.y1 - scale3;
+ y2 = _mainCharacter.y1;
+
+ if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
+ return true;
+
+ return false;
+}
+
+int KyraEngine_HoF::initAnimationShapes(uint8 *filedata) {
+ const int lastEntry = MIN(_animShapeLastEntry, 31);
+ for (int i = 0; i < lastEntry; ++i) {
+ addShapeToPool(filedata, i+33, i);
+ ShapeDesc *desc = &_shapeDescTable[24+i];
+ desc->xAdd = _animShapeXAdd;
+ desc->yAdd = _animShapeYAdd;
+ desc->width = _animShapeWidth;
+ desc->height = _animShapeHeight;
+ }
+ return lastEntry;
+}
+
+void KyraEngine_HoF::uninitAnimationShapes(int count, uint8 *filedata) {
+ for (int i = 0; i < count; ++i)
+ remShapeFromPool(i+33);
+ delete [] filedata;
+ setNextIdleAnimTimer();
+}
+
+void KyraEngine_HoF::setNextIdleAnimTimer() {
+ _nextIdleAnim = _system->getMillis() + _rnd.getRandomNumberRng(10, 15) * 60 * _tickLength;
+}
+
+void KyraEngine_HoF::showIdleAnim() {
+ static const uint8 scriptMinTable[] = {
+ 0x00, 0x05, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, 0xFF, 0x00
+ };
+
+ static const uint8 scriptMaxTable[] = {
+ 0x04, 0x06, 0x07, 0x08, 0x04, 0x09, 0x0A, 0x0B, 0xFF, 0x00
+ };
+
+ if (queryGameFlag(0x159) && _flags.isTalkie)
+ return;
+
+ static bool scriptAnimation = false;
+ if (!scriptAnimation && _flags.isTalkie) {
+ scriptAnimation = true;
+ randomSceneChat();
+ } else {
+ scriptAnimation = false;
+ if (_characterShapeFile > 8)
+ return;
+
+ int scriptMin = scriptMinTable[_characterShapeFile-1];
+ int scriptMax = scriptMaxTable[_characterShapeFile-1];
+ int script = 0;
+
+ if (scriptMin < scriptMax) {
+ do {
+ script = _rnd.getRandomNumberRng(scriptMin, scriptMax);
+ } while (script == _lastIdleScript);
+ } else {
+ script = scriptMin;
+ }
+
+ runIdleScript(script);
+ _lastIdleScript = script;
+ }
+}
+
+void KyraEngine_HoF::runIdleScript(int script) {
+ if (script < 0 || script >= 12)
+ script = 0;
+
+ if (_mainCharacter.animFrame != 18) {
+ setNextIdleAnimTimer();
+ } else {
+ // FIXME: move this to staticres.cpp?
+ static const char *idleScriptFiles[] = {
+ "_IDLHAIR.EMC", "_IDLDUST.EMC", "_IDLLEAN.EMC", "_IDLDIRT.EMC", "_IDLTOSS.EMC", "_IDLNOSE.EMC",
+ "_IDLBRSH.EMC", "_Z3IDLE.EMC", "_Z4IDLE.EMC", "_Z6IDLE.EMC", "_Z7IDLE.EMC", "_Z8IDLE.EMC"
+ };
+
+ runAnimationScript(idleScriptFiles[script], 1, 1, 1, 1);
+ }
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::backUpGfxRect24x24(int x, int y) {
+ _screen->copyRegionToBuffer(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect);
+}
+
+void KyraEngine_HoF::restoreGfxRect24x24(int x, int y) {
+ _screen->copyBlockToPage(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect);
+}
+
+void KyraEngine_HoF::backUpGfxRect32x32(int x, int y) {
+ _screen->copyRegionToBuffer(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
+}
+
+void KyraEngine_HoF::restoreGfxRect32x32(int x, int y) {
+ _screen->copyBlockToPage(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::openTalkFile(int newFile) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::openTalkFile(%d)", newFile);
+ char talkFilename[16];
+
+ if (_oldTalkFile > 0) {
+ sprintf(talkFilename, "CH%dVOC.TLK", _oldTalkFile);
+ _res->unloadPakFile(talkFilename);
+ _oldTalkFile = -1;
+ }
+
+ if (newFile == 0) {
+ strcpy(talkFilename, "ANYTALK.TLK");
+ _res->loadPakFile(talkFilename);
+ } else {
+ sprintf(talkFilename, "CH%dVOC.TLK", newFile);
+ _res->loadPakFile(talkFilename);
+ }
+
+ _oldTalkFile = newFile;
+}
+
+void KyraEngine_HoF::snd_playVoiceFile(int id) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_playVoiceFile(%d)", id);
+ char vocFile[9];
+ assert(id >= 0 && id <= 9999999);
+ sprintf(vocFile, "%07d", id);
+ if (_sound->voiceFileIsPresent(vocFile)) {
+ snd_stopVoice();
+
+ while (!_sound->voicePlay(vocFile)) {
+ updateWithText();
+ _system->delayMillis(10);
+ }
+
+ _speechFile = vocFile;
+ }
+}
+
+void KyraEngine_HoF::snd_loadSoundFile(int id) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_loadSoundFile(%d)", id);
+ if (id < 0 || !_trackMap)
+ return;
+
+ assert(id < _trackMapSize);
+ int file = _trackMap[id*2];
+ _curSfxFile = _curMusicTheme = file;
+ _sound->loadSoundFile(file);
+}
+
+void KyraEngine_HoF::playVoice(int high, int low) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::playVoice(%d, %d)", high, low);
+ if (!_flags.isTalkie)
+ return;
+ int vocFile = high * 10000 + low * 10;
+ snd_playVoiceFile(vocFile);
+}
+
+void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_playSoundEffect(%d, %d)", track, volume);
+
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
+ if (track == 10)
+ track = _lastSfxTrack;
+
+ if (track == 10 || track == -1)
+ return;
+
+ _lastSfxTrack = track;
+ }
+
+ int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]);
+ if (vocIndex != -1)
+ _sound->voicePlay(_ingameSoundList[vocIndex], true);
+ else if (_flags.platform == Common::kPlatformPC)
+ // TODO ?? Maybe there is a way to let users select whether they want
+ // voc, midi or adl sfx (even though it makes no sense to choose anything but voc).
+ KyraEngine::snd_playSoundEffect(track);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, int page, int sfx, int sFrame, int flags) {
+ int wsaFlags = 1;
+ if (flags)
+ wsaFlags |= 2;
+
+ if (!_invWsa.wsa)
+ _invWsa.wsa = new WSAMovieV2(this, _screen);
+
+ if (!_invWsa.wsa->open(filename, wsaFlags, 0))
+ error("Couldn't open inventory WSA file '%s'", filename);
+
+ _invWsa.curFrame = 0;
+ _invWsa.lastFrame = _invWsa.wsa->frames();
+
+ _invWsa.x = _invWsa.wsa->xAdd();
+ _invWsa.y = _invWsa.wsa->yAdd();
+ _invWsa.w = _invWsa.wsa->width();
+ _invWsa.h = _invWsa.wsa->height();
+ _invWsa.x2 = _invWsa.x + _invWsa.w - 1;
+ _invWsa.y2 = _invWsa.y + _invWsa.h - 1;
+
+ _invWsa.delay = delayTime;
+ _invWsa.page = page;
+ _invWsa.sfx = sfx;
+
+ _invWsa.specialFrame = sFrame;
+
+ if (_invWsa.page)
+ _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, 0, _invWsa.page, Screen::CR_NO_P_CHECK);
+
+ _invWsa.running = true;
+ _invWsa.timer = _system->getMillis();
+
+ if (run) {
+ while (_invWsa.running && !skipFlag() && !_quitFlag) {
+ update();
+ _system->delayMillis(10);
+ }
+
+ if (skipFlag()) {
+ resetSkipFlag();
+ displayInvWsaLastFrame();
+ }
+ }
+}
+
+void KyraEngine_HoF::closeInvWsa() {
+ _invWsa.wsa->close();
+ delete _invWsa.wsa;
+ _invWsa.wsa = 0;
+ _invWsa.running = false;
+}
+
+void KyraEngine_HoF::updateInvWsa() {
+ if (!_invWsa.running || !_invWsa.wsa)
+ return;
+
+ if (_invWsa.timer > _system->getMillis())
+ return;
+
+ _invWsa.wsa->setX(0);
+ _invWsa.wsa->setY(0);
+ _invWsa.wsa->setDrawPage(_invWsa.page);
+ _invWsa.wsa->displayFrame(_invWsa.curFrame, 0, 0, 0);
+
+ if (_invWsa.page)
+ _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
+
+ _invWsa.timer = _system->getMillis() + _invWsa.delay * _tickLength;
+
+ ++_invWsa.curFrame;
+ if (_invWsa.curFrame >= _invWsa.lastFrame)
+ displayInvWsaLastFrame();
+
+ if (_invWsa.curFrame == _invWsa.specialFrame)
+ snd_playSoundEffect(_invWsa.sfx);
+
+ if (_invWsa.sfx == -2) {
+ switch (_invWsa.curFrame) {
+ case 9: case 27: case 40:
+ snd_playSoundEffect(0x39);
+ break;
+
+ case 18: case 34: case 44:
+ snd_playSoundEffect(0x33);
+ break;
+
+ case 48:
+ snd_playSoundEffect(0x38);
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+void KyraEngine_HoF::displayInvWsaLastFrame() {
+ if (!_invWsa.wsa)
+ return;
+
+ _invWsa.wsa->setX(0);
+ _invWsa.wsa->setY(0);
+ _invWsa.wsa->setDrawPage(_invWsa.page);
+ _invWsa.wsa->displayFrame(_invWsa.lastFrame-1, 0, 0, 0);
+
+ if (_invWsa.page)
+ _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
+
+ closeInvWsa();
+
+ int32 countdown = _rnd.getRandomNumberRng(45, 80);
+ _timer->setCountdown(2, countdown * 60);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::setCauldronState(uint8 state, bool paletteFade) {
+ memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
+ Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL");
+ if (!file)
+ error("Couldn't load cauldron palette");
+ file->seek(state*18, SEEK_SET);
+ file->read(_screen->getPalette(2)+723, 18);
+ delete file;
+ file = 0;
+
+ if (paletteFade) {
+ snd_playSoundEffect((state == 0) ? 0x6B : 0x66);
+ _screen->fadePalette(_screen->getPalette(2), 0x4B, &_updateFunctor);
+ } else {
+ _screen->setScreenPalette(_screen->getPalette(2));
+ _screen->updateScreen();
+ }
+
+ memcpy(_screen->getPalette(0)+723, _screen->getPalette(2)+723, 18);
+ _cauldronState = state;
+ _cauldronUseCount = 0;
+ //if (state == 5)
+ // sub_27149();
+}
+
+void KyraEngine_HoF::clearCauldronTable() {
+ Common::set_to(_cauldronTable, _cauldronTable+ARRAYSIZE(_cauldronTable), -1);
+}
+
+void KyraEngine_HoF::addFrontCauldronTable(int item) {
+ for (int i = 23; i >= 0; --i)
+ _cauldronTable[i+1] = _cauldronTable[i];
+ _cauldronTable[0] = item;
+}
+
+void KyraEngine_HoF::cauldronItemAnim(int item) {
+ const int x = 282;
+ const int y = 135;
+ const int mouseDstX = (x + 7) & (~1);
+ const int mouseDstY = (y + 15) & (~1);
+ int mouseX = _mouseX & (~1);
+ int mouseY = _mouseY & (~1);
+
+ while (mouseY != mouseDstY) {
+ if (mouseY < mouseDstY)
+ mouseY += 2;
+ else if (mouseY > mouseDstY)
+ mouseY -= 2;
+ uint32 waitEnd = _system->getMillis() + _tickLength;
+ setMousePos(mouseX, mouseY);
+ _system->updateScreen();
+ delayUntil(waitEnd);
+ }
+
+ while (mouseX != mouseDstX) {
+ if (mouseX < mouseDstX)
+ mouseX += 2;
+ else if (mouseX > mouseDstX)
+ mouseX -= 2;
+ uint32 waitEnd = _system->getMillis() + _tickLength;
+ setMousePos(mouseX, mouseY);
+ _system->updateScreen();
+ delayUntil(waitEnd);
+ }
+
+ if (itemIsFlask(item)) {
+ setHandItem(19);
+ delayUntil(_system->getMillis()+_tickLength*30);
+ setHandItem(18);
+ } else {
+ _screen->hideMouse();
+ backUpGfxRect32x32(x, y);
+ uint8 *shape = getShapePtr(item+64);
+
+ int curY = y;
+ for (int i = 0; i < 12; i += 2, curY += 2) {
+ restoreGfxRect32x32(x, y);
+ uint32 waitEnd = _system->getMillis() + _tickLength;
+ _screen->drawShape(0, shape, x, curY, 0, 0);
+ _screen->updateScreen();
+ delayUntil(waitEnd);
+ }
+
+ snd_playSoundEffect(0x17);
+
+ for (int i = 16; i > 0; i -= 2, curY += 2) {
+ _screen->setNewShapeHeight(shape, i);
+ restoreGfxRect32x32(x, y);
+ uint32 waitEnd = _system->getMillis() + _tickLength;
+ _screen->drawShape(0, shape, x, curY, 0, 0);
+ _screen->updateScreen();
+ delayUntil(waitEnd);
+ }
+
+ restoreGfxRect32x32(x, y);
+ _screen->resetShapeHeight(shape);
+ removeHandItem();
+ _screen->showMouse();
+ }
+}
+
+bool KyraEngine_HoF::updateCauldron() {
+ for (int i = 0; i < 23; ++i) {
+ const int16 *curStateTable = _cauldronStateTables[i];
+ if (*curStateTable == -2)
+ continue;
+
+ int cauldronState = i;
+ int16 cauldronTable[25];
+ memcpy(cauldronTable, _cauldronTable, sizeof(cauldronTable));
+
+ while (*curStateTable != -2) {
+ int stateValue = *curStateTable++;
+ int j = 0;
+ for (; j < 25; ++j) {
+ int val = cauldronTable[j];
+
+ switch (val) {
+ case 68:
+ val = 70;
+ break;
+
+ case 133:
+ case 167:
+ val = 119;
+ break;
+
+ case 130:
+ case 143:
+ case 100:
+ val = 12;
+ break;
+
+ case 132:
+ case 65:
+ case 69:
+ case 74:
+ val = 137;
+ break;
+
+ case 157:
+ val = 134;
+ break;
+
+ default:
+ break;
+ }
+
+ if (val == stateValue) {
+ cauldronTable[j] = -1;
+ j = 26;
+ }
+ }
+
+ if (j == 25)
+ cauldronState = -1;
+ }
+
+ if (cauldronState >= 0) {
+ showMessage(0, 0xCF);
+ setCauldronState(cauldronState, true);
+ if (cauldronState == 7)
+ objectChat(getTableString(0xF2, _cCodeBuffer, 1), 0, 0x83, 0xF2);
+ clearCauldronTable();
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void KyraEngine_HoF::cauldronRndPaletteFade() {
+ showMessage(0, 0xCF);
+ int index = _rnd.getRandomNumberRng(0x0F, 0x16);
+ Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL");
+ if (!file)
+ error("Couldn't load cauldron palette");
+ file->seek(index*18, SEEK_SET);
+ file->read(_screen->getPalette(0)+723, 18);
+ snd_playSoundEffect(0x6A);
+ _screen->fadePalette(_screen->getPalette(0), 0x1E, &_updateFunctor);
+ file->seek(0, SEEK_SET);
+ file->read(_screen->getPalette(0)+723, 18);
+ delete file;
+ _screen->fadePalette(_screen->getPalette(0), 0x1E, &_updateFunctor);
+}
+
+void KyraEngine_HoF::resetCauldronStateTable(int idx) {
+ for (int i = 0; i < 7; ++i)
+ _cauldronStateTables[idx][i] = -2;
+}
+
+bool KyraEngine_HoF::addToCauldronStateTable(int data, int idx) {
+ for (int i = 0; i < 7; ++i) {
+ if (_cauldronStateTables[idx][i] == -2) {
+ _cauldronStateTables[idx][i] = data;
+ return true;
+ }
+ }
+ return false;
+}
+
+void KyraEngine_HoF::listItemsInCauldron() {
+ int itemsInCauldron = 0;
+ for (int i = 0; i < 25; ++i) {
+ if (_cauldronTable[i] != -1)
+ ++itemsInCauldron;
+ else
+ break;
+ }
+
+ if (!itemsInCauldron) {
+ if (!_cauldronState)
+ objectChat(getTableString(0xF4, _cCodeBuffer, 1), 0, 0x83, 0xF4);
+ else
+ objectChat(getTableString(0xF3, _cCodeBuffer, 1), 0, 0x83, 0xF3);
+ } else {
+ objectChat(getTableString(0xF7, _cCodeBuffer, 1), 0, 0x83, 0xF7);
+
+ char buffer[80];
+ for (int i = 0; i < itemsInCauldron-1; ++i) {
+ char *str = buffer;
+ strcpy(str, getTableString(_cauldronTable[i]+54, _cCodeBuffer, 1));
+ if (_lang == 1) {
+ if (*str == 37)
+ str += 2;
+ }
+ strcpy((char*)_unkBuf500Bytes, "...");
+ strcat((char*)_unkBuf500Bytes, str);
+ strcat((char*)_unkBuf500Bytes, "...");
+ objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[i]+54);
+ }
+
+ char *str = buffer;
+ strcpy(str, getTableString(_cauldronTable[itemsInCauldron-1]+54, _cCodeBuffer, 1));
+ if (_lang == 1) {
+ if (*str == 37)
+ str += 2;
+ }
+ strcpy((char*)_unkBuf500Bytes, "...");
+ strcat((char*)_unkBuf500Bytes, str);
+ strcat((char*)_unkBuf500Bytes, ".");
+ objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[itemsInCauldron-1]+54);
+ }
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::dinoRide() {
+ _mainCharX = _mainCharY = -1;
+
+ setGameFlag(0x15A);
+ enterNewScene(41, -1, 0, 0, 0);
+ resetGameFlag(0x15A);
+
+ setGameFlag(0x15B);
+ enterNewScene(39, -1, 0, 0, 0);
+ resetGameFlag(0x15B);
+
+ setGameFlag(0x16F);
+
+ setGameFlag(0x15C);
+ enterNewScene(42, -1, 0, 0, 0);
+ resetGameFlag(0x15C);
+
+ setGameFlag(0x15D);
+ enterNewScene(39, -1, 0, 0, 0);
+ resetGameFlag(0x15D);
+
+ setGameFlag(0x15E);
+ enterNewScene(40, -1, 0, 0, 0);
+ resetGameFlag(0x15E);
+
+ _mainCharX = 262;
+ _mainCharY = 28;
+ _mainCharacter.facing = 5;
+ _mainCharacter.animFrame = _characterFrameTable[5];
+ enterNewScene(39, 4, 0, 0, 0);
+ setHandItem(0x61);
+ _screen->showMouse();
+ resetGameFlag(0x159);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::playTim(const char *filename) {
+ TIM *tim = _tim->load(filename, &_timOpcodes);
+ if (!tim)
+ return;
+
+ _tim->resetFinishedFlag();
+ while (!_quitFlag && !_tim->finished()) {
+ _tim->exec(tim, 0);
+ if (_chatText)
+ updateWithText();
+ else
+ update();
+ delay(10);
+ }
+
+ _tim->unload(tim);
+}
+
+#pragma mark -
+
+void KyraEngine_HoF::registerDefaultSettings() {
+ KyraEngine::registerDefaultSettings();
+
+ // Most settings already have sensible defaults. This one, however, is
+ // specific to the Kyra engine.
+ ConfMan.registerDefault("walkspeed", 5);
+}
+
+void KyraEngine_HoF::writeSettings() {
+ ConfMan.setInt("talkspeed", ((_configTextspeed-2) * 255) / 95);
+
+ switch (_lang) {
+ case 1:
+ _flags.lang = Common::FR_FRA;
+ break;
+
+ case 2:
+ _flags.lang = Common::DE_DEU;
+ break;
+
+ case 3:
+ _flags.lang = Common::JA_JPN;
+ break;
+
+ case 0:
+ default:
+ _flags.lang = Common::EN_ANY;
+ break;
+ }
+
+ ConfMan.set("language", Common::getLanguageCode(_flags.lang));
+
+ KyraEngine::writeSettings();
+}
+
+void KyraEngine_HoF::readSettings() {
+ int talkspeed = ConfMan.getInt("talkspeed");
+ _configTextspeed = (talkspeed*95)/255 + 2;
+ KyraEngine::readSettings();
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h
new file mode 100644
index 0000000000..1e6c23331e
--- /dev/null
+++ b/engines/kyra/kyra_hof.h
@@ -0,0 +1,916 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA_KYRA_HOF_H
+#define KYRA_KYRA_HOF_H
+
+#include "kyra/kyra_v2.h"
+#include "kyra/script.h"
+#include "kyra/script_tim.h"
+#include "kyra/screen_hof.h"
+#include "kyra/text_hof.h"
+#include "kyra/gui_hof.h"
+
+#include "common/list.h"
+#include "common/func.h"
+
+namespace Kyra {
+
+enum kSequences {
+ kSequenceVirgin = 0,
+ kSequenceWestwood,
+ kSequenceTitle,
+ kSequenceOverview,
+ kSequenceLibrary,
+ kSequenceHand,
+ kSequencePoint,
+ kSequenceZanfaun,
+
+ kSequenceFunters,
+ kSequenceFerb,
+ kSequenceFish,
+ kSequenceFheep,
+ kSequenceFarmer,
+ kSequenceFuards,
+ kSequenceFirates,
+ kSequenceFrash,
+
+ kSequenceArraySize
+};
+
+enum kNestedSequences {
+ kSequenceFiggle = 0,
+ kSequenceOver1,
+ kSequenceOver2,
+ kSequenceForest,
+ kSequenceDragon,
+ kSequenceDarm,
+ kSequenceLibrary2,
+ kSequenceLibrary3,
+ kSequenceMarco,
+ kSequenceHand1a,
+ kSequenceHand1b,
+ kSequenceHand1c,
+ kSequenceHand2,
+ kSequenceHand3,
+ kSequenceHand4
+};
+
+enum kSequencesDemo {
+ kSequenceDemoVirgin = 0,
+ kSequenceDemoWestwood,
+ kSequenceDemoTitle,
+ kSequenceDemoHill,
+ kSequenceDemoOuthome,
+ kSequenceDemoWharf,
+ kSequenceDemoDinob,
+ kSequenceDemoFisher
+};
+
+enum kNestedSequencesDemo {
+ kSequenceDemoWharf2 = 0,
+ kSequenceDemoDinob2,
+ kSequenceDemoWater,
+ kSequenceDemoBail,
+ kSequenceDemoDig
+};
+
+class WSAMovieV2;
+class KyraEngine_HoF;
+class TextDisplayer_HoF;
+
+struct TIM;
+
+typedef int (KyraEngine_HoF::*SeqProc)(WSAMovieV2*, int, int, int);
+
+struct FrameControl {
+ uint16 index;
+ uint16 delay;
+};
+
+struct ActiveWSA {
+ int16 flags;
+ WSAMovieV2 *movie;
+ uint16 startFrame;
+ uint16 endFrame;
+ uint16 frameDelay;
+ SeqProc callback;
+ uint32 nextFrame;
+ uint16 currentFrame;
+ uint16 lastFrame;
+ uint16 x;
+ uint16 y;
+ const FrameControl *control;
+ uint16 startupCommand;
+ uint16 finalCommand;
+};
+
+struct ActiveText {
+ uint16 strIndex;
+ uint16 x;
+ uint16 y;
+ int duration;
+ uint16 width;
+ uint32 startTime;
+ int16 textcolor;
+};
+
+struct Sequence {
+ uint16 flags;
+ const char * wsaFile;
+ const char * cpsFile;
+ uint8 startupCommand;
+ uint8 finalCommand;
+ int16 stringIndex1;
+ int16 stringIndex2;
+ uint16 startFrame;
+ uint16 numFrames;
+ uint16 frameDelay;
+ uint16 xPos;
+ uint16 yPos;
+ uint16 duration;
+};
+
+struct NestedSequence {
+ uint16 flags;
+ const char * wsaFile;
+ uint16 startframe;
+ uint16 endFrame;
+ uint16 frameDelay;
+ uint16 x;
+ uint16 y;
+ const FrameControl *wsaControl;
+ uint16 startupCommand;
+ uint16 finalCommand;
+};
+
+struct HofSeqData {
+ const Sequence *seq;
+ int numSeq;
+ const NestedSequence *seqn;
+ int numSeqn;
+};
+
+struct ItemAnimData_v1 {
+ int16 itemIndex;
+ uint16 y;
+ const uint16 *frames;
+};
+
+struct ItemAnimData_v2 {
+ int16 itemIndex;
+ uint8 numFrames;
+ const FrameControl *frames;
+};
+
+struct ActiveItemAnim {
+ uint16 currentFrame;
+ uint32 nextFrame;
+};
+
+class KyraEngine_HoF : public KyraEngine_v2 {
+friend class Debugger_HoF;
+friend class TextDisplayer_HoF;
+friend class GUI_HoF;
+public:
+ KyraEngine_HoF(OSystem *system, const GameFlags &flags);
+ ~KyraEngine_HoF();
+
+ Screen *screen() { return _screen; }
+ Screen_v2 *screen_v2() const { return _screen; }
+ GUI_v2 *gui_v2() const { return _gui; }
+ virtual TextDisplayer *text() { return _text; }
+ int language() const { return _lang; }
+protected:
+ static const EngineDesc _hofEngineDesc;
+
+ // intro/outro
+ void seq_playSequences(int startSeq, int endSeq = -1);
+
+ int seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ int seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ int seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ int seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ int seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ int seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm);
+
+ void seq_sequenceCommand(int command);
+ void seq_loadNestedSequence(int wsaNum, int seqNum);
+ void seq_nestedSequenceFrame(int command, int wsaNum);
+ void seq_animatedSubFrame(int srcPage, int dstPage, int delaytime,
+ int steps, int x, int y, int w, int h, int openClose, int directionFlags);
+ bool seq_processNextSubFrame(int wsaNum);
+ void seq_resetActiveWSA(int wsaNum);
+ void seq_unloadWSA(int wsaNum);
+ void seq_processWSAs();
+ void seq_cmpFadeFrame(const char *cmpFile);
+ void seq_playTalkText(uint8 chatNum);
+ void seq_resetAllTextEntries();
+ uint32 seq_activeTextsTimeLeft();
+ void seq_waitForTextsTimeout();
+ int seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width);
+ void seq_processText();
+ char *seq_preprocessString(const char *str, int width);
+ void seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor);
+ void seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width,
+ WSAMovieV2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos);
+ void seq_finaleActorScreen();
+ void seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0);
+ void seq_scrollPage();
+ void seq_showStarcraftLogo();
+
+ void seq_init();
+ void seq_uninit();
+
+ int init();
+ int go();
+
+ Screen_HoF *_screen;
+ TextDisplayer_HoF *_text;
+ TIMInterpreter *_tim;
+
+ uint8 *_mouseSHPBuf;
+
+ static const int8 _dosTrackMap[];
+ static const int _dosTrackMapSize;
+
+ const AudioDataStruct *_soundData;
+
+protected:
+ // game initialization
+ void startup();
+ void runLoop();
+ void cleanup();
+
+ void registerDefaultSettings();
+ void writeSettings();
+ void readSettings();
+ uint8 _configTextspeed;
+
+ // TODO: get rid of all variables having pointers to the static resources if possible
+ // i.e. let them directly use the _staticres functions
+ void initStaticResource();
+
+ void setupTimers();
+ void setupOpcodeTable();
+
+ void loadMouseShapes();
+ void loadItemShapes();
+
+ // run
+ void update();
+ void updateWithText();
+
+ Common::Functor0Mem<void, KyraEngine_HoF> _updateFunctor;
+
+ void updateMouse();
+
+ void dinoRide();
+
+ int _mouseState;
+
+ void handleInput(int x, int y);
+ bool handleInputUnkSub(int x, int y);
+
+ int inputSceneChange(int x, int y, int unk1, int unk2);
+
+ // gfx/animation specific
+ bool _inventorySaved;
+ void backUpPage0();
+ void restorePage0();
+
+ uint8 *_gfxBackUpRect;
+
+ void backUpGfxRect24x24(int x, int y);
+ void restoreGfxRect24x24(int x, int y);
+ void backUpGfxRect32x32(int x, int y);
+ void restoreGfxRect32x32(int x, int y);
+
+ uint8 *_sceneShapeTable[50];
+
+ WSAMovieV2 *_wsaSlots[10];
+
+ void freeSceneShapePtrs();
+
+ struct ShapeDesc {
+ uint8 unk0, unk1, unk2, unk3, unk4;
+ uint16 width, height;
+ int16 xAdd, yAdd;
+ };
+
+ ShapeDesc *_shapeDescTable;
+
+ void loadCharacterShapes(int shapes);
+ void loadInventoryShapes();
+
+ void resetScaleTable();
+ void setScaleTableItem(int item, int data);
+ int getScale(int x, int y);
+ uint16 _scaleTable[15];
+
+ void setDrawLayerTableEntry(int entry, int data);
+ int getDrawLayer(int x, int y);
+ int _drawLayerTable[15];
+
+ int _layerFlagTable[16]; // seems to indicate layers where items get destroyed when dropped to (TODO: check this!)
+
+ int initAnimationShapes(uint8 *filedata);
+ void uninitAnimationShapes(int count, uint8 *filedata);
+
+ // animator
+ uint8 *_gamePlayBuffer;
+ void restorePage3();
+
+ void clearAnimObjects();
+
+ void refreshAnimObjects(int force);
+
+ void drawAnimObjects();
+ void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer);
+ void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer);
+
+ void updateItemAnimations();
+
+ void updateCharFacing();
+ void updateCharacterAnim(int);
+ void updateSceneAnim(int anim, int newFrame);
+
+ int _animObj0Width, _animObj0Height;
+ void setCharacterAnimDim(int w, int h);
+ void resetCharacterAnimDim();
+
+ // scene
+ const char *_sceneCommentString;
+ uint8 _scenePal[688];
+
+ void enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3);
+ void enterNewSceneUnk1(int facing, int unk1, int unk2);
+ void enterNewSceneUnk2(int unk1);
+ void unloadScene();
+
+ void loadScenePal();
+ void loadSceneMsc();
+
+ void fadeScenePal(int srcIndex, int delay);
+
+ void startSceneScript(int unk1);
+ void runSceneScript2();
+ void runSceneScript4(int unk1);
+ void runSceneScript7();
+
+ void initSceneAnims(int unk1);
+ void initSceneScreen(int unk1);
+
+ int trySceneChange(int *moveTable, int unk1, int updateChar);
+ int checkSceneChange();
+
+ // pathfinder
+ bool lineIsPassable(int x, int y);
+
+ // item
+ void setMouseCursor(uint16 item);
+
+ uint8 _itemHtDat[176];
+
+ int checkItemCollision(int x, int y);
+ void updateWaterFlasks();
+
+ bool dropItem(int unk1, uint16 item, int x, int y, int unk2);
+ bool processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2);
+ void itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item);
+ void exchangeMouseItem(int itemPos);
+ bool pickUpItem(int x, int y);
+
+ bool isDropable(int x, int y);
+
+ static const byte _itemStringMap[];
+ static const int _itemStringMapSize;
+
+ static const int16 _flaskTable[];
+ bool itemIsFlask(int item);
+
+ // inventory
+ static const int _inventoryX[];
+ static const int _inventoryY[];
+ static const uint16 _itemMagicTable[];
+
+ int getInventoryItemSlot(uint16 item);
+ void removeSlotFromInventory(int slot);
+ bool checkInventoryItemExchange(uint16 item, int slot);
+ void drawInventoryShape(int page, uint16 item, int slot);
+ void clearInventorySlot(int slot, int page);
+ void redrawInventory(int page);
+ void scrollInventoryWheel();
+ int findFreeVisibleInventorySlot();
+
+ ActiveItemAnim _activeItemAnim[15];
+ int _nextAnimItem;
+
+ // gui
+ bool _menuDirectlyToLoad;
+ GUI_HoF *_gui;
+
+ void loadButtonShapes();
+ void setupLangButtonShapes();
+ uint8 *_buttonShapes[19];
+
+ void initInventoryButtonList();
+ Button *_inventoryButtons;
+ Button *_buttonList;
+
+ int scrollInventory(Button *button);
+ int buttonInventory(Button *button);
+ int bookButton(Button *button);
+ int cauldronButton(Button *button);
+ int cauldronClearButton(Button *button);
+
+ // book
+ static const int _bookPageYOffset[];
+ static const byte _bookTextColorMap[];
+
+ int _bookMaxPage;
+ int _bookNewPage;
+ int _bookCurPage;
+ int _bookBkgd;
+ bool _bookShown;
+
+ void loadBookBkgd();
+ void showBookPage();
+ void bookLoop();
+
+ void bookDecodeText(uint8 *text);
+ void bookPrintText(int dstPage, const uint8 *text, int x, int y, uint8 color);
+
+ int bookPrevPage(Button *button);
+ int bookNextPage(Button *button);
+ int bookClose(Button *button);
+
+ // cauldron
+ uint8 _cauldronState;
+ int16 _cauldronUseCount;
+ int16 _cauldronTable[25];
+ int16 _cauldronStateTables[23][7];
+
+ static const int16 _cauldronProtectedItems[];
+ static const int16 _cauldronBowlTable[];
+ static const int16 _cauldronMagicTable[];
+ static const int16 _cauldronMagicTableScene77[];
+ static const uint8 _cauldronStateTable[];
+
+ void resetCauldronStateTable(int idx);
+ bool addToCauldronStateTable(int data, int idx);
+
+ void setCauldronState(uint8 state, bool paletteFade);
+ void clearCauldronTable();
+ void addFrontCauldronTable(int item);
+ void cauldronItemAnim(int item);
+ void cauldronRndPaletteFade();
+ bool updateCauldron();
+ void listItemsInCauldron();
+
+ // localization
+ void loadCCodeBuffer(const char *file);
+ void loadOptionsBuffer(const char *file);
+ void loadChapterBuffer(int chapter);
+ uint8 *_optionsBuffer;
+ uint8 *_cCodeBuffer;
+
+ uint8 *_chapterBuffer;
+ int _currentChapter;
+ int _newChapterFile;
+
+ uint8 *getTableEntry(uint8 *buffer, int id);
+ char *getTableString(int id, uint8 *buffer, int decode);
+ const char *getChapterString(int id);
+ int decodeString1(const char *src, char *dst);
+ void decodeString2(const char *src, char *dst);
+
+ void changeFileExtension(char *buffer);
+
+ // - Just used in French version
+ int getItemCommandStringDrop(uint16 item);
+ int getItemCommandStringPickUp(uint16 item);
+ int getItemCommandStringInv(uint16 item);
+ // -
+
+ char _internStringBuf[200];
+ static const char *_languageExtension[];
+ static const char *_scriptLangExt[];
+
+ // character
+ bool _useCharPal;
+ int _charPalEntry;
+ uint8 _charPalTable[16];
+ void updateCharPal(int unk1);
+ void setCharPalEntry(int entry, int value);
+
+ int getCharacterWalkspeed() const;
+ void updateCharAnimFrame(int num, int *table);
+
+ bool checkCharCollision(int x, int y);
+
+ static const uint8 _characterFrameTable[];
+
+ // text
+ void showMessageFromCCode(int id, int16 palIndex, int);
+ void showMessage(const char *string, int16 palIndex);
+ void showChapterMessage(int id, int16 palIndex);
+
+ void updateCommandLineEx(int str1, int str2, int16 palIndex);
+
+ const char *_shownMessage;
+
+ byte _messagePal[3];
+ bool _fadeMessagePalette;
+ void fadeMessagePalette();
+
+ // chat
+ bool _chatIsNote;
+
+ int chatGetType(const char *text);
+ int chatCalcDuration(const char *text);
+
+ void objectChat(const char *text, int object, int vocHigh = -1, int vocLow = -1);
+ void objectChatInit(const char *text, int object, int vocHigh = -1, int vocLow = -1);
+ void objectChatPrintText(const char *text, int object);
+ void objectChatProcess(const char *script);
+ void objectChatWaitToFinish();
+
+ void startDialogue(int dlgIndex);
+
+ void zanthSceneStartupChat();
+ void randomSceneChat();
+ void updateDlgBuffer();
+ void loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2);
+ void processDialogue(int dlgOffset, int vocH = 0, int csEntry = 0);
+ void npcChatSequence(const char *str, int objectId, int vocHigh = -1, int vocLow = -1);
+ void setDlgIndex(int dlgIndex);
+
+ int _npcTalkChpIndex;
+ int _npcTalkDlgIndex;
+ uint8 _newSceneDlgState[32];
+ int8 **_conversationState;
+ uint8 *_dlgBuffer;
+
+ // Talk object handling
+ void initTalkObject(int index);
+ void deinitTalkObject(int index);
+
+ struct TalkObject {
+ char filename[13];
+ int8 scriptId;
+ int16 x, y;
+ int8 color;
+ };
+ TalkObject *_talkObjectList;
+
+ struct TalkSections {
+ TIM *STATim;
+ TIM *TLKTim;
+ TIM *ENDTim;
+ };
+ TalkSections _currentTalkSections;
+
+ char _TLKFilename[13];
+
+ // tim
+ void playTim(const char *filename);
+
+ int t2_initChat(const TIM *tim, const uint16 *param);
+ int t2_updateSceneAnim(const TIM *tim, const uint16 *param);
+ int t2_resetChat(const TIM *tim, const uint16 *param);
+ int t2_playSoundEffect(const TIM *tim, const uint16 *param);
+
+ Common::Array<const TIMOpcode*> _timOpcodes;
+
+ // sound
+ int _oldTalkFile;
+ int _currentTalkFile;
+ void openTalkFile(int newFile);
+ int _lastSfxTrack;
+
+ virtual void snd_playVoiceFile(int id);
+ void snd_loadSoundFile(int id);
+
+ void playVoice(int high, int low);
+ void snd_playSoundEffect(int track, int volume=0xFF);
+
+ // timer
+ void timerFadeOutMessage(int);
+ void timerCauldronAnimation(int);
+ void timerFunc4(int);
+ void timerFunc5(int);
+ void timerBurnZanthia(int);
+
+ void setTimer1DelaySecs(int secs);
+
+ uint32 _nextIdleAnim;
+ int _lastIdleScript;
+
+ void setNextIdleAnimTimer();
+ void showIdleAnim();
+ void runIdleScript(int script);
+
+ void setWalkspeed(uint8 speed);
+
+ // delay
+ void delay(uint32 millis, bool updateGame = false, bool isMainLoop = false);
+
+ // ingame static sequence handling
+ void seq_makeBookOrCauldronAppear(int type);
+ void seq_makeBookAppear();
+
+ struct InventoryWsa {
+ int x, y, x2, y2, w, h;
+ int page;
+ int curFrame, lastFrame, specialFrame;
+ int sfx;
+ int delay;
+ bool running;
+ uint32 timer;
+ WSAMovieV2 *wsa;
+ } _invWsa;
+
+ // TODO: move inside KyraEngine_HoF::InventoryWsa?
+ void loadInvWsa(const char *filename, int run, int delay, int page, int sfx, int sFrame, int flags);
+ void closeInvWsa();
+
+ void updateInvWsa();
+ void displayInvWsaLastFrame();
+
+ // opcodes
+ int o2_setCharacterFacingRefresh(EMCState *script);
+ int o2_setCharacterPos(EMCState *script);
+ int o2_defineObject(EMCState *script);
+ int o2_refreshCharacter(EMCState *script);
+ int o2_setSceneComment(EMCState *script);
+ int o2_setCharacterAnimFrame(EMCState *script);
+ int o2_setCharacterFacing(EMCState *script);
+ int o2_customCharacterChat(EMCState *script);
+ int o2_soundFadeOut(EMCState *script);
+ int o2_showChapterMessage(EMCState *script);
+ int o2_restoreTalkTextMessageBkgd(EMCState *script);
+ int o2_wsaClose(EMCState *script);
+ int o2_meanWhileScene(EMCState *script);
+ int o2_backUpScreen(EMCState *script);
+ int o2_restoreScreen(EMCState *script);
+ int o2_displayWsaFrame(EMCState *script);
+ int o2_displayWsaSequentialFramesLooping(EMCState *script);
+ int o2_wsaOpen(EMCState *script);
+ int o2_displayWsaSequentialFrames(EMCState *script);
+ int o2_displayWsaSequence(EMCState *script);
+ int o2_addItemToInventory(EMCState *script);
+ int o2_drawShape(EMCState *script);
+ int o2_addItemToCurScene(EMCState *script);
+ int o2_loadSoundFile(EMCState *script);
+ int o2_removeSlotFromInventory(EMCState *script);
+ int o2_removeItemFromInventory(EMCState *script);
+ int o2_countItemInInventory(EMCState *script);
+ int o2_countItemsInScene(EMCState *script);
+ int o2_wipeDownMouseItem(EMCState *script);
+ int o2_getElapsedSecs(EMCState *script);
+ int o2_getTimerDelay(EMCState *script);
+ //int o2_playSoundEffect(EMCState *script);
+ int o2_delaySecs(EMCState *script);
+ int o2_setTimerDelay(EMCState *script);
+ int o2_setScaleTableItem(EMCState *script);
+ int o2_setDrawLayerTableItem(EMCState *script);
+ int o2_setCharPalEntry(EMCState *script);
+ int o2_loadZShapes(EMCState *script);
+ int o2_drawSceneShape(EMCState *script);
+ int o2_drawSceneShapeOnPage(EMCState *script);
+ int o2_disableAnimObject(EMCState *script);
+ int o2_enableAnimObject(EMCState *script);
+ int o2_loadPalette384(EMCState *script);
+ int o2_setPalette384(EMCState *script);
+ int o2_restoreBackBuffer(EMCState *script);
+ int o2_backUpInventoryGfx(EMCState *script);
+ int o2_disableSceneAnim(EMCState *script);
+ int o2_enableSceneAnim(EMCState *script);
+ int o2_restoreInventoryGfx(EMCState *script);
+ int o2_setSceneAnimPos2(EMCState *script);
+ int o2_fadeScenePal(EMCState *script);
+ int o2_enterNewScene(EMCState *script);
+ int o2_switchScene(EMCState *script);
+ int o2_setPathfinderFlag(EMCState *script);
+ int o2_getSceneExitToFacing(EMCState *script);
+ int o2_setLayerFlag(EMCState *script);
+ int o2_setZanthiaPos(EMCState *script);
+ int o2_loadMusicTrack(EMCState *script);
+ int o2_playSoundEffect(EMCState *script);
+ int o2_setSceneAnimPos(EMCState *script);
+ int o2_blockInRegion(EMCState *script);
+ int o2_blockOutRegion(EMCState *script);
+ int o2_setCauldronState(EMCState *script);
+ int o2_showItemString(EMCState *script);
+ int o2_isAnySoundPlaying(EMCState *script);
+ int o2_setDrawNoShapeFlag(EMCState *script);
+ int o2_setRunFlag(EMCState *script);
+ int o2_showLetter(EMCState *script);
+ int o2_fillRect(EMCState *script);
+ int o2_encodeShape(EMCState *script);
+ int o2_defineSceneAnim(EMCState *script);
+ int o2_updateSceneAnim(EMCState *script);
+ int o2_addToSceneAnimPosAndUpdate(EMCState *script);
+ int o2_useItemOnMainChar(EMCState *script);
+ int o2_startDialogue(EMCState *script);
+ int o2_addCauldronStateTableEntry(EMCState *script);
+ int o2_setCountDown(EMCState *script);
+ int o2_getCountDown(EMCState *script);
+ int o2_pressColorKey(EMCState *script);
+ int o2_objectChat(EMCState *script);
+ int o2_changeChapter(EMCState *script);
+ int o2_getColorCodeFlag1(EMCState *script);
+ int o2_setColorCodeFlag1(EMCState *script);
+ int o2_getColorCodeFlag2(EMCState *script);
+ int o2_setColorCodeFlag2(EMCState *script);
+ int o2_getColorCodeValue(EMCState *script);
+ int o2_setColorCodeValue(EMCState *script);
+ int o2_countItemInstances(EMCState *script);
+ int o2_removeItemFromScene(EMCState *script);
+ int o2_initObject(EMCState *script);
+ int o2_npcChat(EMCState *script);
+ int o2_deinitObject(EMCState *script);
+ int o2_playTimSequence(EMCState *script);
+ int o2_makeBookOrCauldronAppear(EMCState *script);
+ int o2_resetInputColorCode(EMCState *script);
+ int o2_mushroomEffect(EMCState *script);
+ int o2_customChat(EMCState *script);
+ int o2_customChatFinish(EMCState *script);
+ int o2_setupSceneAnimation(EMCState *script);
+ int o2_stopSceneAnimation(EMCState *script);
+ int o2_processPaletteIndex(EMCState *script);
+ int o2_updateTwoSceneAnims(EMCState *script);
+ int o2_getRainbowRoomData(EMCState *script);
+ int o2_drawSceneShapeEx(EMCState *script);
+ int o2_getBoolFromStack(EMCState *script);
+ int o2_getSfxDriver(EMCState *script);
+ int o2_getVocSupport(EMCState *script);
+ int o2_getMusicDriver(EMCState *script);
+ int o2_zanthiaChat(EMCState *script);
+ int o2_isVoiceEnabled(EMCState *script);
+ int o2_isVoicePlaying(EMCState *script);
+ int o2_stopVoicePlaying(EMCState *script);
+ int o2_getGameLanguage(EMCState *script);
+ int o2_demoFinale(EMCState *script);
+ int o2_dummy(EMCState *script);
+
+ // animation opcodes
+ int o2a_setCharacterFrame(EMCState *script);
+
+ // script
+ void runStartScript(int script, int unk1);
+ void loadNPCScript();
+
+ bool _noScriptEnter;
+
+ EMCData _npcScriptData;
+
+ // pathfinder
+ uint8 *_unkBuf500Bytes;
+ uint8 *_unkBuf200kByte;
+ bool _chatAltFlag;
+
+ // sequence player
+ ActiveWSA *_activeWSA;
+ ActiveText *_activeText;
+
+ const char *const *_sequencePakList;
+ int _sequencePakListSize;
+ const char *const *_ingamePakList;
+ int _ingamePakListSize;
+
+ const char *const *_musicFileListIntro;
+ int _musicFileListIntroSize;
+ const char *const *_musicFileListFinale;
+ int _musicFileListFinaleSize;
+ const char *const *_musicFileListIngame;
+ int _musicFileListIngameSize;
+ const uint8 *_cdaTrackTableIntro;
+ int _cdaTrackTableIntroSize;
+ const uint8 *_cdaTrackTableIngame;
+ int _cdaTrackTableIngameSize;
+ const uint8 *_cdaTrackTableFinale;
+ int _cdaTrackTableFinaleSize;
+ const char *const *_sequenceSoundList;
+ int _sequenceSoundListSize;
+ const char *const *_ingameSoundList;
+ int _ingameSoundListSize;
+ const uint16 *_ingameSoundIndex;
+ int _ingameSoundIndexSize;
+ const char *const *_sequenceStrings;
+ int _sequenceStringsSize;
+ const uint16 *_ingameTalkObjIndex;
+ int _ingameTalkObjIndexSize;
+ const char *const *_ingameTimJpStr;
+ int _ingameTimJpStrSize;
+ const HofSeqData *_sequences;
+ const ItemAnimData_v2 *_itemAnimData;
+ int _itemAnimDataSize;
+ const ItemAnimData_v1 *_demoAnimData;
+ int _demoAnimSize;
+
+ int _sequenceStringsDuration[33];
+
+ static const uint8 _seqTextColorPresets[];
+ char *_seqProcessedString;
+ WSAMovieV2 *_seqWsa;
+
+ bool _abortIntroFlag;
+ int _menuChoice;
+
+ uint32 _seqFrameDelay;
+ uint32 _seqStartTime;
+ uint32 _seqEndTime;
+ int _seqFrameCounter;
+ int _seqScrollTextCounter;
+ int _seqWsaCurrentFrame;
+ bool _seqSpecialFlag;
+ bool _seqSubframePlaying;
+ uint8 _seqTextColor[2];
+ uint8 _seqTextColorMap[16];
+
+ const SeqProc *_callbackS;
+ const SeqProc *_callbackN;
+
+ static const uint8 _rainbowRoomData[];
+
+ // color code related vars
+ int _colorCodeFlag1;
+ int _colorCodeFlag2;
+ uint8 _presetColorCode[7];
+ uint8 _inputColorCode[7];
+ uint32 _scriptCountDown;
+ int _dbgPass;
+
+ // save/load specific
+ void saveGame(const char *fileName, const char *saveName);
+ void loadGame(const char *fileName);
+};
+
+} // end of namespace Kyra
+
+#endif
+
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_mr.cpp
index 0fbe3de456..61546fc2e7 100644
--- a/engines/kyra/kyra_v3.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -24,24 +24,40 @@
*/
#include "kyra/kyra.h"
-#include "kyra/kyra_v3.h"
-#include "kyra/screen_v3.h"
+#include "kyra/kyra_mr.h"
+#include "kyra/screen_mr.h"
#include "kyra/wsamovie.h"
#include "kyra/sound.h"
-#include "kyra/text_v3.h"
+#include "kyra/text_mr.h"
#include "kyra/vqa.h"
#include "kyra/gui.h"
#include "kyra/timer.h"
+#include "kyra/debugger.h"
+#include "kyra/gui_mr.h"
+#include "kyra/resource.h"
#include "common/system.h"
#include "common/config-manager.h"
namespace Kyra {
-KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags) {
+
+const KyraEngine_v2::EngineDesc KyraEngine_MR::_mrEngineDesc = {
+ // Generic shape related
+ 248,
+ KyraEngine_MR::_characterFrameTable,
+
+ // Scene script
+ 9,
+
+ // Animation script specific
+ 9
+};
+
+KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {
_soundDigital = 0;
_musicSoundChannel = -1;
_menuAudioFile = "TITLE1.AUD";
- _curMusicTrack = -1;
+ _lastMusicCommand = -1;
_itemBuffer1 = _itemBuffer2 = 0;
_scoreFile = 0;
_cCodeFile = 0;
@@ -50,13 +66,9 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_gamePlayBuffer = 0;
_interface = _interfaceCommandLine = 0;
_costPalBuffer = 0;
- _animObjects = 0;
- _sceneAnims = 0;
memset(_sceneShapes, 0, sizeof(_sceneShapes));
memset(_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
_gfxBackUpRect = 0;
- _itemList = 0;
- _malcolmShapes = 0;
_paletteOverlay = 0;
_sceneList = 0;
memset(&_mainCharacter, 0, sizeof(_mainCharacter));
@@ -69,10 +81,6 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_text = 0;
_commandLineY = 189;
_inventoryState = false;
- memset(&_sceneScriptState, 0, sizeof(_sceneScriptState));
- memset(&_sceneScriptData, 0, sizeof(_sceneScriptData));
- memset(_wsaSlots, 0, sizeof(_wsaSlots));
- _updateCharPosNextUpdate = 0;
memset(_characterAnimTable, 0, sizeof(_characterAnimTable));
_overwriteSceneFacing = false;
_maskPageMinY = _maskPageMaxY = 0;
@@ -81,7 +89,7 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_mainCharX = _mainCharY = -1;
_animList = 0;
_drawNoShapeFlag = false;
- _wsaPlayingVQA = false;
+ _wasPlayingVQA = false;
_lastCharPalLayer = -1;
_charPalUpdate = false;
_runFlag = false;
@@ -93,12 +101,8 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_unk4 = 0;
_loadingState = false;
_noStartupChat = false;
- _lastProcessedSceneScript = 0;
- _specialSceneScriptRunFlag = false;
_pathfinderFlag = 0;
_talkObjectList = 0;
- _chatText = 0;
- _chatObject = -1;
memset(&_chatScriptState, 0, sizeof(_chatScriptState));
memset(&_chatScriptData, 0, sizeof(_chatScriptData));
_voiceSoundChannel = -1;
@@ -107,9 +111,7 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_useActorBuffer = false;
_curStudioSFX = 283;
_badConscienceShown = false;
- _curChapter = 1;
- _deathHandler = -1;
- _moveFacingTable = 0;
+ _currentChapter = 1;
_unkHandleSceneChangeFlag = false;
memset(_sceneShapeDescs, 0, sizeof(_sceneShapeDescs));
_cnvFile = _dlgBuffer = 0;
@@ -123,59 +125,56 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi
_malcolmsMood = 1;
_nextIdleAnim = 0;
_nextIdleType = false;
- _newShapeFlag = -1;
- _newShapeFiledata = 0;
_inventoryScrollSpeed = -1;
_invWsa = 0;
_invWsaFrame = -1;
+ _score = 0;
+ memset(_scoreFlagTable, 0, sizeof(_scoreFlagTable));
+ _mainButtonData = 0;
+ _mainButtonList = 0;
+ _mainButtonListInitialized = false;
+ _enableInventory = true;
+ _goodConscienceShown = false;
+ _goodConscienceAnim = -1;
+ _goodConsciencePosition = false;
+ _menuDirectlyToLoad = false;
+ _optionsFile = 0;
+ _actorFile = 0;
}
-KyraEngine_v3::~KyraEngine_v3() {
+KyraEngine_MR::~KyraEngine_MR() {
delete _screen;
delete _soundDigital;
- delete [] _itemBuffer1;
- delete [] _itemBuffer2;
- delete [] _scoreFile;
- delete [] _cCodeFile;
- delete [] _scenesFile;
- delete [] _itemFile;
- delete [] _gamePlayBuffer;
- delete [] _interface;
- delete [] _interfaceCommandLine;
- delete [] _costPalBuffer;
- delete [] _animObjects;
- delete [] _sceneAnims;
+ delete[] _itemBuffer1;
+ delete[] _itemBuffer2;
+ delete[] _scoreFile;
+ delete[] _cCodeFile;
+ delete[] _scenesFile;
+ delete[] _itemFile;
+ delete[] _gamePlayBuffer;
+ delete[] _interface;
+ delete[] _interfaceCommandLine;
+ delete[] _costPalBuffer;
for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i)
- delete [] _sceneShapes[i];
+ delete[] _sceneShapes[i];
for (uint i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
delete _sceneAnimMovie[i];
- delete [] _gfxBackUpRect;
- delete [] _itemList;
- delete [] _paletteOverlay;
- delete [] _sceneList;
+ delete[] _gfxBackUpRect;
+ delete[] _paletteOverlay;
+ delete[] _sceneList;
for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
- delete [] i->_value;
+ delete[] i->_value;
i->_value = 0;
}
_gameShapes.clear();
- _scriptInterpreter->unloadScript(&_sceneScriptData);
-
- for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i)
- delete _wsaSlots[i];
-
- delete [] _sceneStrings;
- delete [] _talkObjectList;
- delete [] _moveFacingTable;
-
- for (Common::Array<const Opcode*>::iterator i = _opcodesTemporary.begin(); i != _opcodesTemporary.end(); ++i)
- delete *i;
- _opcodesTemporary.clear();
+ delete[] _sceneStrings;
+ delete[] _talkObjectList;
for (Common::Array<const Opcode*>::iterator i = _opcodesDialog.begin(); i != _opcodesDialog.end(); ++i)
delete *i;
@@ -183,25 +182,32 @@ KyraEngine_v3::~KyraEngine_v3() {
delete _cnvFile;
delete _dlgBuffer;
- delete [] _stringBuffer;
- delete [] _newShapeFiledata;
+ delete[] _stringBuffer;
delete _invWsa;
+ delete[] _mainButtonData;
+ delete _gui;
+ delete[] _optionsFile;
}
-int KyraEngine_v3::init() {
- _screen = new Screen_v3(this, _system);
+int KyraEngine_MR::init() {
+ _screen = new Screen_MR(this, _system);
assert(_screen);
- if (!_screen->init())
- error("_screen->init() failed");
+ _screen->setResolution();
KyraEngine::init();
+
+ _debugger = new Debugger_v2(this);
+ assert(_debugger);
_soundDigital = new SoundDigital(this, _mixer);
assert(_soundDigital);
if (!_soundDigital->init())
error("_soundDigital->init() failed");
- KyraEngine::_text = _text = new TextDisplayer_v3(this, _screen);
+ KyraEngine::_text = _text = new TextDisplayer_MR(this, _screen);
assert(_text);
+ _gui = new GUI_MR(this);
+ assert(_gui);
+ _gui->initStaticData();
_screen->loadFont(Screen::FID_6_FNT, "6.FNT");
_screen->loadFont(Screen::FID_8_FNT, "8FAT.FNT");
@@ -216,7 +222,7 @@ int KyraEngine_v3::init() {
return 0;
}
-int KyraEngine_v3::go() {
+int KyraEngine_MR::go() {
bool running = true;
preinit();
_screen->hideMouse();
@@ -225,6 +231,24 @@ int KyraEngine_v3::go() {
_screen->clearPage(0);
_screen->clearPage(2);
+ const bool firstTimeGame = !saveFileLoadable(0);
+
+ if (firstTimeGame) {
+ playVQA("K3INTRO");
+ _wasPlayingVQA = false;
+ }
+
+ if (_gameToLoad != -1 || firstTimeGame) {
+ while (!_screen->isMouseVisible())
+ _screen->showMouse();
+
+ uninitMainMenu();
+ _musicSoundChannel = -1;
+ startup();
+ runLoop();
+ running = false;
+ }
+
while (running && !_quitFlag) {
_screen->_curPage = 0;
_screen->clearPage(0);
@@ -249,11 +273,15 @@ int KyraEngine_v3::go() {
}
switch (_menu->handle(3)) {
+ case 2:
+ _menuDirectlyToLoad = true;
+ // fall through
+
case 0:
uninitMainMenu();
fadeOutMusic(60);
- _screen->fadeToBlack();
+ _screen->fadeToBlack(60);
_musicSoundChannel = -1;
startup();
runLoop();
@@ -262,20 +290,14 @@ int KyraEngine_v3::go() {
case 1:
playVQA("K3INTRO");
- _wsaPlayingVQA = false;
+ _wasPlayingVQA = false;
_screen->hideMouse();
break;
- case 2:
- //uninitMainMenu();
- //show load dialog
- //running = false;
- break;
-
case 3:
default:
fadeOutMusic(60);
- _screen->fadeToBlack();
+ _screen->fadeToBlack(60);
uninitMainMenu();
quitGame();
running = false;
@@ -283,10 +305,13 @@ int KyraEngine_v3::go() {
}
}
+ if (_showOutro)
+ playVQA("CREDITS");
+
return 0;
}
-void KyraEngine_v3::initMainMenu() {
+void KyraEngine_MR::initMainMenu() {
_menuAnim = new WSAMovieV2(this, _screen);
_menuAnim->open("REVENGE.WSA", 1, _screen->getPalette(0));
_menuAnim->setX(0);
@@ -311,15 +336,15 @@ void KyraEngine_v3::initMainMenu() {
_menu->init(data, anim);
}
-void KyraEngine_v3::uninitMainMenu() {
+void KyraEngine_MR::uninitMainMenu() {
delete _menuAnim;
_menuAnim = 0;
delete _menu;
_menu = 0;
}
-void KyraEngine_v3::playVQA(const char *name) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playVQA('%s')", name);
+void KyraEngine_MR::playVQA(const char *name) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::playVQA('%s')", name);
VQAMovie vqa(this, _system);
@@ -334,7 +359,7 @@ void KyraEngine_v3::playVQA(const char *name) {
_screen->hideMouse();
memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
fadeOutMusic(60);
- _screen->fadeToBlack();
+ _screen->fadeToBlack(60);
_screen->clearPage(0);
vqa.setDrawPage(0);
@@ -350,22 +375,22 @@ void KyraEngine_v3::playVQA(const char *name) {
_screen->setScreenPalette(pal);
_screen->clearPage(0);
memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
- _wsaPlayingVQA = true;
+ _wasPlayingVQA = true;
}
}
#pragma mark -
-void KyraEngine_v3::playMenuAudioFile() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playMenuAudioFile()");
+void KyraEngine_MR::playMenuAudioFile() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::playMenuAudioFile()");
if (_soundDigital->isPlaying(_musicSoundChannel))
return;
_musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType);
}
-void KyraEngine_v3::playMusicTrack(int track, int force) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playMusicTrack(%d, %d)", track, force);
+void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playWanderScoreViaMap(%d, %d)", track, force);
// XXX byte_3C87C compare
@@ -374,7 +399,7 @@ void KyraEngine_v3::playMusicTrack(int track, int force) {
else if (_musicSoundChannel == -1)
force = 1;
- if (track == _curMusicTrack && !force)
+ if (track == _lastMusicCommand && !force)
return;
stopMusicTrack();
@@ -385,21 +410,21 @@ void KyraEngine_v3::playMusicTrack(int track, int force) {
_musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, Audio::Mixer::kMusicSoundType);
}
- _curMusicTrack = track;
+ _lastMusicCommand = track;
}
-void KyraEngine_v3::stopMusicTrack() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::stopMusicTrack()");
+void KyraEngine_MR::stopMusicTrack() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::stopMusicTrack()");
if (_musicSoundChannel != -1 && _soundDigital->isPlaying(_musicSoundChannel))
_soundDigital->stopSound(_musicSoundChannel);
- _curMusicTrack = -1;
+ _lastMusicCommand = -1;
_musicSoundChannel = -1;
}
-int KyraEngine_v3::musicUpdate(int forceRestart) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::musicUpdate(%d)", forceRestart);
+int KyraEngine_MR::musicUpdate(int forceRestart) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::musicUpdate(%d)", forceRestart);
static uint32 mTimer = 0;
static uint16 lock = 0;
@@ -414,8 +439,8 @@ int KyraEngine_v3::musicUpdate(int forceRestart) {
lock = 1;
if (_musicSoundChannel >= 0) {
if (!_soundDigital->isPlaying(_musicSoundChannel)) {
- if (_curMusicTrack != -1)
- playMusicTrack(_curMusicTrack, 1);
+ if (_lastMusicCommand != -1)
+ snd_playWanderScoreViaMap(_lastMusicCommand, 1);
}
}
lock = 0;
@@ -425,17 +450,17 @@ int KyraEngine_v3::musicUpdate(int forceRestart) {
return 1;
}
-void KyraEngine_v3::fadeOutMusic(int ticks) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::fadeOutMusic(%d)", ticks);
+void KyraEngine_MR::fadeOutMusic(int ticks) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::fadeOutMusic(%d)", ticks);
if (_musicSoundChannel >= 0) {
_fadeOutMusicChannel = _musicSoundChannel;
_soundDigital->beginFadeOut(_musicSoundChannel, ticks);
- _curMusicTrack = -1;
+ _lastMusicCommand = -1;
}
}
-void KyraEngine_v3::playSoundEffect(int item, int volume) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playSoundEffect(%d, %d)", item, volume);
+void KyraEngine_MR::snd_playSoundEffect(int item, int volume) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playSoundEffect(%d, %d)", item, volume);
if (_sfxFileMap[item*2+0] != 0xFF) {
char filename[16];
snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]);
@@ -445,32 +470,35 @@ void KyraEngine_v3::playSoundEffect(int item, int volume) {
}
}
-void KyraEngine_v3::playVoice(int high, int low) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playVoice(%d, %d)", high, low);
+void KyraEngine_MR::playVoice(int high, int low) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::playVoice(%d, %d)", high, low);
snd_playVoiceFile(high * 1000 + low);
}
-void KyraEngine_v3::snd_playVoiceFile(int file) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playVoiceFile(%d)", file);
+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);
_voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255);
}
-bool KyraEngine_v3::snd_voiceIsPlaying() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_voiceIsPlaying()");
+bool KyraEngine_MR::snd_voiceIsPlaying() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_voiceIsPlaying()");
return _soundDigital->isPlaying(_voiceSoundChannel);
}
-void KyraEngine_v3::snd_stopVoice() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_stopVoice()");
+void KyraEngine_MR::snd_stopVoice() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_stopVoice()");
if (_voiceSoundChannel != -1)
_soundDigital->stopSound(_voiceSoundChannel);
}
-void KyraEngine_v3::playStudioSFX(const char *str) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::playStudioSFX('%s')", str);
+void KyraEngine_MR::playStudioSFX(const char *str) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::playStudioSFX('%s')", str);
+ if (!_configStudio)
+ return;
+
if (_rnd.getRandomNumberRng(1, 2) != 2)
return;
@@ -478,7 +506,7 @@ void KyraEngine_v3::playStudioSFX(const char *str) {
if (str[strSize] != '?' && str[strSize] != '!')
return;
- playSoundEffect(_curStudioSFX++, 128);
+ snd_playSoundEffect(_curStudioSFX++, 128);
if (_curStudioSFX > 291)
_curStudioSFX = 283;
@@ -486,8 +514,8 @@ void KyraEngine_v3::playStudioSFX(const char *str) {
#pragma mark -
-void KyraEngine_v3::preinit() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::preinit()");
+void KyraEngine_MR::preinit() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::preinit()");
_itemBuffer1 = new int8[72];
_itemBuffer2 = new int8[144];
@@ -497,8 +525,8 @@ void KyraEngine_v3::preinit() {
_screen->setMouseCursor(0, 0, _gameShapes[0]);
}
-void KyraEngine_v3::initMouseShapes() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::initMouseShapes()");
+void KyraEngine_MR::initMouseShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::initMouseShapes()");
uint8 *data = _res->fileData("MOUSE.SHP", 0);
assert(data);
for (int i = 0; i <= 6; ++i)
@@ -506,13 +534,8 @@ void KyraEngine_v3::initMouseShapes() {
delete [] data;
}
-void KyraEngine_v3::startup() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::startup()");
- for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i) {
- _wsaSlots[i] = new WSAMovieV2(this, _screen);
- assert(_wsaSlots[i]);
- }
-
+void KyraEngine_MR::startup() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::startup()");
musicUpdate(0);
memset(_flagsTable, 0, sizeof(_flagsTable));
@@ -529,11 +552,9 @@ void KyraEngine_v3::startup() {
_stringBuffer = new char[500];
//XXX
musicUpdate(0);
- _moveFacingTable = new int[600];
_costPalBuffer = new uint8[864];
//XXX
- _animObjects = new AnimObj[67];
- _sceneAnims = new SceneAnim[16];
+ allocAnimObjects(1, 16, 50);
musicUpdate(0);
@@ -544,15 +565,16 @@ void KyraEngine_v3::startup() {
musicUpdate(0);
if (!loadLanguageFile("ITEMS.", _itemFile))
- error("couldn't load ITEMS");
+ error("Couldn't load ITEMS");
+ if (!loadLanguageFile("SCORE.", _scoreFile))
+ error("Couldn't load SCORE");
if (!loadLanguageFile("C_CODE.", _cCodeFile))
- error("couldn't load C_CODE");
+ error("Couldn't load C_CODE");
if (!loadLanguageFile("SCENES.", _scenesFile))
- error("couldn't load SCENES");
-
- //XXX
-
- if ((_actorFileSize = loadLanguageFile("_ACTOR.", _actorFile)) == 0)
+ error("Couldn't load SCENES");
+ if (!loadLanguageFile("OPTIONS.", _optionsFile))
+ error("Couldn't load OPTIONS");
+ if (!loadLanguageFile("_ACTOR.", _actorFile))
error("couldn't load _ACTOR");
musicUpdate(0);
@@ -580,19 +602,20 @@ void KyraEngine_v3::startup() {
_talkObjectList[i].sceneId = 0xFF;
musicUpdate(0);
- updateMalcolmShapes();
_gfxBackUpRect = new uint8[_screen->getRectSize(32, 32)];
- _itemList = new Item[50];
+ initItemList(50);
resetItemList();
loadShadowShape();
- //loadButtonShapes();
musicUpdate(0);
loadExtrasShapes();
musicUpdate(0);
- loadMalcolmShapes(_malcolmShapes);
+ _characterShapeFile = 0;
+ loadCharacterShapes(_characterShapeFile);
+ updateMalcolmShapes();
musicUpdate(0);
- //initInventoryButtonList(1);
+ initMainButtonList(true);
+ loadButtonShapes();
loadInterfaceShapes();
musicUpdate(0);
@@ -605,15 +628,22 @@ void KyraEngine_v3::startup() {
clearAnimObjects();
- //XXX
+ _scoreMax = 0;
+ for (int i = 0; i < _scoreTableSize; ++i) {
+ if (_scoreTable[i] > 0)
+ _scoreMax += _scoreTable[i];
+ }
musicUpdate(0);
- memset(_hiddenItems, -1, sizeof(_hiddenItems));
memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
memset(_conversationState, -1, sizeof(_conversationState));
_sceneList = new SceneDesc[98];
+ assert(_sceneList);
+ memset(_sceneList, 0, sizeof(SceneDesc)*98);
+ _sceneListSize = 98;
+
musicUpdate(0);
runStartupScript(1, 0);
_res->exists("MOODOMTR.WSA", true);
@@ -621,28 +651,38 @@ void KyraEngine_v3::startup() {
assert(_invWsa);
_invWsa->open("MOODOMTR.WSA", 1, 0);
_invWsaFrame = 6;
+ saveGame(getSavegameFilename(0), (const char*)getTableEntry(_optionsFile, 33));
_soundDigital->beginFadeOut(_musicSoundChannel, 60);
delayWithTicks(60);
- enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
+ if (_gameToLoad == -1)
+ enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
+ else
+ loadGame(getSavegameFilename(_gameToLoad));
+
+ if (_menuDirectlyToLoad)
+ (*_mainButtonData[0].buttonCallback)(&_mainButtonData[0]);
+
_screen->updateScreen();
musicUpdate(0);
_screen->showMouse();
- //XXX
+
+ setNextIdleAnimTimer();
+ setWalkspeed(_configWalkspeed);
}
-void KyraEngine_v3::loadCostPal() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadCostPal()");
+void KyraEngine_MR::loadCostPal() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCostPal()");
_costPalBuffer = _res->fileData("_COSTPAL.DAT", 0);
}
-void KyraEngine_v3::loadShadowShape() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadShadowShape()");
+void KyraEngine_MR::loadShadowShape() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadShadowShape()");
_screen->loadBitmap("SHADOW.CSH", 3, 3, 0);
addShapeToPool(_screen->getCPagePtr(3), 421, 0);
}
-void KyraEngine_v3::loadExtrasShapes() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadExtrasShapes()");
+void KyraEngine_MR::loadExtrasShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadExtrasShapes()");
_screen->loadBitmap("EXTRAS.CSH", 3, 3, 0);
for (int i = 0; i < 20; ++i)
addShapeToPool(_screen->getCPagePtr(3), i+433, i);
@@ -650,22 +690,22 @@ void KyraEngine_v3::loadExtrasShapes() {
addShapeToPool(_screen->getCPagePtr(3), 454, 21);
}
-void KyraEngine_v3::loadInterfaceShapes() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadInterfaceShapes()");
+void KyraEngine_MR::loadInterfaceShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadInterfaceShapes()");
_screen->loadBitmap("INTRFACE.CSH", 3, 3, 0);
for (int i = 422; i <= 432; ++i)
addShapeToPool(_screen->getCPagePtr(3), i, i-422);
}
-void KyraEngine_v3::loadInterface() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadInterface()");
+void KyraEngine_MR::loadInterface() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadInterface()");
_screen->loadBitmap("INTRFACE.CPS", 3, 3, 0);
memcpy(_interface, _screen->getCPagePtr(3), 17920);
memcpy(_interfaceCommandLine, _screen->getCPagePtr(3), 3840);
}
-void KyraEngine_v3::initItems() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::initItems()");
+void KyraEngine_MR::initItems() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::initItems()");
_screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
@@ -690,29 +730,29 @@ void KyraEngine_v3::initItems() {
_screen->_curPage = 0;
}
-void KyraEngine_v3::runStartupScript(int script, int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runStartupScript(%d, %d)", script, unk1);
- ScriptState state;
- ScriptData data;
+void KyraEngine_MR::runStartupScript(int script, int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runStartupScript(%d, %d)", script, unk1);
+ EMCState state;
+ EMCData data;
memset(&state, 0, sizeof(state));
memset(&data, 0, sizeof(data));
char filename[13];
strcpy(filename, "_START0X.EMC");
filename[7] = (script % 10) + '0';
- _scriptInterpreter->loadScript(filename, &data, &_opcodes);
- _scriptInterpreter->initScript(&state, &data);
- _scriptInterpreter->startScript(&state, 0);
+ _emc->load(filename, &data, &_opcodes);
+ _emc->init(&state, &data);
+ _emc->start(&state, 0);
state.regs[6] = unk1;
- while (_scriptInterpreter->validScript(&state))
- _scriptInterpreter->runScript(&state);
+ while (_emc->isValid(&state))
+ _emc->run(&state);
- _scriptInterpreter->unloadScript(&data);
+ _emc->unload(&data);
}
-void KyraEngine_v3::openTalkFile(int file) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::openTalkFile(%d)", file);
+void KyraEngine_MR::openTalkFile(int file) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::openTalkFile(%d)", file);
char talkFilename[16];
if (file == 0) {
@@ -731,27 +771,8 @@ void KyraEngine_v3::openTalkFile(int file) {
#pragma mark -
-void KyraEngine_v3::addShapeToPool(const uint8 *data, int realIndex, int shape) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::addShapeToPool(%p, %d, %d)", data, realIndex, shape);
- ShapeMap::iterator iter = _gameShapes.find(realIndex);
- if (iter != _gameShapes.end()) {
- delete [] iter->_value;
- iter->_value = 0;
- }
- _gameShapes[realIndex] = _screen->makeShapeCopy(data, shape);
- assert(_gameShapes[realIndex]);
-}
-
-uint8 *KyraEngine_v3::getShapePtr(int shape) const {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getShapePtr(%d)", shape);
- ShapeMap::iterator iter = _gameShapes.find(shape);
- if (iter == _gameShapes.end())
- return 0;
- return iter->_value;
-}
-
-void KyraEngine_v3::loadMalcolmShapes(int newShapes) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadMalcolmShapes(%d)", newShapes);
+void KyraEngine_MR::loadCharacterShapes(int newShapes) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCharacterShapes(%d)", newShapes);
static const uint8 numberOffset[] = { 3, 3, 4, 4, 3, 3 };
static const uint8 startShape[] = { 0x32, 0x58, 0x78, 0x98, 0xB8, 0xD8 };
static const uint8 endShape[] = { 0x57, 0x77, 0x97, 0xB7, 0xD7, 0xF7 };
@@ -785,81 +806,34 @@ void KyraEngine_v3::loadMalcolmShapes(int newShapes) {
filename[numberOffset[i]+1] = lowNum;
_res->exists(filename, true);
_res->loadFileToBuf(filename, _screenBuffer, 64000);
- for (int j = startShape[i]; j < endShape[i]; ++j) {
+ for (int j = startShape[i]; j <= endShape[i]; ++j) {
if (j == 87)
continue;
addShapeToPool(_screenBuffer, j, j-startShape[i]);
}
}
- _malcolmShapes = newShapes;
+ _characterShapeFile = newShapes;
updateMalcolmShapes();
}
-void KyraEngine_v3::updateMalcolmShapes() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateMalcolmShapes()");
- assert(_malcolmShapes >= 0 && _malcolmShapes < _shapeDescsSize);
- _malcolmShapeXOffset = _shapeDescs[_malcolmShapes].xOffset;
- _malcolmShapeYOffset = _shapeDescs[_malcolmShapes].yOffset;
- _animObjects[0].width = _shapeDescs[_malcolmShapes].width;
- _animObjects[0].height = _shapeDescs[_malcolmShapes].height;
+void KyraEngine_MR::updateMalcolmShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateMalcolmShapes()");
+ assert(_characterShapeFile >= 0 && _characterShapeFile < _shapeDescsSize);
+ _malcolmShapeXOffset = _shapeDescs[_characterShapeFile].xOffset;
+ _malcolmShapeYOffset = _shapeDescs[_characterShapeFile].yOffset;
+ _animObjects[0].width = _shapeDescs[_characterShapeFile].width;
+ _animObjects[0].height = _shapeDescs[_characterShapeFile].height;
}
#pragma mark -
-void KyraEngine_v3::moveCharacter(int facing, int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::moveCharacter(%d, %d, %d)", facing, x, y);
- x &= ~3;
- y &= ~1;
- _mainCharacter.facing = facing;
-
- _screen->hideMouse();
- switch (facing) {
- case 0:
- while (_mainCharacter.y1 > y)
- updateCharPosWithUpdate();
- break;
-
- case 2:
- while (_mainCharacter.x1 < x)
- updateCharPosWithUpdate();
- break;
-
- case 4:
- while (_mainCharacter.y1 < y)
- updateCharPosWithUpdate();
- break;
-
- case 6:
- while (_mainCharacter.x1 > x)
- updateCharPosWithUpdate();
- break;
-
- default:
- break;
- }
- _screen->showMouse();
-}
-
-void KyraEngine_v3::updateCharPosWithUpdate() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPosWithUpdate()");
- updateCharPos(0, 0);
- update();
+int KyraEngine_MR::getCharacterWalkspeed() const {
+ return _mainCharacter.walkspeed;
}
-int KyraEngine_v3::updateCharPos(int *table, int force) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPos(%p, %d)", (const void*)table, force);
- if (_updateCharPosNextUpdate > _system->getMillis() && !force)
- return 0;
- _mainCharacter.x1 += _updateCharPosXTable[_mainCharacter.facing];
- _mainCharacter.y1 += _updateCharPosYTable[_mainCharacter.facing];
- updateCharAnimFrame(0, table);
- _updateCharPosNextUpdate = _system->getMillis() + _mainCharacter.walkspeed * _tickLength;
- return 1;
-}
-
-void KyraEngine_v3::updateCharAnimFrame(int character, int *table) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPos(%d, %p)", character, (const void*)table);
+void KyraEngine_MR::updateCharAnimFrame(int character, int *table) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPos(%d, %p)", character, (const void*)table);
++_mainCharacter.animFrame;
int facing = _mainCharacter.facing;
@@ -914,10 +888,10 @@ void KyraEngine_v3::updateCharAnimFrame(int character, int *table) {
updateCharacterAnim(0);
}
-void KyraEngine_v3::updateCharPal(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPal(%d)", unk1);
+void KyraEngine_MR::updateCharPal(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPal(%d)", unk1);
int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1) - 1;
- const uint8 *src = _costPalBuffer + _malcolmShapes * 72;
+ const uint8 *src = _costPalBuffer + _characterShapeFile * 72;
uint8 *dst = _screen->getPalette(0) + 432;
const int8 *sceneDatPal = &_sceneDatPalette[layer * 3];
@@ -949,7 +923,7 @@ void KyraEngine_v3::updateCharPal(int unk1) {
++dst;
++sceneDatPal;
++j;
- if (j > 3) {
+ if (j >= 3) {
sceneDatPal = &_sceneDatPalette[layer * 3];
j = 0;
}
@@ -960,8 +934,8 @@ void KyraEngine_v3::updateCharPal(int unk1) {
}
}
-bool KyraEngine_v3::checkCharCollision(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::checkCharCollision(%d, %d)", x, y);
+bool KyraEngine_MR::checkCharCollision(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::checkCharCollision(%d, %d)", x, y);
int scale = getScale(_mainCharacter.x1, _mainCharacter.y1);
int width = (scale * 37) >> 8;
@@ -979,17 +953,25 @@ bool KyraEngine_v3::checkCharCollision(int x, int y) {
#pragma mark -
-void KyraEngine_v3::runLoop() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runLoop()");
+void KyraEngine_MR::runLoop() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runLoop()");
+
+ _eventList.clear();
_runFlag = true;
while (_runFlag && !_quitFlag) {
- //XXX deathHandler
+ if (_deathHandler >= 0) {
+ removeHandItem();
+ delay(5);
+ _drawNoShapeFlag = 0;
+ _gui->optionsButton(0);
+ _deathHandler = -1;
+ }
if (_system->getMillis() >= _nextIdleAnim)
showIdleAnim();
- int inputFlag = checkInput(0/*_mainButtonList*/);
+ int inputFlag = checkInput(_mainButtonList, true);
removeInputTop();
update();
@@ -1005,8 +987,8 @@ void KyraEngine_v3::runLoop() {
}
}
-void KyraEngine_v3::handleInput(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::handleInput(%d, %d)", x, y);
+void KyraEngine_MR::handleInput(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::handleInput(%d, %d)", x, y);
if (_inventoryState)
return;
setNextIdleAnimTimer();
@@ -1020,7 +1002,7 @@ void KyraEngine_v3::handleInput(int x, int y) {
return;
if (_unk3 == -3) {
- playSoundEffect(0x0D, 0x80);
+ snd_playSoundEffect(0x0D, 0x80);
return;
}
@@ -1078,8 +1060,8 @@ void KyraEngine_v3::handleInput(int x, int y) {
inputSceneChange(x, y, 1, 1);
}
-int KyraEngine_v3::inputSceneChange(int x, int y, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::inputSceneChange(%d, %d, %d, %d)", x, y, unk1, unk2);
+int KyraEngine_MR::inputSceneChange(int x, int y, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::inputSceneChange(%d, %d, %d, %d)", x, y, unk1, unk2);
uint16 curScene = _mainCharacter.sceneId;
_pathfinderFlag = 15;
@@ -1121,17 +1103,17 @@ int KyraEngine_v3::inputSceneChange(int x, int y, int unk1, int unk2) {
x &= ~3;
y &= ~1;
- int size = findWay(x1, y1, x, y, _moveFacingTable, 600);
+ int size = findWay(x1, y1, x, y, _movFacingTable, 600);
_pathfinderFlag = 0;
if (!size || size == 0x7D00)
return 0;
- return trySceneChange(_moveFacingTable, unk1, unk2);
+ return trySceneChange(_movFacingTable, unk1, unk2);
}
-void KyraEngine_v3::update() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::update()");
+void KyraEngine_MR::update() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::update()");
updateInput();
musicUpdate(0);
@@ -1146,8 +1128,8 @@ void KyraEngine_v3::update() {
_screen->updateScreen();
}
-void KyraEngine_v3::updateWithText() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::update()");
+void KyraEngine_MR::updateWithText() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::update()");
updateInput();
musicUpdate(0);
@@ -1155,7 +1137,6 @@ void KyraEngine_v3::updateWithText() {
//XXX
updateSpecialSceneScripts();
updateCommandLine();
- //XXX
musicUpdate(0);
restorePage3();
@@ -1171,8 +1152,8 @@ void KyraEngine_v3::updateWithText() {
_screen->updateScreen();
}
-void KyraEngine_v3::updateMouse() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateMouse()");
+void KyraEngine_MR::updateMouse() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateMouse()");
int shape = 0, offsetX = 0, offsetY = 0;
Common::Point mouse = getMousePos();
bool hasItemCollision = checkItemCollision(mouse.x, mouse.y) != -1;
@@ -1290,8 +1271,8 @@ void KyraEngine_v3::updateMouse() {
}
}
-void KyraEngine_v3::delay(uint32 millis, bool doUpdate, bool isMainLoop) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::delay(%d, %d, %d)", millis, doUpdate, isMainLoop);
+void KyraEngine_MR::delay(uint32 millis, bool doUpdate, bool isMainLoop) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::delay(%d, %d, %d)", millis, doUpdate, isMainLoop);
uint32 endTime = _system->getMillis() + millis;
while (endTime > _system->getMillis()) {
if (doUpdate) {
@@ -1305,133 +1286,8 @@ void KyraEngine_v3::delay(uint32 millis, bool doUpdate, bool isMainLoop) {
#pragma mark -
-void KyraEngine_v3::updateInput() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateInput()");
- Common::Event event;
-
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_QUIT:
- _quitFlag = true;
- break;
-
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
- _eventList.push_back(Event(event, true));
- else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
- _quitFlag = true;
- else
- _eventList.push_back(event);
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- _eventList.push_back(Event(event, true));
- break;
-
- case Common::EVENT_LBUTTONUP:
- case Common::EVENT_MOUSEMOVE:
- _eventList.push_back(event);
- break;
-
- default:
- break;
- }
- }
-}
-
-int KyraEngine_v3::checkInput(Button *buttonList, bool mainLoop) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::checkInput(%p, %d)", (const void*)buttonList, mainLoop);
- updateInput();
-
- int keys = 0;
-
- while (_eventList.size()) {
- Common::Event event = *_eventList.begin();
- bool breakLoop = false;
-
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- /*if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
- (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && mainLoop) {
- const char *saveLoadSlot = getSavegameFilename(9 - (event.kbd.keycode - '0') + 990);
-
- if (event.kbd.flags == Common::KBD_CTRL) {
- loadGame(saveLoadSlot);
- _eventList.clear();
- breakLoop = true;
- } else {
- char savegameName[14];
- sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
- saveGame(saveLoadSlot, savegameName);
- }
- } else if (event.kbd.flags == Common::KBD_CTRL) {
- if (event.kbd.keycode == 'd')
- _debugger->attach();
- }*/
- break;
-
- case Common::EVENT_MOUSEMOVE: {
- Common::Point pos = getMousePos();
- _mouseX = pos.x;
- _mouseY = pos.y;
- _screen->updateScreen();
- } break;
-
- case Common::EVENT_LBUTTONDOWN:
- case Common::EVENT_LBUTTONUP: {
- Common::Point pos = getMousePos();
- _mouseX = pos.x;
- _mouseY = pos.y;
- keys = event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800);
- breakLoop = true;
- } break;
-
- default:
- break;
- }
-
- //if (_debugger->isAttached())
- // _debugger->onFrame();
-
- if (breakLoop)
- break;
-
- _eventList.erase(_eventList.begin());
- }
-
- return /*_gui->processButtonList(buttonList, */keys/* | 0x8000)*/;
-}
-
-void KyraEngine_v3::removeInputTop() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::removeInputTop()");
- if (!_eventList.empty())
- _eventList.erase(_eventList.begin());
-}
-
-bool KyraEngine_v3::skipFlag() const {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::skipFlag()");
- for (Common::List<Event>::const_iterator i = _eventList.begin(); i != _eventList.end(); ++i) {
- if (i->causedSkip)
- return true;
- }
- return false;
-}
-
-void KyraEngine_v3::resetSkipFlag(bool removeEvent) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::resetSkipFlag(%d)", removeEvent);
- for (Common::List<Event>::iterator i = _eventList.begin(); i != _eventList.end(); ++i) {
- if (i->causedSkip) {
- if (removeEvent)
- _eventList.erase(i);
- else
- i->causedSkip = false;
- return;
- }
- }
-}
-
-void KyraEngine_v3::makeCharFacingMouse() {
- debugC(9, kDebugLevelAnimator, "KyraEngine_v3::makeCharFacingMouse()");
+void KyraEngine_MR::makeCharFacingMouse() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::makeCharFacingMouse()");
if (_mainCharacter.x1 > _mouseX)
_mainCharacter.facing = 5;
else
@@ -1443,34 +1299,34 @@ void KyraEngine_v3::makeCharFacingMouse() {
#pragma mark -
-int KyraEngine_v3::getDrawLayer(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getDrawLayer(%d, %d)", x, y);
+int KyraEngine_MR::getDrawLayer(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getDrawLayer(%d, %d)", x, y);
int layer = _screen->getLayer(x, y) - 1;
layer = _sceneDatLayerTable[layer];
return MAX(0, MIN(layer, 6));
}
-int KyraEngine_v3::getScale(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getScale(%d, %d)", x, y);
+int KyraEngine_MR::getScale(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getScale(%d, %d)", x, y);
return _scaleTable[_screen->getLayer(x, y) - 1];
}
#pragma mark -
-void KyraEngine_v3::backUpGfxRect32x32(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::backUpGfxRect32x32(%d, %d)", x, y);
+void KyraEngine_MR::backUpGfxRect32x32(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::backUpGfxRect32x32(%d, %d)", x, y);
_screen->copyRegionToBuffer(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
}
-void KyraEngine_v3::restoreGfxRect32x32(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::restoreGfxRect32x32(%d, %d)", x, y);
+void KyraEngine_MR::restoreGfxRect32x32(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::restoreGfxRect32x32(%d, %d)", x, y);
_screen->copyBlockToPage(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
}
#pragma mark -
-char *KyraEngine_v3::appendLanguage(char *buf, int lang, int bufSize) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::appendLanguage([%p|'%s'], %d, %d)", (const void*)buf, buf, lang, bufSize);
+char *KyraEngine_MR::appendLanguage(char *buf, int lang, int bufSize) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::appendLanguage([%p|'%s'], %d, %d)", (const void*)buf, buf, lang, bufSize);
assert(lang < _languageExtensionSize);
int size = strlen(buf) + strlen(_languageExtension[lang]);
@@ -1488,8 +1344,11 @@ char *KyraEngine_v3::appendLanguage(char *buf, int lang, int bufSize) {
return buf;
}
-int KyraEngine_v3::loadLanguageFile(const char *file, uint8 *&buffer) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadLanguageFile('%s', %p)", file, (const void*)buffer);
+int KyraEngine_MR::loadLanguageFile(const char *file, uint8 *&buffer) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadLanguageFile('%s', %p)", file, (const void*)buffer);
+
+ delete[] buffer;
+ buffer = 0;
uint32 size = 0;
char nBuf[32];
@@ -1499,8 +1358,8 @@ int KyraEngine_v3::loadLanguageFile(const char *file, uint8 *&buffer) {
return buffer ? size : 0 ;
}
-uint8 *KyraEngine_v3::getTableEntry(uint8 *buffer, int id) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getTableEntry(%p, %d)", (const void*)buffer, id);
+uint8 *KyraEngine_MR::getTableEntry(uint8 *buffer, int id) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getTableEntry(%p, %d)", (const void*)buffer, id);
uint16 tableEntries = READ_LE_UINT16(buffer);
const uint16 *indexTable = (const uint16*)(buffer + 2);
const uint16 *offsetTable = indexTable + tableEntries;
@@ -1514,8 +1373,8 @@ uint8 *KyraEngine_v3::getTableEntry(uint8 *buffer, int id) {
return buffer + READ_LE_UINT16(offsetTable + num);
}
-void KyraEngine_v3::getTableEntry(Common::SeekableReadStream *stream, int id, char *dst) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::getTableEntry(%p, %d, %p)", (const void*)stream, id, (const void*)dst);
+void KyraEngine_MR::getTableEntry(Common::SeekableReadStream *stream, int id, char *dst) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::getTableEntry(%p, %d, %p)", (const void*)stream, id, (const void*)dst);
stream->seek(0, SEEK_SET);
uint16 tableEntries = stream->readUint16LE();
@@ -1533,8 +1392,8 @@ void KyraEngine_v3::getTableEntry(Common::SeekableReadStream *stream, int id, ch
#pragma mark -
-bool KyraEngine_v3::talkObjectsInCurScene() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::talkObjectsInCurScene()");
+bool KyraEngine_MR::talkObjectsInCurScene() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::talkObjectsInCurScene()");
for (int i = 0; i < 88; ++i) {
if (_talkObjectList[i].sceneId == _mainCharacter.sceneId)
@@ -1546,60 +1405,142 @@ bool KyraEngine_v3::talkObjectsInCurScene() {
#pragma mark -
-void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runTemporaryScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload);
- memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData));
- memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState));
+bool KyraEngine_MR::updateScore(int scoreId, int strId) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateScore(%d, %d)", scoreId, strId);
+
+ int scoreIndex = (scoreId >> 3);
+ int scoreBit = scoreId & 7;
+ if ((_scoreFlagTable[scoreIndex] & (1 << scoreBit)) != 0)
+ return false;
+
+ setNextIdleAnimTimer();
+ _scoreFlagTable[scoreIndex] |= (1 << scoreBit);
+
+ _screen->hideMouse();
+ strcpy(_stringBuffer, (const char*)getTableEntry(_scoreFile, strId));
+ strcat(_stringBuffer, ": ");
- if (!_scriptInterpreter->loadScript(filename, &_temporaryScriptData, &_opcodesTemporary))
- error("Couldn't load temporary script '%s'", filename);
+ assert(scoreId < _scoreTableSize);
- _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
- _scriptInterpreter->startScript(&_temporaryScriptState, 0);
+ int count = _scoreTable[scoreId];
+ if (count > 0)
+ scoreIncrease(count, _stringBuffer);
- _newShapeFlag = -1;
+ _screen->showMouse();
+ setNextIdleAnimTimer();
+ return true;
+}
- if (_newShapeFiledata && newShapes) {
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
+void KyraEngine_MR::scoreIncrease(int count, const char *str) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::scoreIncrease(%d, '%s')", count, str);
+ int drawOld = 1;
+ _screen->hideMouse();
+
+ showMessage(str, 0xFF, 0xF0);
+ const int x = getScoreX(str);
+
+ for (int i = 0; i < count; ++i) {
+ int oldScore = _score;
+ int newScore = ++_score;
+
+ if (newScore > _scoreMax) {
+ _score = _scoreMax;
+ break;
+ }
+
+ drawScoreCounting(oldScore, newScore, drawOld, x);
+ if (_inventoryState)
+ drawScore(0, 215, 191);
+ _screen->updateScreen();
+ delay(20, true);
+
+ snd_playSoundEffect(0x0E, 0xC8);
+ drawOld = 0;
}
- while (_scriptInterpreter->validScript(&_temporaryScriptState))
- _scriptInterpreter->runScript(&_temporaryScriptState);
+ _screen->showMouse();
+}
+
+#pragma mark -
+
+void KyraEngine_MR::changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::changeChapter(%d, %d, %d, %d)", newChapter, sceneId, malcolmShapes, facing);
+ resetItemList();
+
+ _currentChapter = newChapter;
+ runStartupScript(newChapter, 0);
+ _mainCharacter.dlgIndex = 0;
+
+ _malcolmsMood = 1;
+ memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
+
+ if (malcolmShapes >= 0)
+ loadCharacterShapes(malcolmShapes);
- uint8 *fileData = 0;
+ enterNewScene(sceneId, facing, 0, 0, 0);
+}
- if (newShapes)
- _newShapeFiledata = _res->fileData(_newShapeFilename, 0);
+#pragma mark -
- fileData = _newShapeFiledata;
+bool KyraEngine_MR::skipFlag() const {
+ if (!_configSkip)
+ return false;
+ return KyraEngine_v2::skipFlag();
+}
- if (!fileData) {
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
+void KyraEngine_MR::resetSkipFlag(bool removeEvent) {
+ if (!_configSkip) {
+ if (removeEvent)
+ _eventList.clear();
return;
}
+ KyraEngine_v2::resetSkipFlag(removeEvent);
+}
- if (newShapes)
- _newShapeCount = initNewShapes(fileData);
+#pragma mark -
- processNewShapes(allowSkip, resetChar);
+void KyraEngine_MR::registerDefaultSettings() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::registerDefaultSettings()");
+ KyraEngine::registerDefaultSettings();
- if (shapeUnload) {
- resetNewShapes(_newShapeCount, fileData);
- _newShapeCount = 0;
- _newShapeFiledata = 0;
+ // Most settings already have sensible defaults. This one, however, is
+ // specific to the Kyra engine.
+ ConfMan.registerDefault("walkspeed", 5);
+ ConfMan.registerDefault("studio_audience", true);
+ ConfMan.registerDefault("skip_support", true);
+}
+
+void KyraEngine_MR::writeSettings() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::writeSettings()");
+ switch (_lang) {
+ case 1:
+ _flags.lang = Common::FR_FRA;
+ break;
+
+ case 2:
+ _flags.lang = Common::DE_DEU;
+ break;
+
+ case 0:
+ default:
+ _flags.lang = Common::EN_ANY;
+ break;
}
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
+ ConfMan.set("language", Common::getLanguageCode(_flags.lang));
+
+ ConfMan.setBool("studio_audience", _configStudio);
+ ConfMan.setBool("skip_support", _configSkip);
+
+ KyraEngine::writeSettings();
}
-#pragma mark -
+void KyraEngine_MR::readSettings() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::readSettings()");
+ KyraEngine::readSettings();
-Movie *KyraEngine_v3::createWSAMovie() {
- WSAMovieV2 *movie = new WSAMovieV2(this, _screen);
- assert(movie);
- return movie;
+ _configStudio = ConfMan.getBool("studio_audience");
+ _configSkip = ConfMan.getBool("skip_support");
}
} // end of namespace Kyra
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_mr.h
index 440596cb58..3dba3ec8d9 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_mr.h
@@ -26,9 +26,10 @@
#ifndef KYRA_KYRA_V3_H
#define KYRA_KYRA_V3_H
-#include "kyra/kyra.h"
-#include "kyra/screen_v3.h"
+#include "kyra/kyra_v2.h"
+#include "kyra/screen_mr.h"
#include "kyra/script.h"
+#include "kyra/gui_mr.h"
#include "common/hashmap.h"
#include "common/list.h"
@@ -36,19 +37,22 @@
namespace Kyra {
class SoundDigital;
-class Screen_v3;
+class Screen_MR;
class MainMenu;
class WSAMovieV2;
-class TextDisplayer_v3;
+class TextDisplayer_MR;
struct Button;
-class KyraEngine_v3 : public KyraEngine {
-friend class TextDisplayer_v3;
+class KyraEngine_MR : public KyraEngine_v2 {
+friend class TextDisplayer_MR;
+friend class GUI_MR;
public:
- KyraEngine_v3(OSystem *system, const GameFlags &flags);
- ~KyraEngine_v3();
+ KyraEngine_MR(OSystem *system, const GameFlags &flags);
+ ~KyraEngine_MR();
Screen *screen() { return _screen; }
+ Screen_v2 *screen_v2() const { return _screen; }
+ GUI_v2 *gui_v2() const { return _gui; }
SoundDigital *soundDigital() { return _soundDigital; }
int language() const { return _lang; }
@@ -56,9 +60,19 @@ public:
void playVQA(const char *name);
- virtual Movie *createWSAMovie();
private:
- Screen_v3 *_screen;
+ static const EngineDesc _mrEngineDesc;
+
+ // config
+ bool _configStudio;
+ bool _configSkip;
+
+ void registerDefaultSettings();
+ void writeSettings();
+ void readSettings();
+
+ // --
+ Screen_MR *_screen;
SoundDigital *_soundDigital;
int init();
@@ -69,13 +83,15 @@ private:
void setupOpcodeTable();
+ // input
+ bool skipFlag() const;
+ void resetSkipFlag(bool removeEvent = true);
+
// run
- bool _runFlag;
- int _deathHandler;
+ bool _menuDirectlyToLoad;
void runLoop();
void handleInput(int x, int y);
- bool _unkHandleSceneChangeFlag;
int inputSceneChange(int x, int y, int unk1, int unk2);
void update();
@@ -84,29 +100,6 @@ private:
void delay(uint32 millis, bool update = false, bool isMainLoop = false);
- // - Input
- void updateInput();
- int checkInput(Button *buttonList, bool mainLoop = false);
- void removeInputTop();
-
- int _mouseX, _mouseY;
- int _mouseState;
-
- struct Event {
- Common::Event event;
- bool causedSkip;
-
- Event() : event(), causedSkip(false) {}
- Event(Common::Event e) : event(e), causedSkip(false) {}
- Event(Common::Event e, bool skip) : event(e), causedSkip(skip) {}
-
- operator Common::Event() const { return event; }
- };
- Common::List<Event> _eventList;
-
- bool skipFlag() const;
- void resetSkipFlag(bool removeEvent = true);
-
// sound specific
private:
void playMenuAudioFile();
@@ -118,15 +111,13 @@ private:
static const char *_soundList[];
static const int _soundListSize;
- int _curMusicTrack;
-
- void playMusicTrack(int track, int force);
+ void snd_playWanderScoreViaMap(int track, int force);
void stopMusicTrack();
int musicUpdate(int forceRestart);
void fadeOutMusic(int ticks);
- void playSoundEffect(int item, int volume);
+ void snd_playSoundEffect(int item, int volume);
static const uint8 _sfxFileMap[];
static const int _sfxFileMapSize;
@@ -143,12 +134,30 @@ private:
int _curStudioSFX;
void playStudioSFX(const char *str);
- // main menu
+ // gui
+ GUI_MR *_gui;
+
+ Button *_mainButtonData;
+ Button *_mainButtonList;
+ bool _mainButtonListInitialized;
+ void initMainButtonList(bool disable);
+
+ bool _enableInventory;
+ int buttonInventory(Button *button);
+ int buttonMoodChange(Button *button);
+ int buttonShowScore(Button *button);
+ int buttonJesterStaff(Button *button);
+
+ void loadButtonShapes();
+ int callbackButton1(Button *button);
+ int callbackButton2(Button *button);
+ int callbackButton3(Button *button);
+
+ // -> main menu
void initMainMenu();
void uninitMainMenu();
WSAMovieV2 *_menuAnim;
- MainMenu *_menu;
// timer
void setupTimers();
@@ -164,10 +173,6 @@ private:
void setNextIdleAnimTimer();
// pathfinder
- int *_moveFacingTable;
- int _pathfinderFlag;
-
- int findWay(int x1, int y1, int x2, int y2, int *moveTable, int moveTableSize);
bool lineIsPassable(int x, int y);
private:
@@ -175,50 +180,18 @@ private:
static const char *_mainMenuStrings[];
// animator
- struct AnimObj {
- uint16 index;
- uint16 type;
- bool enabled;
- bool needRefresh;
- uint16 unk8;
- uint16 flags;
- int16 xPos1, yPos1;
- uint8 *shapePtr;
- uint16 shapeIndex;
- uint16 animNum;
- uint16 shapeIndex3;
- uint16 shapeIndex2;
- int16 xPos2, yPos2;
- int16 xPos3, yPos3;
- int16 width, height;
- int16 width2, height2;
- uint16 palette;
- AnimObj *nextObject;
- };
-
- AnimObj *_animObjects;
uint8 *_gamePlayBuffer;
+ void restorePage3();
void clearAnimObjects();
- AnimObj *_animList;
- bool _drawNoShapeFlag;
- AnimObj *initAnimList(AnimObj *list, AnimObj *entry);
- AnimObj *addToAnimListSorted(AnimObj *list, AnimObj *entry);
- AnimObj *deleteAnimListEntry(AnimObj *list, AnimObj *entry);
-
void animSetupPaletteEntry(AnimObj *anim);
- void restorePage3();
-
void drawAnimObjects();
void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer);
void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer);
void refreshAnimObjects(int force);
- void refreshAnimObjectsIfNeed();
-
- void flagAnimObjsForRefresh();
bool _loadingState;
void updateCharacterAnim(int charId);
@@ -236,9 +209,6 @@ private:
bool _nextIdleType;
void showIdleAnim();
- void addItemToAnimList(int item);
- void deleteItemAnimEntry(int item);
-
// interface
uint8 *_interface;
uint8 *_interfaceCommandLine;
@@ -266,6 +236,10 @@ private:
void drawMalcolmsMoodText();
void drawMalcolmsMoodPointer(int frame, int page);
void drawJestersStaff(int type, int page);
+
+ void drawScore(int page, int x, int y);
+ void drawScoreCounting(int oldScore, int newScore, int drawOld, const int x);
+ int getScoreX(const char *str);
static const uint8 _inventoryX[];
static const uint8 _inventoryY[];
@@ -281,6 +255,7 @@ private:
uint8 *_cCodeFile;
uint8 *_scenesFile;
uint8 *_itemFile;
+ uint8 *_optionsFile;
uint8 *_actorFile;
uint32 _actorFileSize;
uint8 *_sceneStrings;
@@ -291,27 +266,10 @@ private:
// items
int8 *_itemBuffer1;
int8 *_itemBuffer2;
- struct Item {
- uint16 id;
- uint16 sceneId;
- int16 x, y;
- uint16 unk8;
- };
-
- Item *_itemList;
- uint16 _hiddenItems[100];
- void resetItem(int index);
- void resetItemList();
static const uint8 _trashItemList[];
void removeTrashItems();
- int findFreeItem();
- int findItem(uint16 item, uint16 scene);
- int findItem(uint16 item);
-
- int countAllItems();
-
void initItems();
int checkItemCollision(int x, int y);
@@ -326,6 +284,7 @@ private:
static const uint8 _itemMagicTable[];
bool itemListMagic(int handItem, int itemSlot);
+ bool itemInventoryMagic(int handItem, int invSlot);
static const uint8 _itemStringMap[];
static const uint _itemStringMapSize;
@@ -338,26 +297,13 @@ private:
int getItemCommandStringInv(uint16 item);
// -> hand item
- void setMouseCursor(uint16 item);
-
- void setHandItem(uint16 item);
- void removeHandItem();
void setItemMouseCursor();
-
- int _itemInHand;
- int _handItemSet;
+ void setMouseCursor(uint16 item);
// shapes
- typedef Common::HashMap<int, uint8*> ShapeMap;
- ShapeMap _gameShapes;
-
- void addShapeToPool(const uint8 *data, int realIndex, int shape);
- uint8 *getShapePtr(int shape) const;
-
void initMouseShapes();
- int _malcolmShapes;
- void loadMalcolmShapes(int newShapes);
+ void loadCharacterShapes(int newShapes);
void updateMalcolmShapes();
int _malcolmShapeXOffset, _malcolmShapeYOffset;
@@ -370,49 +316,15 @@ private:
static const int _shapeDescsSize;
// scene animation
- struct SceneAnim {
- uint16 flags;
- int16 x, y;
- int16 x2, y2;
- int16 width, height;
- uint16 unk10;
- uint16 specialSize;
- uint16 unk14;
- uint16 shapeIndex;
- uint16 wsaFlag;
- char filename[13];
- };
-
- SceneAnim *_sceneAnims;
- WSAMovieV2 *_sceneAnimMovie[16];
uint8 *_sceneShapes[20];
void freeSceneShapes();
- void freeSceneAnims();
// voice
int _currentTalkFile;
void openTalkFile(int file);
// scene
- struct SceneDesc {
- char filename1[10];
- char filename2[10];
- uint16 exit1, exit2, exit3, exit4;
- uint8 flags, sound;
- };
-
- SceneDesc *_sceneList;
- uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4;
- int _sceneEnterX1, _sceneEnterY1;
- int _sceneEnterX2, _sceneEnterY2;
- int _sceneEnterX3, _sceneEnterY3;
- int _sceneEnterX4, _sceneEnterY4;
-
- int _specialExitCount;
- uint16 _specialExitTable[25];
- bool checkSpecialSceneExit(int index, int x, int y);
-
bool _noScriptEnter;
void enterNewScene(uint16 scene, int facing, int unk1, int unk2, int unk3);
void enterNewSceneUnk1(int facing, int unk1, int unk2);
@@ -431,25 +343,11 @@ private:
int runSceneScript2();
bool _noStartupChat;
void runSceneScript4(int unk1);
- void runSceneScript6();
void runSceneScript8();
int _sceneMinX, _sceneMaxX;
int _maskPageMinY, _maskPageMaxY;
- ScriptState _sceneScriptState;
- ScriptData _sceneScriptData;
- WSAMovieV2 *_wsaSlots[10];
-
- bool _specialSceneScriptState[10];
- bool _specialSceneScriptStateBackup[10];
- ScriptState _sceneSpecialScripts[10];
- uint32 _sceneSpecialScriptsTimer[10];
- int _lastProcessedSceneScript;
- bool _specialSceneScriptRunFlag;
-
- void updateSpecialSceneScripts();
-
int trySceneChange(int *moveTable, int unk1, int unk2);
int checkSceneChange();
@@ -469,42 +367,12 @@ private:
int getScale(int x, int y);
int _scaleTable[15];
- bool _unkSceneScreenFlag1;
-
// character
- struct Character {
- uint16 sceneId;
- uint16 dlgIndex;
- uint8 height;
- uint8 facing;
- uint16 animFrame;
- //uint8 unk8, unk9;
- uint32 walkspeed;
- uint16 inventory[10];
- int16 x1, y1;
- int16 x2, y2;
- int16 x3, y3;
- };
-
- Character _mainCharacter;
- int _mainCharX, _mainCharY;
- int _charScale;
-
- void moveCharacter(int facing, int x, int y);
-
- void updateCharPosWithUpdate();
- int updateCharPos(int *table, int force);
-
- uint32 _updateCharPosNextUpdate;
- static const int8 _updateCharPosXTable[];
- static const int8 _updateCharPosYTable[];
-
+ int getCharacterWalkspeed() const;
void updateCharAnimFrame(int character, int *table);
int8 _characterAnimTable[2];
static const uint8 _characterFrameTable[];
- bool _overwriteSceneFacing;
-
void updateCharPal(int unk1);
int _lastCharPalLayer;
bool _charPalUpdate;
@@ -515,6 +383,8 @@ private:
void makeCharFacingMouse();
+ int findFreeInventorySlot();
+
// talk object
struct TalkObject {
char filename[13];
@@ -530,16 +400,6 @@ private:
bool talkObjectsInCurScene();
// chat
- int _vocHigh;
-
- const char *_chatText;
- int _chatObject;
- uint32 _chatEndTime;
- int _chatVocHigh, _chatVocLow;
-
- ScriptData _chatScriptData;
- ScriptState _chatScriptState;
-
int chatGetType(const char *text);
int chatCalcDuration(const char *text);
@@ -552,12 +412,16 @@ private:
void badConscienceChat(const char *str, int vocHigh, int vocLow);
void badConscienceChatWaitToFinish();
+ void goodConscienceChat(const char *str, int vocHigh, int vocLow);
+ void goodConscienceChatWaitToFinish();
+
void malcolmSceneStartupChat();
- bool _newSceneDlgState[40];
+ byte _newSceneDlgState[40];
int8 _conversationState[30][30];
bool _chatAltFlag;
- void setDlgIndex(uint16 index);
+ void setDlgIndex(int index);
+ void updateDlgIndex();
Common::SeekableReadStream *_cnvFile;
Common::SeekableReadStream *_dlgBuffer;
@@ -569,8 +433,8 @@ private:
bool _isStartupDialog;
void processDialog(int vocHighIndex, int vocHighBase, int funcNum);
- ScriptData _dialogScriptData;
- ScriptState _dialogScriptState;
+ EMCData _dialogScriptData;
+ EMCState _dialogScriptState;
int _dialogSceneAnim;
int _dialogSceneScript;
int _dialogScriptFuncStart, _dialogScriptFuncProc, _dialogScriptFuncEnd;
@@ -582,10 +446,10 @@ private:
Common::Array<const Opcode *> _opcodesDialog;
- int o3d_updateAnim(ScriptState *script);
- int o3d_delay(ScriptState *script);
+ int o3d_updateAnim(EMCState *script);
+ int o3d_delay(EMCState *script);
- void malcolmRandomChat();
+ void randomSceneChat();
void runDialog(int dlgIndex, int funcNum);
// conscience
@@ -598,47 +462,33 @@ private:
void showBadConscience();
void hideBadConscience();
- // special script code
- bool _temporaryScriptExecBit;
- bool _useFrameTable;
-
- Common::Array<const Opcode *> _opcodesTemporary;
+ bool _goodConscienceShown;
+ int _goodConscienceAnim;
+ bool _goodConsciencePosition;
- int o3t_defineNewShapes(ScriptState *script);
- int o3t_setCurrentFrame(ScriptState *script);
+ static const uint8 _goodConscienceFrameTable[];
- ScriptData _temporaryScriptData;
- ScriptState _temporaryScriptState;
+ void showGoodConscience();
+ void hideGoodConscience();
- void runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload);
+ // special script code
+ bool _useFrameTable;
+
+ int o3a_setCharacterFrame(EMCState *script);
// special shape code
- char _newShapeFilename[13];
- int _newShapeLastEntry;
- int _newShapeWidth, _newShapeHeight;
- int _newShapeXAdd, _newShapeYAdd;
-
- int _newShapeAnimFrame;
- int _newShapeDelay;
-
- int _newShapeFlag;
- uint8 *_newShapeFiledata;
- int _newShapeCount;
-
- int initNewShapes(uint8 *filedata);
- void processNewShapes(int allowSkip, int resetChar);
- void resetNewShapes(int count, uint8 *filedata);
+ int initAnimationShapes(uint8 *filedata);
+ void uninitAnimationShapes(int count, uint8 *filedata);
// unk
uint8 *_costPalBuffer;
- uint8 *_screenBuffer;
uint8 *_paletteOverlay;
bool _useActorBuffer;
- int _curChapter;
- static const uint8 _chapterLowestScene[];
+ int _currentChapter;
+ void changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing);
- int _unk3, _unk4, _unk5;
+ static const uint8 _chapterLowestScene[];
void loadCostPal();
void loadShadowShape();
@@ -650,82 +500,90 @@ private:
char *_stringBuffer;
+ int _score;
+ int _scoreMax;
+
+ static const int8 _scoreTable[];
+ static const int _scoreTableSize;
+ int8 _scoreFlagTable[26];
+ bool updateScore(int scoreId, int strId);
+ void scoreIncrease(int count, const char *str);
+
+ void eelScript();
+
+ // save/load
+ void saveGame(const char *fileName, const char *saveName);
+ void loadGame(const char *fileName);
+
// opcodes
- int o3_getMalcolmShapes(ScriptState *script);
- int o3_setCharacterPos(ScriptState *script);
- int o3_defineObject(ScriptState *script);
- int o3_refreshCharacter(ScriptState *script);
- int o3_getCharacterX(ScriptState *script);
- int o3_getCharacterY(ScriptState *script);
- int o3_getCharacterFacing(ScriptState *script);
- int o3_getCharacterScene(ScriptState *script);
- int o3_getMalcolmsMood(ScriptState *script);
- int o3_trySceneChange(ScriptState *script);
- int o3_moveCharacter(ScriptState *script);
- int o3_setCharacterFacing(ScriptState *script);
- int o3_showSceneFileMessage(ScriptState *script);
- int o3_showBadConscience(ScriptState *script);
- int o3_hideBadConscience(ScriptState *script);
- int o3_objectChat(ScriptState *script);
- int o3_checkForItem(ScriptState *script);
- int o3_defineItem(ScriptState *script);
- int o3_npcChatSequence(ScriptState *script);
- int o3_queryGameFlag(ScriptState *script);
- int o3_resetGameFlag(ScriptState *script);
- int o3_setGameFlag(ScriptState *script);
- int o3_setHandItem(ScriptState *script);
- int o3_removeHandItem(ScriptState *script);
- int o3_handItemSet(ScriptState *script);
- int o3_hideMouse(ScriptState *script);
- int o3_addSpecialExit(ScriptState *script);
- int o3_setMousePos(ScriptState *script);
- int o3_showMouse(ScriptState *script);
- int o3_badConscienceChat(ScriptState *script);
- int o3_wipeDownMouseItem(ScriptState *script);
- int o3_setMalcolmsMood(ScriptState *script);
- int o3_delay(ScriptState *script);
- int o3_setSceneFilename(ScriptState *script);
- int o3_drawSceneShape(ScriptState *script);
- int o3_checkInRect(ScriptState *script);
- int o3_updateConversations(ScriptState *script);
- int o3_setSceneDim(ScriptState *script);
- int o3_update(ScriptState *script);
- int o3_enterNewScene(ScriptState *script);
- int o3_setMalcolmPos(ScriptState *script);
- int o3_stopMusic(ScriptState *script);
- int o3_playMusicTrack(ScriptState *script);
- int o3_playSoundEffect(ScriptState *script);
- int o3_blockOutRegion(ScriptState *script);
- int o3_getRand(ScriptState *script);
- int o3_waitForConfirmationClick(ScriptState *script);
- int o3_defineRoomEntrance(ScriptState *script);
- int o3_runTemporaryScript(ScriptState *script);
- int o3_setSpecialSceneScriptRunTime(ScriptState *script);
- int o3_defineSceneAnim(ScriptState *script);
- int o3_updateSceneAnim(ScriptState *script);
- int o3_runActorScript(ScriptState *script);
- int o3_runDialog(ScriptState *script);
- int o3_malcolmRandomChat(ScriptState *script);
- int o3_setDlgIndex(ScriptState *script);
- int o3_getDlgIndex(ScriptState *script);
- int o3_defineScene(ScriptState *script);
- int o3_countItemInstances(ScriptState *script);
- int o3_dialogStartScript(ScriptState *script);
- int o3_dialogEndScript(ScriptState *script);
- int o3_setSpecialSceneScriptState(ScriptState *script);
- int o3_clearSpecialSceneScriptState(ScriptState *script);
- int o3_querySpecialSceneScriptState(ScriptState *script);
- int o3_setHiddenItemsEntry(ScriptState *script);
- int o3_getHiddenItemsEntry(ScriptState *script);
- int o3_setupSceneAnimObject(ScriptState *script);
- int o3_removeSceneAnimObject(ScriptState *script);
- int o3_setVocHigh(ScriptState *script);
- int o3_getVocHigh(ScriptState *script);
- int o3_dummy(ScriptState *script);
+ int o3_getMalcolmShapes(EMCState *script);
+ int o3_setCharacterPos(EMCState *script);
+ int o3_defineObject(EMCState *script);
+ int o3_refreshCharacter(EMCState *script);
+ int o3_getMalcolmsMood(EMCState *script);
+ int o3_getCharacterFrameFromFacing(EMCState *script);
+ int o3_setCharacterFacing(EMCState *script);
+ int o3_showSceneFileMessage(EMCState *script);
+ int o3_setCharacterAnimFrameFromFacing(EMCState *script);
+ int o3_showBadConscience(EMCState *script);
+ int o3_hideBadConscience(EMCState *script);
+ int o3_setInventorySlot(EMCState *script);
+ int o3_getInventorySlot(EMCState *script);
+ int o3_addItemToInventory(EMCState *script);
+ int o3_addItemToCurScene(EMCState *script);
+ int o3_objectChat(EMCState *script);
+ int o3_resetInventory(EMCState *script);
+ int o3_removeInventoryItemInstances(EMCState *script);
+ int o3_countInventoryItemInstances(EMCState *script);
+ int o3_npcChatSequence(EMCState *script);
+ int o3_badConscienceChat(EMCState *script);
+ int o3_wipeDownMouseItem(EMCState *script);
+ int o3_setMalcolmsMood(EMCState *script);
+ int o3_updateScore(EMCState *script);
+ int o3_makeSecondChanceSave(EMCState *script);
+ int o3_setSceneFilename(EMCState *script);
+ int o3_removeItemsFromScene(EMCState *script);
+ int o3_disguiseMalcolm(EMCState *script);
+ int o3_drawSceneShape(EMCState *script);
+ int o3_drawSceneShapeOnPage(EMCState *script);
+ int o3_checkInRect(EMCState *script);
+ int o3_updateConversations(EMCState *script);
+ int o3_setSceneDim(EMCState *script);
+ int o3_setSceneAnimPosAndFrame(EMCState *script);
+ int o3_removeItemInstances(EMCState *script);
+ int o3_disableInventory(EMCState *script);
+ int o3_enableInventory(EMCState *script);
+ int o3_enterNewScene(EMCState *script);
+ int o3_switchScene(EMCState *script);
+ int o3_setMalcolmPos(EMCState *script);
+ int o3_stopMusic(EMCState *script);
+ int o3_playSoundEffect(EMCState *script);
+ int o3_getScore(EMCState *script);
+ int o3_daggerWarning(EMCState *script);
+ int o3_blockOutRegion(EMCState *script);
+ int o3_showSceneStringsMessage(EMCState *script);
+ int o3_showGoodConscience(EMCState *script);
+ int o3_goodConscienceChat(EMCState *script);
+ int o3_hideGoodConscience(EMCState *script);
+ int o3_defineSceneAnim(EMCState *script);
+ int o3_updateSceneAnim(EMCState *script);
+ int o3_runActorScript(EMCState *script);
+ int o3_runDialog(EMCState *script);
+ int o3_setConversationState(EMCState *script);
+ int o3_getConversationState(EMCState *script);
+ int o3_changeChapter(EMCState *script);
+ int o3_countItemInstances(EMCState *script);
+ int o3_dialogStartScript(EMCState *script);
+ int o3_dialogEndScript(EMCState *script);
+ int o3_customChat(EMCState *script);
+ int o3_customChatFinish(EMCState *script);
+ int o3_setupSceneAnimObject(EMCState *script);
+ int o3_removeSceneAnimObject(EMCState *script);
+ int o3_dummy(EMCState *script);
// misc
- TextDisplayer_v3 *_text;
- bool _wsaPlayingVQA;
+ TextDisplayer_MR *_text;
+ bool _wasPlayingVQA;
// resource specific
private:
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 90e62895d0..e9bb25fe5f 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -49,7 +49,6 @@ namespace Kyra {
KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
: KyraEngine(system, flags) {
_skipFlag = false;
- _flags = flags;
_seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm =
_seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 =
@@ -82,10 +81,6 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
_sprites = 0;
_animator = 0;
_seq = 0;
- _npcScriptData = 0;
- _scriptMain = 0;
- _scriptClickData = 0;
- _scriptClick = 0;
_characterList = 0;
_movFacingTable = 0;
_buttonData = 0;
@@ -95,7 +90,6 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
_finalA = _finalB = _finalC = 0;
_endSequenceBackUpRect = 0;
memset(_panPagesTable, 0, sizeof(_panPagesTable));
- _npcScriptData = _scriptClickData = 0;
memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
_currHeadShape = 0;
@@ -111,9 +105,9 @@ KyraEngine_v1::~KyraEngine_v1() {
}
closeFinalWsa();
- if (_scriptInterpreter) {
- _scriptInterpreter->unloadScript(_npcScriptData);
- _scriptInterpreter->unloadScript(_scriptClickData);
+ if (_emc) {
+ _emc->unload(&_npcScriptData);
+ _emc->unload(&_scriptClickData);
}
Common::clearAllSpecialDebugLevels();
@@ -124,12 +118,6 @@ KyraEngine_v1::~KyraEngine_v1() {
delete _animator;
delete _seq;
- delete _npcScriptData;
- delete _scriptMain;
-
- delete _scriptClickData;
- delete _scriptClick;
-
delete [] _characterList;
delete [] _movFacingTable;
@@ -168,13 +156,15 @@ KyraEngine_v1::~KyraEngine_v1() {
int KyraEngine_v1::init() {
_screen = new Screen_v1(this, _system);
assert(_screen);
+ _screen->setResolution();
+
KyraEngine::init();
_sprites = new Sprites(this, _system);
assert(_sprites);
_seq = new SeqPlayer(this, _system);
assert(_seq);
- _animator = new ScreenAnimator(this, _system);
+ _animator = new Animator_v1(this, _system);
assert(_animator);
_animator->init(5, 11, 12);
assert(*_animator);
@@ -211,23 +201,12 @@ int KyraEngine_v1::init() {
_characterList[0].facing = 3;
_characterList[0].currentAnimFrame = 7;
- _npcScriptData = new ScriptData;
- memset(_npcScriptData, 0, sizeof(ScriptData));
- assert(_npcScriptData);
- _npcScript = new ScriptState;
- assert(_npcScript);
- memset(_npcScript, 0, sizeof(ScriptState));
-
- _scriptMain = new ScriptState;
- assert(_scriptMain);
- memset(_scriptMain, 0, sizeof(ScriptState));
+ memset(&_npcScriptData, 0, sizeof(EMCData));
+ memset(&_scriptClickData, 0, sizeof(EMCData));
- _scriptClickData = new ScriptData;
- assert(_scriptClickData);
- memset(_scriptClickData, 0, sizeof(ScriptData));
- _scriptClick = new ScriptState;
- assert(_scriptClick);
- memset(_scriptClick, 0, sizeof(ScriptState));
+ memset(&_npcScript, 0, sizeof(EMCState));
+ memset(&_scriptMain, 0, sizeof(EMCState));
+ memset(&_scriptClick, 0, sizeof(EMCState));
_debugger = new Debugger_v1(this);
assert(_debugger);
@@ -386,19 +365,19 @@ void KyraEngine_v1::startup() {
_animator->initAnimStateList();
setCharactersInDefaultScene();
- if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, &_opcodes))
+ if (!_emc->load("_STARTUP.EMC", &_npcScriptData, &_opcodes))
error("Could not load \"_STARTUP.EMC\" script");
- _scriptInterpreter->initScript(_scriptMain, _npcScriptData);
+ _emc->init(&_scriptMain, &_npcScriptData);
- if (!_scriptInterpreter->startScript(_scriptMain, 0))
+ if (!_emc->start(&_scriptMain, 0))
error("Could not start script function 0 of script \"_STARTUP.EMC\"");
- while (_scriptInterpreter->validScript(_scriptMain))
- _scriptInterpreter->runScript(_scriptMain);
+ while (_emc->isValid(&_scriptMain))
+ _emc->run(&_scriptMain);
- _scriptInterpreter->unloadScript(_npcScriptData);
+ _emc->unload(&_npcScriptData);
- if (!_scriptInterpreter->loadScript("_NPC.EMC", _npcScriptData, &_opcodes))
+ if (!_emc->load("_NPC.EMC", &_npcScriptData, &_opcodes))
error("Could not load \"_NPC.EMC\" script");
snd_playTheme(1, -1);
@@ -784,17 +763,17 @@ int KyraEngine_v1::processInputHelper(int xpos, int ypos) {
int KyraEngine_v1::clickEventHandler(int xpos, int ypos) {
debugC(9, kDebugLevelMain, "KyraEngine_v1::clickEventHandler(%d, %d)", xpos, ypos);
- _scriptInterpreter->initScript(_scriptClick, _scriptClickData);
- _scriptClick->regs[1] = xpos;
- _scriptClick->regs[2] = ypos;
- _scriptClick->regs[3] = 0;
- _scriptClick->regs[4] = _itemInHand;
- _scriptInterpreter->startScript(_scriptClick, 1);
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _scriptClick.regs[1] = xpos;
+ _scriptClick.regs[2] = ypos;
+ _scriptClick.regs[3] = 0;
+ _scriptClick.regs[4] = _itemInHand;
+ _emc->start(&_scriptClick, 1);
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
- return _scriptClick->regs[3];
+ return _scriptClick.regs[3];
}
void KyraEngine_v1::updateMousePointer(bool forceUpdate) {
@@ -928,15 +907,15 @@ void KyraEngine_v1::clickEventHandler2() {
Common::Point mouse = getMousePos();
- _scriptInterpreter->initScript(_scriptClick, _scriptClickData);
- _scriptClick->regs[0] = _currentCharacter->sceneId;
- _scriptClick->regs[1] = mouse.x;
- _scriptClick->regs[2] = mouse.y;
- _scriptClick->regs[4] = _itemInHand;
- _scriptInterpreter->startScript(_scriptClick, 6);
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _scriptClick.regs[0] = _currentCharacter->sceneId;
+ _scriptClick.regs[1] = mouse.x;
+ _scriptClick.regs[2] = mouse.y;
+ _scriptClick.regs[4] = _itemInHand;
+ _emc->start(&_scriptClick, 6);
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
}
int KyraEngine_v1::checkForNPCScriptRun(int xpos, int ypos) {
@@ -990,14 +969,14 @@ int KyraEngine_v1::checkForNPCScriptRun(int xpos, int ypos) {
void KyraEngine_v1::runNpcScript(int func) {
debugC(9, kDebugLevelMain, "KyraEngine_v1::runNpcScript(%d)", func);
- _scriptInterpreter->initScript(_npcScript, _npcScriptData);
- _scriptInterpreter->startScript(_npcScript, func);
- _npcScript->regs[0] = _currentCharacter->sceneId;
- _npcScript->regs[4] = _itemInHand;
- _npcScript->regs[5] = func;
-
- while (_scriptInterpreter->validScript(_npcScript))
- _scriptInterpreter->runScript(_npcScript);
+ _emc->init(&_npcScript, &_npcScriptData);
+ _emc->start(&_npcScript, func);
+ _npcScript.regs[0] = _currentCharacter->sceneId;
+ _npcScript.regs[4] = _itemInHand;
+ _npcScript.regs[5] = func;
+
+ while (_emc->isValid(&_npcScript))
+ _emc->run(&_npcScript);
}
void KyraEngine_v1::checkAmuletAnimFlags() {
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 3fa089e0d5..50791c3ade 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -38,7 +38,7 @@ class SoundDigital;
class SeqPlayer;
class Sprites;
class Debugger;
-class ScreenAnimator;
+class Animator_v1;
class TextDisplayer;
class KyraEngine_v1;
@@ -108,14 +108,14 @@ struct BeadState {
class KyraEngine_v1 : public KyraEngine {
friend class MusicPlayer;
friend class Debugger_v1;
- friend class ScreenAnimator;
+ friend class Animator_v1;
friend class GUI_v1;
public:
KyraEngine_v1(OSystem *system, const GameFlags &flags);
~KyraEngine_v1();
Screen *screen() { return _screen; }
- ScreenAnimator *animator() { return _animator; }
+ Animator_v1 *animator() { return _animator; }
virtual Movie *createWSAMovie();
uint8 **shapes() { return _shapes; }
@@ -202,7 +202,7 @@ public:
void readSettings();
void writeSettings();
- void snd_playSoundEffect(int track);
+ void snd_playSoundEffect(int track, int volume=0xFF);
void snd_playWanderScoreViaMap(int command, int restart);
virtual void snd_playVoiceFile(int id);
void snd_voiceWaitForFinish(bool ingame = true);
@@ -476,19 +476,19 @@ protected:
uint8 _configTextspeed;
- ScreenAnimator *_animator;
+ Animator_v1 *_animator;
SeqPlayer *_seq;
Sprites *_sprites;
Screen_v1 *_screen;
Debugger *_debugger;
- ScriptState *_scriptMain;
+ EMCState _scriptMain;
- ScriptState *_npcScript;
- ScriptData *_npcScriptData;
+ EMCState _npcScript;
+ EMCData _npcScriptData;
- ScriptState *_scriptClick;
- ScriptData *_scriptClickData;
+ EMCState _scriptClick;
+ EMCData _scriptClickData;
Character *_characterList;
Character *_currentCharacter;
@@ -656,163 +656,163 @@ protected:
void setupOpcodeTable();
// Opcodes
- int o1_magicInMouseItem(ScriptState *script);
- int o1_characterSays(ScriptState *script);
- int o1_pauseTicks(ScriptState *script);
- int o1_drawSceneAnimShape(ScriptState *script);
- int o1_queryGameFlag(ScriptState *script);
- int o1_setGameFlag(ScriptState *script);
- int o1_resetGameFlag(ScriptState *script);
- int o1_runNPCScript(ScriptState *script);
- int o1_setSpecialExitList(ScriptState *script);
- int o1_blockInWalkableRegion(ScriptState *script);
- int o1_blockOutWalkableRegion(ScriptState *script);
- int o1_walkPlayerToPoint(ScriptState *script);
- int o1_dropItemInScene(ScriptState *script);
- int o1_drawAnimShapeIntoScene(ScriptState *script);
- int o1_createMouseItem(ScriptState *script);
- int o1_savePageToDisk(ScriptState *script);
- int o1_sceneAnimOn(ScriptState *script);
- int o1_sceneAnimOff(ScriptState *script);
- int o1_getElapsedSeconds(ScriptState *script);
- int o1_mouseIsPointer(ScriptState *script);
- int o1_destroyMouseItem(ScriptState *script);
- int o1_runSceneAnimUntilDone(ScriptState *script);
- int o1_fadeSpecialPalette(ScriptState *script);
- int o1_playAdlibSound(ScriptState *script);
- int o1_playAdlibScore(ScriptState *script);
- int o1_phaseInSameScene(ScriptState *script);
- int o1_setScenePhasingFlag(ScriptState *script);
- int o1_resetScenePhasingFlag(ScriptState *script);
- int o1_queryScenePhasingFlag(ScriptState *script);
- int o1_sceneToDirection(ScriptState *script);
- int o1_setBirthstoneGem(ScriptState *script);
- int o1_placeItemInGenericMapScene(ScriptState *script);
- int o1_setBrandonStatusBit(ScriptState *script);
- int o1_pauseSeconds(ScriptState *script);
- int o1_getCharactersLocation(ScriptState *script);
- int o1_runNPCSubscript(ScriptState *script);
- int o1_magicOutMouseItem(ScriptState *script);
- int o1_internalAnimOn(ScriptState *script);
- int o1_forceBrandonToNormal(ScriptState *script);
- int o1_poisonDeathNow(ScriptState *script);
- int o1_setScaleMode(ScriptState *script);
- int o1_openWSAFile(ScriptState *script);
- int o1_closeWSAFile(ScriptState *script);
- int o1_runWSAFromBeginningToEnd(ScriptState *script);
- int o1_displayWSAFrame(ScriptState *script);
- int o1_enterNewScene(ScriptState *script);
- int o1_setSpecialEnterXAndY(ScriptState *script);
- int o1_runWSAFrames(ScriptState *script);
- int o1_popBrandonIntoScene(ScriptState *script);
- int o1_restoreAllObjectBackgrounds(ScriptState *script);
- int o1_setCustomPaletteRange(ScriptState *script);
- int o1_loadPageFromDisk(ScriptState *script);
- int o1_customPrintTalkString(ScriptState *script);
- int o1_restoreCustomPrintBackground(ScriptState *script);
- int o1_hideMouse(ScriptState *script);
- int o1_showMouse(ScriptState *script);
- int o1_getCharacterX(ScriptState *script);
- int o1_getCharacterY(ScriptState *script);
- int o1_changeCharactersFacing(ScriptState *script);
- int o1_copyWSARegion(ScriptState *script);
- int o1_printText(ScriptState *script);
- int o1_random(ScriptState *script);
- int o1_loadSoundFile(ScriptState *script);
- int o1_displayWSAFrameOnHidPage(ScriptState *script);
- int o1_displayWSASequentialFrames(ScriptState *script);
- int o1_drawCharacterStanding(ScriptState *script);
- int o1_internalAnimOff(ScriptState *script);
- int o1_changeCharactersXAndY(ScriptState *script);
- int o1_clearSceneAnimatorBeacon(ScriptState *script);
- int o1_querySceneAnimatorBeacon(ScriptState *script);
- int o1_refreshSceneAnimator(ScriptState *script);
- int o1_placeItemInOffScene(ScriptState *script);
- int o1_wipeDownMouseItem(ScriptState *script);
- int o1_placeCharacterInOtherScene(ScriptState *script);
- int o1_getKey(ScriptState *script);
- int o1_specificItemInInventory(ScriptState *script);
- int o1_popMobileNPCIntoScene(ScriptState *script);
- int o1_mobileCharacterInScene(ScriptState *script);
- int o1_hideMobileCharacter(ScriptState *script);
- int o1_unhideMobileCharacter(ScriptState *script);
- int o1_setCharactersLocation(ScriptState *script);
- int o1_walkCharacterToPoint(ScriptState *script);
- int o1_specialEventDisplayBrynnsNote(ScriptState *script);
- int o1_specialEventRemoveBrynnsNote(ScriptState *script);
- int o1_setLogicPage(ScriptState *script);
- int o1_fatPrint(ScriptState *script);
- int o1_preserveAllObjectBackgrounds(ScriptState *script);
- int o1_updateSceneAnimations(ScriptState *script);
- int o1_sceneAnimationActive(ScriptState *script);
- int o1_setCharactersMovementDelay(ScriptState *script);
- int o1_getCharactersFacing(ScriptState *script);
- int o1_bkgdScrollSceneAndMasksRight(ScriptState *script);
- int o1_dispelMagicAnimation(ScriptState *script);
- int o1_findBrightestFireberry(ScriptState *script);
- int o1_setFireberryGlowPalette(ScriptState *script);
- int o1_setDeathHandlerFlag(ScriptState *script);
- int o1_drinkPotionAnimation(ScriptState *script);
- int o1_makeAmuletAppear(ScriptState *script);
- int o1_drawItemShapeIntoScene(ScriptState *script);
- int o1_setCharactersCurrentFrame(ScriptState *script);
- int o1_waitForConfirmationMouseClick(ScriptState *script);
- int o1_pageFlip(ScriptState *script);
- int o1_setSceneFile(ScriptState *script);
- int o1_getItemInMarbleVase(ScriptState *script);
- int o1_setItemInMarbleVase(ScriptState *script);
- int o1_addItemToInventory(ScriptState *script);
- int o1_intPrint(ScriptState *script);
- int o1_shakeScreen(ScriptState *script);
- int o1_createAmuletJewel(ScriptState *script);
- int o1_setSceneAnimCurrXY(ScriptState *script);
- int o1_poisonBrandonAndRemaps(ScriptState *script);
- int o1_fillFlaskWithWater(ScriptState *script);
- int o1_getCharactersMovementDelay(ScriptState *script);
- int o1_getBirthstoneGem(ScriptState *script);
- int o1_queryBrandonStatusBit(ScriptState *script);
- int o1_playFluteAnimation(ScriptState *script);
- int o1_playWinterScrollSequence(ScriptState *script);
- int o1_getIdolGem(ScriptState *script);
- int o1_setIdolGem(ScriptState *script);
- int o1_totalItemsInScene(ScriptState *script);
- int o1_restoreBrandonsMovementDelay(ScriptState *script);
- int o1_setMousePos(ScriptState *script);
- int o1_getMouseState(ScriptState *script);
- int o1_setEntranceMouseCursorTrack(ScriptState *script);
- int o1_itemAppearsOnGround(ScriptState *script);
- int o1_setNoDrawShapesFlag(ScriptState *script);
- int o1_fadeEntirePalette(ScriptState *script);
- int o1_itemOnGroundHere(ScriptState *script);
- int o1_queryCauldronState(ScriptState *script);
- int o1_setCauldronState(ScriptState *script);
- int o1_queryCrystalState(ScriptState *script);
- int o1_setCrystalState(ScriptState *script);
- int o1_setPaletteRange(ScriptState *script);
- int o1_shrinkBrandonDown(ScriptState *script);
- int o1_growBrandonUp(ScriptState *script);
- int o1_setBrandonScaleXAndY(ScriptState *script);
- int o1_resetScaleMode(ScriptState *script);
- int o1_getScaleDepthTableValue(ScriptState *script);
- int o1_setScaleDepthTableValue(ScriptState *script);
- int o1_message(ScriptState *script);
- int o1_checkClickOnNPC(ScriptState *script);
- int o1_getFoyerItem(ScriptState *script);
- int o1_setFoyerItem(ScriptState *script);
- int o1_setNoItemDropRegion(ScriptState *script);
- int o1_walkMalcolmOn(ScriptState *script);
- int o1_passiveProtection(ScriptState *script);
- int o1_setPlayingLoop(ScriptState *script);
- int o1_brandonToStoneSequence(ScriptState *script);
- int o1_brandonHealingSequence(ScriptState *script);
- int o1_protectCommandLine(ScriptState *script);
- int o1_pauseMusicSeconds(ScriptState *script);
- int o1_resetMaskRegion(ScriptState *script);
- int o1_setPaletteChangeFlag(ScriptState *script);
- int o1_fillRect(ScriptState *script);
- int o1_dummy(ScriptState *script);
- int o1_vocUnload(ScriptState *script);
- int o1_vocLoad(ScriptState *script);
+ int o1_magicInMouseItem(EMCState *script);
+ int o1_characterSays(EMCState *script);
+ int o1_pauseTicks(EMCState *script);
+ int o1_drawSceneAnimShape(EMCState *script);
+ int o1_queryGameFlag(EMCState *script);
+ int o1_setGameFlag(EMCState *script);
+ int o1_resetGameFlag(EMCState *script);
+ int o1_runNPCScript(EMCState *script);
+ int o1_setSpecialExitList(EMCState *script);
+ int o1_blockInWalkableRegion(EMCState *script);
+ int o1_blockOutWalkableRegion(EMCState *script);
+ int o1_walkPlayerToPoint(EMCState *script);
+ int o1_dropItemInScene(EMCState *script);
+ int o1_drawAnimShapeIntoScene(EMCState *script);
+ int o1_createMouseItem(EMCState *script);
+ int o1_savePageToDisk(EMCState *script);
+ int o1_sceneAnimOn(EMCState *script);
+ int o1_sceneAnimOff(EMCState *script);
+ int o1_getElapsedSeconds(EMCState *script);
+ int o1_mouseIsPointer(EMCState *script);
+ int o1_destroyMouseItem(EMCState *script);
+ int o1_runSceneAnimUntilDone(EMCState *script);
+ int o1_fadeSpecialPalette(EMCState *script);
+ int o1_playAdlibSound(EMCState *script);
+ int o1_playAdlibScore(EMCState *script);
+ int o1_phaseInSameScene(EMCState *script);
+ int o1_setScenePhasingFlag(EMCState *script);
+ int o1_resetScenePhasingFlag(EMCState *script);
+ int o1_queryScenePhasingFlag(EMCState *script);
+ int o1_sceneToDirection(EMCState *script);
+ int o1_setBirthstoneGem(EMCState *script);
+ int o1_placeItemInGenericMapScene(EMCState *script);
+ int o1_setBrandonStatusBit(EMCState *script);
+ int o1_pauseSeconds(EMCState *script);
+ int o1_getCharactersLocation(EMCState *script);
+ int o1_runNPCSubscript(EMCState *script);
+ int o1_magicOutMouseItem(EMCState *script);
+ int o1_internalAnimOn(EMCState *script);
+ int o1_forceBrandonToNormal(EMCState *script);
+ int o1_poisonDeathNow(EMCState *script);
+ int o1_setScaleMode(EMCState *script);
+ int o1_openWSAFile(EMCState *script);
+ int o1_closeWSAFile(EMCState *script);
+ int o1_runWSAFromBeginningToEnd(EMCState *script);
+ int o1_displayWSAFrame(EMCState *script);
+ int o1_enterNewScene(EMCState *script);
+ int o1_setSpecialEnterXAndY(EMCState *script);
+ int o1_runWSAFrames(EMCState *script);
+ int o1_popBrandonIntoScene(EMCState *script);
+ int o1_restoreAllObjectBackgrounds(EMCState *script);
+ int o1_setCustomPaletteRange(EMCState *script);
+ int o1_loadPageFromDisk(EMCState *script);
+ int o1_customPrintTalkString(EMCState *script);
+ int o1_restoreCustomPrintBackground(EMCState *script);
+ int o1_hideMouse(EMCState *script);
+ int o1_showMouse(EMCState *script);
+ int o1_getCharacterX(EMCState *script);
+ int o1_getCharacterY(EMCState *script);
+ int o1_changeCharactersFacing(EMCState *script);
+ int o1_copyWSARegion(EMCState *script);
+ int o1_printText(EMCState *script);
+ int o1_random(EMCState *script);
+ int o1_loadSoundFile(EMCState *script);
+ int o1_displayWSAFrameOnHidPage(EMCState *script);
+ int o1_displayWSASequentialFrames(EMCState *script);
+ int o1_drawCharacterStanding(EMCState *script);
+ int o1_internalAnimOff(EMCState *script);
+ int o1_changeCharactersXAndY(EMCState *script);
+ int o1_clearSceneAnimatorBeacon(EMCState *script);
+ int o1_querySceneAnimatorBeacon(EMCState *script);
+ int o1_refreshSceneAnimator(EMCState *script);
+ int o1_placeItemInOffScene(EMCState *script);
+ int o1_wipeDownMouseItem(EMCState *script);
+ int o1_placeCharacterInOtherScene(EMCState *script);
+ int o1_getKey(EMCState *script);
+ int o1_specificItemInInventory(EMCState *script);
+ int o1_popMobileNPCIntoScene(EMCState *script);
+ int o1_mobileCharacterInScene(EMCState *script);
+ int o1_hideMobileCharacter(EMCState *script);
+ int o1_unhideMobileCharacter(EMCState *script);
+ int o1_setCharactersLocation(EMCState *script);
+ int o1_walkCharacterToPoint(EMCState *script);
+ int o1_specialEventDisplayBrynnsNote(EMCState *script);
+ int o1_specialEventRemoveBrynnsNote(EMCState *script);
+ int o1_setLogicPage(EMCState *script);
+ int o1_fatPrint(EMCState *script);
+ int o1_preserveAllObjectBackgrounds(EMCState *script);
+ int o1_updateSceneAnimations(EMCState *script);
+ int o1_sceneAnimationActive(EMCState *script);
+ int o1_setCharactersMovementDelay(EMCState *script);
+ int o1_getCharactersFacing(EMCState *script);
+ int o1_bkgdScrollSceneAndMasksRight(EMCState *script);
+ int o1_dispelMagicAnimation(EMCState *script);
+ int o1_findBrightestFireberry(EMCState *script);
+ int o1_setFireberryGlowPalette(EMCState *script);
+ int o1_setDeathHandlerFlag(EMCState *script);
+ int o1_drinkPotionAnimation(EMCState *script);
+ int o1_makeAmuletAppear(EMCState *script);
+ int o1_drawItemShapeIntoScene(EMCState *script);
+ int o1_setCharactersCurrentFrame(EMCState *script);
+ int o1_waitForConfirmationMouseClick(EMCState *script);
+ int o1_pageFlip(EMCState *script);
+ int o1_setSceneFile(EMCState *script);
+ int o1_getItemInMarbleVase(EMCState *script);
+ int o1_setItemInMarbleVase(EMCState *script);
+ int o1_addItemToInventory(EMCState *script);
+ int o1_intPrint(EMCState *script);
+ int o1_shakeScreen(EMCState *script);
+ int o1_createAmuletJewel(EMCState *script);
+ int o1_setSceneAnimCurrXY(EMCState *script);
+ int o1_poisonBrandonAndRemaps(EMCState *script);
+ int o1_fillFlaskWithWater(EMCState *script);
+ int o1_getCharactersMovementDelay(EMCState *script);
+ int o1_getBirthstoneGem(EMCState *script);
+ int o1_queryBrandonStatusBit(EMCState *script);
+ int o1_playFluteAnimation(EMCState *script);
+ int o1_playWinterScrollSequence(EMCState *script);
+ int o1_getIdolGem(EMCState *script);
+ int o1_setIdolGem(EMCState *script);
+ int o1_totalItemsInScene(EMCState *script);
+ int o1_restoreBrandonsMovementDelay(EMCState *script);
+ int o1_setMousePos(EMCState *script);
+ int o1_getMouseState(EMCState *script);
+ int o1_setEntranceMouseCursorTrack(EMCState *script);
+ int o1_itemAppearsOnGround(EMCState *script);
+ int o1_setNoDrawShapesFlag(EMCState *script);
+ int o1_fadeEntirePalette(EMCState *script);
+ int o1_itemOnGroundHere(EMCState *script);
+ int o1_queryCauldronState(EMCState *script);
+ int o1_setCauldronState(EMCState *script);
+ int o1_queryCrystalState(EMCState *script);
+ int o1_setCrystalState(EMCState *script);
+ int o1_setPaletteRange(EMCState *script);
+ int o1_shrinkBrandonDown(EMCState *script);
+ int o1_growBrandonUp(EMCState *script);
+ int o1_setBrandonScaleXAndY(EMCState *script);
+ int o1_resetScaleMode(EMCState *script);
+ int o1_getScaleDepthTableValue(EMCState *script);
+ int o1_setScaleDepthTableValue(EMCState *script);
+ int o1_message(EMCState *script);
+ int o1_checkClickOnNPC(EMCState *script);
+ int o1_getFoyerItem(EMCState *script);
+ int o1_setFoyerItem(EMCState *script);
+ int o1_setNoItemDropRegion(EMCState *script);
+ int o1_walkMalcolmOn(EMCState *script);
+ int o1_passiveProtection(EMCState *script);
+ int o1_setPlayingLoop(EMCState *script);
+ int o1_brandonToStoneSequence(EMCState *script);
+ int o1_brandonHealingSequence(EMCState *script);
+ int o1_protectCommandLine(EMCState *script);
+ int o1_pauseMusicSeconds(EMCState *script);
+ int o1_resetMaskRegion(EMCState *script);
+ int o1_setPaletteChangeFlag(EMCState *script);
+ int o1_fillRect(EMCState *script);
+ int o1_dummy(EMCState *script);
+ int o1_vocUnload(EMCState *script);
+ int o1_vocLoad(EMCState *script);
};
} // end of namespace Kyra
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 56512eb030..176f8e4e2f 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -23,775 +23,74 @@
*
*/
-#include "kyra/kyra.h"
#include "kyra/kyra_v2.h"
-#include "kyra/screen.h"
-#include "kyra/resource.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
-#include "kyra/script.h"
-#include "kyra/script_tim.h"
-#include "kyra/text_v2.h"
-#include "kyra/timer.h"
+#include "kyra/screen_v2.h"
#include "kyra/debugger.h"
-#include "common/system.h"
-#include "common/config-manager.h"
-
namespace Kyra {
-KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags), _updateFunctor(this, &KyraEngine_v2::update) {
- memset(_defaultShapeTable, 0, sizeof(_defaultShapeTable));
- _mouseSHPBuf = 0;
- _debugger = 0;
- _screen = 0;
- _text = 0;
-
- _seqProcessedString = 0;
- _activeWSA = 0;
- _activeText = 0;
- _seqWsa = 0;
- _sequences = 0;
- _sequenceSoundList = 0;
-
- _showCredits = false;
-
- _gamePlayBuffer = 0;
- _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0;
+KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc) : KyraEngine(system, flags), _desc(desc) {
+ memset(&_sceneAnims, 0, sizeof(_sceneAnims));
+ memset(&_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
- _overwriteSceneFacing = false;
- _mainCharX = _mainCharY = -1;
- _drawNoShapeFlag = false;
- _charPalEntry = 0;
- _itemInHand = -1;
- _unkSceneScreenFlag1 = false;
- _noScriptEnter = true;
- _currentChapter = 0;
- _newChapterFile = 1;
- _oldTalkFile = -1;
- _currentTalkFile = 0;
- _lastSfxTrack = -1;
- _handItemSet = -1;
_lastProcessedSceneScript = 0;
_specialSceneScriptRunFlag = false;
- memset(_animObjects, 0, sizeof(_animObjects));
- _unkHandleSceneChangeFlag = false;
- _pathfinderFlag = 0;
- _mouseX = _mouseY = 0;
- _newShapeCount = 0;
- _newShapeFiledata = 0;
-
- _vocHigh = -1;
- _chatVocHigh = -1;
- _chatVocLow = -1;
- _chatText = 0;
- _chatObject = -1;
- _lastIdleScript = -1;
- _currentTalkSections.STATim = 0;
- _currentTalkSections.TLKTim = 0;
- _currentTalkSections.ENDTim = 0;
-
- memset(&_invWsa, 0, sizeof(_invWsa));
- _itemAnimData = 0;
- _demoAnimData = 0;
- _nextAnimItem = 0;
+ _itemList = 0;
+ _itemListSize = 0;
- for (int i = 0; i < 15; i++)
- memset(&_activeItemAnim[i], 0, sizeof(ActiveItemAnim));
+ _characterShapeFile = -1;
- _colorCodeFlag1 = 0;
- _colorCodeFlag2 = -1;
- _scriptCountDown = 0;
- _dbgPass = 0;
+ _updateCharPosNextUpdate = 0;
- _gamePlayBuffer = 0;
- _unkBuf500Bytes = 0;
- _screenBuffer = 0;
- _inventorySaved = false;
- _unkBuf200kByte = 0;
- memset(&_defaultShapeTable, 0, sizeof(_defaultShapeTable));
- memset(&_sceneShapeTable, 0, sizeof(_sceneShapeTable));
+ memset(&_sceneScriptState, 0, sizeof(_sceneScriptState));
memset(&_sceneScriptData, 0, sizeof(_sceneScriptData));
- _talkObjectList = 0;
- _shapeDescTable = 0;
- _gfxBackUpRect = 0;
- _sceneList = 0;
- memset(&_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
- memset(&_wsaSlots, 0, sizeof(_wsaSlots));
- memset(&_buttonShapes, 0, sizeof(_buttonShapes));
-
- _configTextspeed = 50;
-
- _inventoryButtons = _buttonList = 0;
-
- _dlgBuffer = 0;
- _conversationState = new int8*[19];
- for (int i = 0; i < 19; i++)
- _conversationState[i] = new int8[14];
- _npcTalkChpIndex = _npcTalkDlgIndex = -1;
- _mainCharacter.dlgIndex = 0;
- setNewDlgIndex(-1);
+ _animObjects = 0;
+ _runFlag = true;
+ _showOutro = false;
_deathHandler = -1;
+ _animNeedUpdate = false;
- _bookMaxPage = 6;
- _bookCurPage = 0;
- _bookNewPage = 0;
- _bookBkgd = 0;
-
- _cauldronState = 0;
- _cauldronUseCount = 0;
- memset(_cauldronStateTables, 0, sizeof(_cauldronStateTables));
-
- _menuDirectlyToLoad = false;
- _menu = 0;
-}
-
-KyraEngine_v2::~KyraEngine_v2() {
- cleanup();
- seq_uninit();
-
- delete [] _mouseSHPBuf;
- delete _screen;
- delete _text;
- delete _gui;
- delete _tim;
- _text = 0;
- delete _debugger;
- delete _invWsa.wsa;
-
- if (_sequenceSoundList) {
- for (int i = 0; i < _sequenceSoundListSize; i++) {
- if (_sequenceSoundList[i])
- delete [] _sequenceSoundList[i];
- }
- delete [] _sequenceSoundList;
- _sequenceSoundList = NULL;
- }
-
- if (_dlgBuffer)
- delete [] _dlgBuffer;
- for (int i = 0; i < 19; i++)
- delete [] _conversationState[i];
- delete [] _conversationState;
-
- for (Common::Array<const Opcode*>::iterator i = _opcodesTemporary.begin(); i != _opcodesTemporary.end(); ++i)
- delete *i;
- _opcodesTemporary.clear();
-
- for (Common::Array<const TIMOpcode*>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i)
- delete *i;
- _timOpcodes.clear();
-}
-
-Movie *KyraEngine_v2::createWSAMovie() {
- return new WSAMovieV2(this, _screen);
-}
-
-int KyraEngine_v2::init() {
- _screen = new Screen_v2(this, _system);
- assert(_screen);
-
- KyraEngine::init();
- initStaticResource();
-
- _debugger = new Debugger_v2(this);
- assert(_debugger);
- _text = new TextDisplayer_v2(this, _screen);
- assert(_text);
- _gui = new GUI_v2(this);
- assert(_gui);
- _tim = new TIMInterpreter(this, _system);
- assert(_tim);
-
- if (_flags.isDemo && !_flags.isTalkie) {
- _screen->loadFont(_screen->FID_8_FNT, "FONT9P.FNT");
- } else {
- _screen->loadFont(_screen->FID_6_FNT, "6.FNT");
- _screen->loadFont(_screen->FID_8_FNT, "8FAT.FNT");
- _screen->loadFont(_screen->FID_BOOKFONT_FNT, "BOOKFONT.FNT");
- }
- _screen->loadFont(_screen->FID_GOLDFONT_FNT, "GOLDFONT.FNT");
-
- _screen->setAnimBlockPtr(3504);
- _screen->setScreenDim(0);
-
- if (!_sound->init())
- error("Couldn't init sound");
-
- _abortIntroFlag = false;
-
- if (_sequenceStrings) {
- for (int i = 0; i < 33; i++)
- _sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8;
- }
+ _animShapeCount = 0;
+ _animShapeFiledata = 0;
- // No mouse display in demo
- if (_flags.isDemo && !_flags.isTalkie)
- return 0;
-
- _mouseSHPBuf = _res->fileData("PWGMOUSE.SHP", 0);
- assert(_mouseSHPBuf);
-
- for (int i = 0; i < 2; i++) {
- _defaultShapeTable[i] = _screen->getPtrToShape(_mouseSHPBuf, i);
- assert(_defaultShapeTable[i]);
- }
-
- _screen->setMouseCursor(0, 0, _defaultShapeTable[0]);
- return 0;
-}
-
-int KyraEngine_v2::go() {
- if (_gameToLoad == -1) {
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
- seq_showStarcraftLogo();
-
- if (_flags.isDemo && !_flags.isTalkie) {
- seq_playSequences(kSequenceDemoVirgin, kSequenceDemoFisher);
- _menuChoice = 4;
- } else {
- seq_playSequences(kSequenceVirgin, kSequenceZanfaun);
- }
- } else {
- _menuChoice = 1;
- }
-
- _res->unloadAllPakFiles();
-
- if (_menuChoice != 4) {
- // load just the pak files needed for ingame
- _res->loadPakFile(StaticResource::staticDataFilename());
- if (_flags.platform == Common::kPlatformPC && _flags.isTalkie)
- _res->loadFileList("FILEDATA.FDT");
- else
- _res->loadFileList(_ingamePakList, _ingamePakListSize);
- }
-
- _menuDirectlyToLoad = (_menuChoice == 3) ? true : false;
-
- if (_menuChoice & 1) {
- startup();
- if (!quit())
- runLoop();
- cleanup();
-
- if (_showCredits)
- seq_playSequences(kSequenceFunters, kSequenceFrash);
- }
-
- return 0;
-}
-
-void KyraEngine_v2::startup() {
- _sound->setSoundList(&_soundData[kMusicIngame]);
- // The track map is exactly the same
- // for FM-TOWNS and DOS
- _trackMap = _dosTrackMap;
- _trackMapSize = _dosTrackMapSize;
-
- _screen->_curPage = 0;
- delete [] _mouseSHPBuf;
- _mouseSHPBuf = 0;
-
- memset(_defaultShapeTable, 0, sizeof(_defaultShapeTable));
- memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
- _gamePlayBuffer = new uint8[46080];
- _unkBuf500Bytes = new uint8[500];
-
- loadMouseShapes();
- loadItemShapes();
-
- _screen->setMouseCursor(0, 0, getShapePtr(0));
-
- _screenBuffer = new uint8[64000];
- _unkBuf200kByte = new uint8[200000];
-
- loadChapterBuffer(_newChapterFile);
-
- loadCCodeBuffer("C_CODE.XXX");
-
- if (_flags.isTalkie) {
- loadOptionsBuffer("OPTIONS.XXX");
-
- showMessageFromCCode(265, 150, 0);
- _screen->updateScreen();
- openTalkFile(0);
- _currentTalkFile = 1;
- openTalkFile(1);
- } else {
- _optionsBuffer = _cCodeBuffer;
- }
-
- showMessage(0, 207);
-
- _screen->setShapePages(5, 3);
-
- memset(&_mainCharacter, 0, sizeof(_mainCharacter));
- _mainCharacter.height = 0x30;
- _mainCharacter.facing = 4;
- _mainCharacter.animFrame = 0x12;
- memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
-
- memset(_sceneAnims, 0, sizeof(_sceneAnims));
- for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
- _sceneAnimMovie[i] = new WSAMovieV2(this, _screen);
- memset(_wsaSlots, 0, sizeof(_wsaSlots));
- for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i)
- _wsaSlots[i] = new WSAMovieV2(this, _screen);
-
- _screen->_curPage = 0;
-
- _talkObjectList = new TalkObject[72];
- memset(_talkObjectList, 0, sizeof(TalkObject)*72);
- _shapeDescTable = new ShapeDesc[55];
- memset(_shapeDescTable, 0, sizeof(ShapeDesc)*55);
-
- for (int i = 9; i <= 32; ++i) {
- _shapeDescTable[i-9].width = 30;
- _shapeDescTable[i-9].height = 55;
- _shapeDescTable[i-9].xAdd = -15;
- _shapeDescTable[i-9].yAdd = -50;
- }
-
- for (int i = 19; i <= 24; ++i) {
- _shapeDescTable[i-9].width = 53;
- _shapeDescTable[i-9].yAdd = -51;
- }
-
- _gfxBackUpRect = new uint8[_screen->getRectSize(32, 32)];
- _itemList = new Item[30];
- memset(_itemList, 0, sizeof(Item)*30);
- loadButtonShapes();
- resetItemList();
- _loadedZTable = 1;
- loadZShapes(_loadedZTable);
- initInventoryButtonList();
- setupLangButtonShapes();
- loadInventoryShapes();
-
- _res->loadFileToBuf("PALETTE.COL", _screen->_currentPalette, 0x300);
- _screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
- _screen->copyPage(3, 0);
- _screen->showMouse();
- _screen->hideMouse();
-
- clearAnimObjects();
+ _vocHigh = -1;
+ _chatVocHigh = -1;
+ _chatVocLow = -1;
+ _chatText = 0;
+ _chatObject = -1;
- for (int i = 0; i < 19; ++i)
- memset(_conversationState[i], -1, sizeof(int8)*14);
- clearCauldronTable();
- memset(_inputColorCode, -1, sizeof(_inputColorCode));
- memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
memset(_hiddenItems, -1, sizeof(_hiddenItems));
- for (int i = 0; i < 23; ++i)
- resetCauldronStateTable(i);
-
- _sceneList = new SceneDesc[86];
- memset(_sceneList, 0, sizeof(SceneDesc)*86);
- _sceneListSize = 86;
- runStartScript(1, 0);
- loadNPCScript();
-
- if (_gameToLoad == -1) {
- snd_playWanderScoreViaMap(52, 1);
- enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
- saveGame(getSavegameFilename(0), "New Game");
- } else {
- loadGame(getSavegameFilename(_gameToLoad));
- }
-
- _screen->showMouse();
-
- if (_menuDirectlyToLoad)
- (*_inventoryButtons[0].buttonCallback)(&_inventoryButtons[0]);
-
- setNextIdleAnimTimer();
- //XXX
- setWalkspeed(_configWalkspeed);
-}
-
-void KyraEngine_v2::runLoop() {
- _screen->updateScreen();
-
- _quitFlag = false;
- _runFlag = true;
- while (!_quitFlag && _runFlag) {
- if (_deathHandler >= 0) {
- removeHandItem();
- delay(5);
- _drawNoShapeFlag = 0;
- _gui->optionsButton(0);
- _deathHandler = -1;
- }
-
- if (_system->getMillis() > _nextIdleAnim)
- showIdleAnim();
-
- if (queryGameFlag(0x159)) {
- dinoRide();
- resetGameFlag(0x159);
- }
-
- if (queryGameFlag(0x124) && !queryGameFlag(0x125)) {
- _mainCharacter.animFrame = 32;
- enterNewScene(39, -1, 0, 0, 0);
- }
-
- if (queryGameFlag(0xD8)) {
- resetGameFlag(0xD8);
- if (_mainCharacter.sceneId == 34) {
- if (queryGameFlag(0xD1)) {
- initTalkObject(28);
- npcChatSequence(getTableString(0xFA, _cCodeBuffer, 1), 28, 0x83, 0xFA);
- deinitTalkObject(28);
- enterNewScene(35, 4, 0, 0, 0);
- } else if (queryGameFlag(0xD0)) {
- initTalkObject(29);
- npcChatSequence(getTableString(0xFB, _cCodeBuffer, 1), 29, 0x83, 0xFB);
- deinitTalkObject(29);
- enterNewScene(33, 6, 0, 0, 0);
- }
- }
- }
-
- int inputFlag = checkInput(_buttonList, true);
- removeInputTop();
-
- update();
-
- if (inputFlag == 198 || inputFlag == 199) {
- _unk3 = _handItemSet;
- handleInput(_mouseX, _mouseY);
- }
-
- //if (queryGameFlag(0x1EE) && inputFlag)
- // sub_13B19(inputFlag);
-
- _system->delayMillis(10);
- }
-}
-
-void KyraEngine_v2::handleInput(int x, int y) {
- setNextIdleAnimTimer();
- if (_unk5) {
- _unk5 = 0;
- return;
- }
-
- if (!_screen->isMouseVisible())
- return;
-
- if (_unk3 == -2) {
- snd_playSoundEffect(13);
- return;
- }
-
- setNextIdleAnimTimer();
-
- if (x <= 6 || x >= 312 || y <= 6 || y >= 135) {
- bool exitOk = false;
- assert(_unk3 + 6 >= 0);
- switch (_unk3 + 6) {
- case 0:
- if (_sceneExit1 != 0xFFFF)
- exitOk = true;
- break;
-
- case 1:
- if (_sceneExit2 != 0xFFFF)
- exitOk = true;
- break;
-
- case 2:
- if (_sceneExit3 != 0xFFFF)
- exitOk = true;
- break;
-
- case 3:
- if (_sceneExit4 != 0xFFFF)
- exitOk = true;
- break;
-
- default:
- break;
- }
-
- if (exitOk) {
- inputSceneChange(x, y, 1, 1);
- return;
- }
- }
-
- if (checkCharCollision(x, y) >= 0 && _unk3 >= -1) {
- runSceneScript2();
- return;
- } else if (pickUpItem(x, y)) {
- return;
- } else {
- int skipHandling = 0;
-
- if (checkItemCollision(x, y) == -1) {
- resetGameFlag(0x1EF);
- skipHandling = handleInputUnkSub(x, y) ? 1 : 0;
-
- if (queryGameFlag(0x1EF)) {
- resetGameFlag(0x1EF);
- return;
- }
-
- if (_unk5) {
- _unk5 = 0;
- return;
- }
- }
-
- if (_deathHandler > -1)
- skipHandling = 1;
-
- if (skipHandling)
- return;
-
- if (checkCharCollision(x, y) >= 0) {
- runSceneScript2();
- return;
- }
-
- if (_itemInHand >= 0) {
- if (y > 136)
- return;
-
- dropItem(0, _itemInHand, x, y, 1);
- } else {
- if (_unk3 == -2 || y > 135)
- return;
-
- if (!_unk5) {
- inputSceneChange(x, y, 1, 1);
- return;
- }
-
- _unk5 = 0;
- }
- }
-}
-
-bool KyraEngine_v2::handleInputUnkSub(int x, int y) {
- if (y > 143 || _deathHandler > -1 || queryGameFlag(0x164))
- return false;
-
- if (_handItemSet <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) {
- updateCharFacing();
- objectChat(getTableString(0xFC, _cCodeBuffer, 1), 0, 0x83, 0xFC);
- return true;
- } else {
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
-
- _sceneScriptState.regs[1] = x;
- _sceneScriptState.regs[2] = y;
- _sceneScriptState.regs[3] = 0;
- _sceneScriptState.regs[4] = _itemInHand;
-
- _scriptInterpreter->startScript(&_sceneScriptState, 1);
-
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-
- //XXXsys_unkKeyboad (flush? wait? whatever...)
-
- if (queryGameFlag(0x1ED)) {
- _sound->beginFadeOut();
- _screen->fadeToBlack();
- _showCredits = true;
- _runFlag = false;
- }
- return _sceneScriptState.regs[3] != 0;
- }
-}
-
-void KyraEngine_v2::update() {
- updateInput();
-
- refreshAnimObjectsIfNeed();
- updateMouse();
- updateSpecialSceneScripts();
- _timer->update();
- updateItemAnimations();
- updateInvWsa();
- fadeMessagePalette();
- _screen->updateScreen();
-}
-
-void KyraEngine_v2::updateWithText() {
- updateInput();
-
- updateMouse();
- fadeMessagePalette();
- updateSpecialSceneScripts();
- _timer->update();
- updateItemAnimations();
- updateInvWsa();
- restorePage3();
- drawAnimObjects();
-
- if (textEnabled() && _chatText) {
- int pageBackUp = _screen->_curPage;
- _screen->_curPage = 2;
- objectChatPrintText(_chatText, _chatObject);
- _screen->_curPage = pageBackUp;
- }
-
- refreshAnimObjects(0);
- _screen->updateScreen();
+ _debugger = 0;
+ _screenBuffer = 0;
}
-void KyraEngine_v2::updateMouse() {
- int shapeIndex = 0;
- int type = 0;
- int xOffset = 0, yOffset = 0;
- Common::Point mouse = getMousePos();
-
- if (mouse.y <= 145) {
- if (mouse.x <= 6) {
- if (_sceneExit4 != 0xFFFF) {
- type = -3;
- shapeIndex = 4;
- xOffset = 1;
- yOffset = 5;
- } else {
- type = -2;
- }
- } else if (mouse.x >= 312) {
- if (_sceneExit2 != 0xFFFF) {
- type = -5;
- shapeIndex = 2;
- xOffset = 7;
- yOffset = 5;
- } else {
- type = -2;
- }
- } else if (mouse.y >= 135) {
- if (_sceneExit3 != 0xFFFF) {
- type = -4;
- shapeIndex = 3;
- xOffset = 5;
- yOffset = 10;
- } else {
- type = -2;
- }
- } else if (mouse.y <= 6) {
- if (_sceneExit1 != 0xFFFF) {
- type = -6;
- shapeIndex = 1;
- xOffset = 5;
- yOffset = 1;
- } else {
- type = -2;
- }
- }
- }
-
- for (int i = 0; i < _specialExitCount; ++i) {
- if (checkSpecialSceneExit(i, mouse.x, mouse.y)) {
- switch (_specialExitTable[20+i]) {
- case 0:
- type = -6;
- shapeIndex = 1;
- xOffset = 5;
- yOffset = 1;
- break;
-
- case 2:
- type = -5;
- shapeIndex = 2;
- xOffset = 7;
- yOffset = 5;
- break;
-
- case 4:
- type = -4;
- shapeIndex = 3;
- xOffset = 5;
- yOffset = 7;
- break;
-
- case 6:
- type = -3;
- shapeIndex = 4;
- xOffset = 1;
- yOffset = 5;
- break;
-
- default:
- break;
- }
- }
- }
-
- if (type == -2) {
- shapeIndex = 5;
- xOffset = 5;
- yOffset = 9;
- }
-
- if (type != 0 && _handItemSet != type && _screen->isMouseVisible()) {
- _mouseState = _handItemSet = type;
- _screen->hideMouse();
- _screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex));
- _screen->showMouse();
- }
-
- if (type == 0 && _handItemSet != _itemInHand && _screen->isMouseVisible()) {
- if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) {
- _mouseState = 0;
- _handItemSet = _itemInHand;
- _screen->hideMouse();
- if (_itemInHand == -1)
- _screen->setMouseCursor(0, 0, getShapePtr(0));
- else
- _screen->setMouseCursor(8, 15, getShapePtr(_itemInHand+64));
- _screen->showMouse();
- }
+KyraEngine_v2::~KyraEngine_v2() {
+ for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
+ delete[] i->_value;
+ i->_value = 0;
}
-}
+ _gameShapes.clear();
-void KyraEngine_v2::updateInput() {
- Common::Event event;
+ delete[] _itemList;
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_QUIT:
- _quitFlag = true;
- break;
+ _emc->unload(&_sceneScriptData);
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
- _eventList.push_back(Event(event, true));
- else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
- _quitFlag = true;
- else
- _eventList.push_back(event);
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- _eventList.push_back(Event(event, true));
- break;
+ delete[] _animObjects;
- case Common::EVENT_LBUTTONUP:
- case Common::EVENT_MOUSEMOVE:
- _eventList.push_back(event);
- break;
+ for (Common::Array<const Opcode*>::iterator i = _opcodesAnimation.begin(); i != _opcodesAnimation.end(); ++i)
+ delete *i;
+ _opcodesAnimation.clear();
- default:
- break;
- }
- }
+ delete _debugger;
+ delete[] _screenBuffer;
}
int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::checkInput(%p, %d)", (const void*)buttonList, mainLoop);
updateInput();
int keys = 0;
@@ -825,7 +124,6 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
Common::Point pos = getMousePos();
_mouseX = pos.x;
_mouseY = pos.y;
- _screen->updateScreen();
} break;
case Common::EVENT_LBUTTONDOWN:
@@ -833,7 +131,7 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
Common::Point pos = getMousePos();
_mouseX = pos.x;
_mouseY = pos.y;
- keys = event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800);
+ keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800));
breakLoop = true;
} break;
@@ -850,7 +148,43 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
_eventList.erase(_eventList.begin());
}
- return _gui->processButtonList(buttonList, keys | 0x8000);
+ return gui_v2()->processButtonList(buttonList, keys | 0x8000);
+}
+
+void KyraEngine_v2::updateInput() {
+ Common::Event event;
+
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _quitFlag = true;
+ break;
+
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
+ _eventList.push_back(Event(event, true));
+ else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
+ _quitFlag = true;
+ else
+ _eventList.push_back(event);
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ _eventList.push_back(Event(event, true));
+ break;
+
+ case Common::EVENT_MOUSEMOVE:
+ screen_v2()->updateScreen();
+ // fall through
+
+ case Common::EVENT_LBUTTONUP:
+ _eventList.push_back(event);
+ break;
+
+ default:
+ break;
+ }
+ }
}
void KyraEngine_v2::removeInputTop() {
@@ -878,625 +212,54 @@ void KyraEngine_v2::resetSkipFlag(bool removeEvent) {
}
}
-void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) {
- uint32 start = _system->getMillis();
- do {
- if (updateGame) {
- if (_chatText)
- updateWithText();
- else
- update();
- } else {
- updateInput();
- }
-
- if (amount > 0)
- _system->delayMillis(amount > 10 ? 10 : amount);
- } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
-}
-
-void KyraEngine_v2::cleanup() {
- delete [] _inventoryButtons; _inventoryButtons = 0;
-
- delete [] _gamePlayBuffer; _gamePlayBuffer = 0;
- delete [] _unkBuf500Bytes; _unkBuf500Bytes = 0;
- delete [] _screenBuffer; _screenBuffer = 0;
- delete [] _unkBuf200kByte; _unkBuf200kByte = 0;
-
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
-
- for (int i = 0; i < ARRAYSIZE(_defaultShapeTable); ++i) {
- delete [] _defaultShapeTable[i];
- _defaultShapeTable[i] = 0;
- }
- freeSceneShapePtrs();
-
- if (_optionsBuffer != _cCodeBuffer)
- delete [] _optionsBuffer;
- _optionsBuffer = 0;
- delete [] _cCodeBuffer; _cCodeBuffer = 0;
- delete [] _chapterBuffer; _chapterBuffer = 0;
-
- delete [] _talkObjectList; _talkObjectList = 0;
- delete [] _shapeDescTable; _shapeDescTable = 0;
-
- delete [] _gfxBackUpRect; _gfxBackUpRect = 0;
-
- delete [] _sceneList; _sceneList = 0;
-
- for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) {
- delete _sceneAnimMovie[i];
- _sceneAnimMovie[i] = 0;
- }
- for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i) {
- delete _wsaSlots[i];
- _wsaSlots[i] = 0;
- }
- for (int i = 0; i < ARRAYSIZE(_buttonShapes); ++i) {
- delete [] _buttonShapes[i];
- _buttonShapes[i] = 0;
- }
-}
-
-#pragma mark - Localization
-
-void KyraEngine_v2::loadCCodeBuffer(const char *file) {
- char tempString[13];
- strcpy(tempString, file);
- changeFileExtension(tempString);
-
- delete [] _cCodeBuffer;
- _cCodeBuffer = _res->fileData(tempString, 0);
-}
-
-void KyraEngine_v2::loadOptionsBuffer(const char *file) {
- char tempString[13];
- strcpy(tempString, file);
- changeFileExtension(tempString);
-
- delete [] _optionsBuffer;
- _optionsBuffer = _res->fileData(tempString, 0);
-}
-
-void KyraEngine_v2::loadChapterBuffer(int chapter) {
- char tempString[14];
-
- static const char *chapterFilenames[] = {
- "CH1.XXX", "CH2.XXX", "CH3.XXX", "CH4.XXX", "CH5.XXX"
- };
-
- assert(chapter >= 1 && chapter <= ARRAYSIZE(chapterFilenames));
- strcpy(tempString, chapterFilenames[chapter-1]);
- changeFileExtension(tempString);
-
- delete [] _chapterBuffer;
- _chapterBuffer = _res->fileData(tempString, 0);
- _currentChapter = chapter;
-}
-
-void KyraEngine_v2::changeFileExtension(char *buffer) {
- while (*buffer != '.')
- ++buffer;
-
- ++buffer;
- strcpy(buffer, _languageExtension[_lang]);
-}
-
-uint8 *KyraEngine_v2::getTableEntry(uint8 *buffer, int id) {
- return buffer + READ_LE_UINT16(buffer + (id<<1));
-}
-
-char *KyraEngine_v2::getTableString(int id, uint8 *buffer, int decode) {
- char *string = (char*)getTableEntry(buffer, id);
-
- if (decode && _flags.lang != Common::JA_JPN) {
- decodeString1(string, _internStringBuf);
- decodeString2(_internStringBuf, _internStringBuf);
- string = _internStringBuf;
- }
-
- return string;
-}
-
-const char *KyraEngine_v2::getChapterString(int id) {
- if (_currentChapter != _newChapterFile)
- loadChapterBuffer(_newChapterFile);
-
- return getTableString(id, _chapterBuffer, 1);
-}
-
-int KyraEngine_v2::decodeString1(const char *src, char *dst) {
- static const uint8 decodeTable1[] = {
- 0x20, 0x65, 0x74, 0x61, 0x69, 0x6E, 0x6F, 0x73, 0x72, 0x6C, 0x68,
- 0x63, 0x64, 0x75, 0x70, 0x6D
- };
-
- static const uint8 decodeTable2[] = {
- 0x74, 0x61, 0x73, 0x69, 0x6F, 0x20, 0x77, 0x62, 0x20, 0x72, 0x6E,
- 0x73, 0x64, 0x61, 0x6C, 0x6D, 0x68, 0x20, 0x69, 0x65, 0x6F, 0x72,
- 0x61, 0x73, 0x6E, 0x72, 0x74, 0x6C, 0x63, 0x20, 0x73, 0x79, 0x6E,
- 0x73, 0x74, 0x63, 0x6C, 0x6F, 0x65, 0x72, 0x20, 0x64, 0x74, 0x67,
- 0x65, 0x73, 0x69, 0x6F, 0x6E, 0x72, 0x20, 0x75, 0x66, 0x6D, 0x73,
- 0x77, 0x20, 0x74, 0x65, 0x70, 0x2E, 0x69, 0x63, 0x61, 0x65, 0x20,
- 0x6F, 0x69, 0x61, 0x64, 0x75, 0x72, 0x20, 0x6C, 0x61, 0x65, 0x69,
- 0x79, 0x6F, 0x64, 0x65, 0x69, 0x61, 0x20, 0x6F, 0x74, 0x72, 0x75,
- 0x65, 0x74, 0x6F, 0x61, 0x6B, 0x68, 0x6C, 0x72, 0x20, 0x65, 0x69,
- 0x75, 0x2C, 0x2E, 0x6F, 0x61, 0x6E, 0x73, 0x72, 0x63, 0x74, 0x6C,
- 0x61, 0x69, 0x6C, 0x65, 0x6F, 0x69, 0x72, 0x61, 0x74, 0x70, 0x65,
- 0x61, 0x6F, 0x69, 0x70, 0x20, 0x62, 0x6D
- };
-
- int size = 0;
- uint cChar = 0;
- while ((cChar = *src++) != 0) {
- if (cChar & 0x80) {
- cChar &= 0x7F;
- int index = (cChar & 0x78) >> 3;
- *dst++ = decodeTable1[index];
- ++size;
- assert(cChar < sizeof(decodeTable2));
- cChar = decodeTable2[cChar];
- }
-
- *dst++ = cChar;
- ++size;
- }
-
- *dst++ = 0;
- return size;
-}
-
-void KyraEngine_v2::decodeString2(const char *src, char *dst) {
- if (!src || !dst)
- return;
-
- char out = 0;
- while ((out = *src) != 0) {
- if (*src == 0x1B) {
- ++src;
- out = *src + 0x7F;
- }
- *dst++ = out;
- ++src;
- }
-
- *dst = 0;
-}
-
-#pragma mark -
-
-void KyraEngine_v2::showMessageFromCCode(int id, int16 palIndex, int) {
- const char *string = getTableString(id, _cCodeBuffer, 1);
- showMessage(string, palIndex);
-}
-
-void KyraEngine_v2::showMessage(const char *string, int16 palIndex) {
- _shownMessage = string;
- _screen->hideMouse();
- _screen->fillRect(0, 190, 319, 199, 0xCF);
-
- if (string) {
- if (palIndex != -1 || _fadeMessagePalette) {
- palIndex *= 3;
- memcpy(_messagePal, _screen->_currentPalette + palIndex, 3);
- memmove(_screen->_currentPalette + 765, _screen->_currentPalette + palIndex, 3);
- _screen->setScreenPalette(_screen->_currentPalette);
- }
-
- int x = _text->getCenterStringX(string, 0, 320);
- _text->printText(string, x, 190, 255, 207, 0);
-
- setTimer1DelaySecs(7);
- }
-
- _fadeMessagePalette = false;
- _screen->showMouse();
-}
-
-void KyraEngine_v2::showChapterMessage(int id, int16 palIndex) {
- showMessage(getChapterString(id), palIndex);
-}
-
-void KyraEngine_v2::updateCommandLineEx(int str1, int str2, int16 palIndex) {
- char buffer[0x51];
- char *src = buffer;
-
- strcpy(src, getTableString(str1, _cCodeBuffer, 1));
-
- if (_flags.lang != Common::JA_JPN) {
- while (*src != 0x20)
- ++src;
- ++src;
- *src = toupper(*src);
- }
-
- strcpy((char*)_unkBuf500Bytes, src);
-
- if (str2 > 0) {
- if (_flags.lang != Common::JA_JPN)
- strcat((char*)_unkBuf500Bytes, " ");
- strcat((char*)_unkBuf500Bytes, getTableString(str2, _cCodeBuffer, 1));
- }
-
- showMessage((char*)_unkBuf500Bytes, palIndex);
-}
-
-void KyraEngine_v2::fadeMessagePalette() {
- if (!_fadeMessagePalette)
- return;
-
- bool updatePalette = false;
- for (int i = 0; i < 3; ++i) {
- if (_messagePal[i] >= 4) {
- _messagePal[i] -= 4;
- updatePalette = true;
- } else if (_messagePal[i] != 0) {
- _messagePal[i] = 0;
- updatePalette = true;
- }
- }
-
- if (updatePalette) {
- memcpy(_screen->getPalette(0) + 765, _messagePal, 3);
- _screen->setScreenPalette(_screen->getPalette(0));
- } else {
- _fadeMessagePalette = false;
- }
-}
-
-#pragma mark -
-
-void KyraEngine_v2::loadMouseShapes() {
- _screen->loadBitmap("_MOUSE.CSH", 3, 3, 0);
-
- for (int i = 0; i <= 8; ++i) {
- _defaultShapeTable[i] = _screen->makeShapeCopy(_screen->getCPagePtr(3), i);
- assert(_defaultShapeTable[i]);
- }
-}
-
-void KyraEngine_v2::loadItemShapes() {
- _screen->loadBitmap("_ITEMS.CSH", 3, 3, 0);
-
- for (int i = 64; i <= 239; ++i) {
- _defaultShapeTable[i] = _screen->makeShapeCopy(_screen->getCPagePtr(3), i-64);
- assert(_defaultShapeTable[i]);
- }
-
- _res->loadFileToBuf("_ITEMHT.DAT", _itemHtDat, sizeof(_itemHtDat));
- assert(_res->getFileSize("_ITEMHT.DAT") == sizeof(_itemHtDat));
-
- _screen->_curPage = 0;
-}
-
-void KyraEngine_v2::loadZShapes(int shapes) {
- char file[10];
- strcpy(file, "_ZX.SHP");
-
- _loadedZTable = shapes;
- file[2] = '0' + shapes;
-
- uint8 *data = _res->fileData(file, 0);
- for (int i = 9; i <= 32; ++i) {
- delete [] _defaultShapeTable[i];
- _defaultShapeTable[i] = _screen->makeShapeCopy(data, i-9);
- assert(_defaultShapeTable[i]);
- }
- delete [] data;
-
- _loadedZTable = shapes;
-}
-
-void KyraEngine_v2::loadInventoryShapes() {
- int curPageBackUp = _screen->_curPage;
- _screen->_curPage = 2;
-
- _screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
-
- for (int i = 0; i < 10; ++i) {
- _defaultShapeTable[240+i] = _screen->encodeShape(_inventoryX[i], _inventoryY[i], 16, 16, 0);
- assert(_defaultShapeTable[240+i]);
- }
-
- _screen->_curPage = curPageBackUp;
-}
-
-void KyraEngine_v2::runStartScript(int script, int unk1) {
- char filename[14];
- strcpy(filename, "_START0X.EMC");
- filename[7] = script + '0';
-
- ScriptData scriptData;
- ScriptState scriptState;
-
- _scriptInterpreter->loadScript(filename, &scriptData, &_opcodes);
- _scriptInterpreter->initScript(&scriptState, &scriptData);
- scriptState.regs[6] = unk1;
- _scriptInterpreter->startScript(&scriptState, 0);
- while (_scriptInterpreter->validScript(&scriptState))
- _scriptInterpreter->runScript(&scriptState);
- _scriptInterpreter->unloadScript(&scriptData);
-}
-
-void KyraEngine_v2::loadNPCScript() {
- char filename[12];
- strcpy(filename, "_NPC.EMC");
-
- if (_flags.platform != Common::kPlatformPC || _flags.isTalkie) {
- switch (_lang) {
- case 0:
- filename[5] = 'E';
- break;
-
- case 1:
- filename[5] = 'F';
- break;
-
- case 2:
- filename[5] = 'G';
- break;
-
- case 3:
- filename[5] = 'J';
- break;
-
- default:
- break;
- };
- }
-
- _scriptInterpreter->loadScript(filename, &_npcScriptData, &_opcodes);
-}
-
-void KyraEngine_v2::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
- memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData));
- memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState));
-
- if (!_scriptInterpreter->loadScript(filename, &_temporaryScriptData, &_opcodesTemporary))
- error("Couldn't load temporary script '%s'", filename);
-
- _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
- _scriptInterpreter->startScript(&_temporaryScriptState, 0);
-
- _newShapeFlag = -1;
-
- if (_newShapeFiledata && newShapes) {
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
- }
-
- while (_scriptInterpreter->validScript(&_temporaryScriptState))
- _scriptInterpreter->runScript(&_temporaryScriptState);
-
- uint8 *fileData = 0;
-
- if (newShapes)
- _newShapeFiledata = _res->fileData(_newShapeFilename, 0);
-
- fileData = _newShapeFiledata;
-
- if (!fileData) {
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
- return;
- }
-
- if (newShapes)
- _newShapeCount = initNewShapes(fileData);
-
- processNewShapes(allowSkip, resetChar);
-
- if (shapeUnload) {
- resetNewShapes(_newShapeCount, fileData);
- _newShapeCount = 0;
- _newShapeFiledata = 0;
- }
-
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::resetScaleTable() {
- Common::set_to(_scaleTable, _scaleTable + ARRAYSIZE(_scaleTable), 0x100);
-}
-
-void KyraEngine_v2::setScaleTableItem(int item, int data) {
- if (item >= 1 || item <= 15)
- _scaleTable[item-1] = (data << 8) / 100;
-}
-
-int KyraEngine_v2::getScale(int x, int y) {
- return _scaleTable[_screen->getLayer(x, y) - 1];
-}
-
-void KyraEngine_v2::setDrawLayerTableEntry(int entry, int data) {
- if (entry >= 1 || entry <= 15)
- _drawLayerTable[entry-1] = data;
-}
-
-int KyraEngine_v2::getDrawLayer(int x, int y) {
- int layer = _screen->getLayer(x, y);
- layer = _drawLayerTable[layer-1];
- if (layer < 0)
- layer = 0;
- else if (layer >= 7)
- layer = 6;
- return layer;
-}
-
-void KyraEngine_v2::restorePage3() {
- _screen->copyBlockToPage(2, 0, 0, 320, 144, _gamePlayBuffer);
-}
-
-void KyraEngine_v2::backUpPage0() {
- if (_screenBuffer) {
- _screen->hideMouse();
- memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000);
- _screen->showMouse();
- }
-}
-
-void KyraEngine_v2::restorePage0() {
- restorePage3();
- if (_screenBuffer)
- _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer);
+bool KyraEngine_v2::checkSpecialSceneExit(int num, int x, int y) {
+ if (_specialExitTable[0+num] > x || _specialExitTable[5+num] > y ||
+ _specialExitTable[10+num] < x || _specialExitTable[15+num] < y)
+ return false;
+ return true;
}
-void KyraEngine_v2::updateCharPal(int unk1) {
- static bool unkVar1 = false;
-
- if (!_useCharPal)
- return;
-
- int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1);
- int palEntry = _charPalTable[layer];
-
- if (palEntry != _charPalEntry && unk1) {
- const uint8 *src = &_scenePal[(palEntry << 4) * 3];
- uint8 *ptr = _screen->getPalette(0) + 336;
- for (int i = 0; i < 48; ++i) {
- *ptr -= (*ptr - *src) >> 1;
- ++ptr;
- ++src;
- }
- _screen->setScreenPalette(_screen->getPalette(0));
- unkVar1 = true;
- _charPalEntry = palEntry;
- } else if (unkVar1 || !unk1) {
- memcpy(_screen->getPalette(0) + 336, &_scenePal[(palEntry << 4) * 3], 48);
- _screen->setScreenPalette(_screen->getPalette(0));
- unkVar1 = false;
- }
+void KyraEngine_v2::addShapeToPool(const uint8 *data, int realIndex, int shape) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d, %d)", data, realIndex, shape);
+ remShapeFromPool(realIndex);
+ _gameShapes[realIndex] = screen_v2()->makeShapeCopy(data, shape);
+ assert(_gameShapes[realIndex]);
}
-void KyraEngine_v2::setCharPalEntry(int entry, int value) {
- if (entry > 15 || entry < 1)
- entry = 1;
- if (value > 8 || value < 0)
- value = 0;
- _charPalTable[entry] = value;
- _useCharPal = 1;
- _charPalEntry = 0;
+void KyraEngine_v2::addShapeToPool(uint8 *shpData, int index) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d)", shpData, index);
+ remShapeFromPool(index);
+ _gameShapes[index] = shpData;
+ assert(_gameShapes[index]);
}
-int KyraEngine_v2::inputSceneChange(int x, int y, int unk1, int unk2) {
- bool refreshNPC = false;
- uint16 curScene = _mainCharacter.sceneId;
- _pathfinderFlag = 15;
-
- if (!_unkHandleSceneChangeFlag) {
- if (_unk3 == -3) {
- if (_sceneList[curScene].exit4 != 0xFFFF) {
- x = 4;
- y = _sceneEnterY4;
- _pathfinderFlag = 7;
- }
- } else if (_unk3 == -5) {
- if (_sceneList[curScene].exit2 != 0xFFFF) {
- x = 316;
- y = _sceneEnterY2;
- _pathfinderFlag = 7;
- }
- } else if (_unk3 == -6) {
- if (_sceneList[curScene].exit1 != 0xFFFF) {
- x = _sceneEnterX1;
- y = _sceneEnterY1 - 2;
- _pathfinderFlag = 14;
- }
- } else if (_unk3 == -4) {
- if (_sceneList[curScene].exit3 != 0xFFFF) {
- x = _sceneEnterX3;
- y = 147;
- _pathfinderFlag = 11;
- }
- }
- }
-
- int strId = 0;
- int vocH = _flags.isTalkie ? 131 : -1;
-
- if (_pathfinderFlag) {
- if (findItem(curScene, 13) >= 0 && _unk3 <= -3) {
- strId = 252;
- } else if (_itemInHand == 72) {
- strId = 257;
- } else if (findItem(curScene, 72) >= 0 && _unk3 <= -3) {
- strId = 256;
- } else if (getInventoryItemSlot(72) != -1 && _unk3 <= -3) {
- strId = 257;
- }
- }
-
- if (strId) {
- updateCharFacing();
- objectChat(getTableString(strId, _cCodeBuffer, 1), 0, vocH, strId);
- _pathfinderFlag = 0;
- return 0;
- }
-
- if (ABS(_mainCharacter.x1 - x) < 4 && ABS(_mainCharacter.y1 - y) < 2) {
- _pathfinderFlag = 0;
- return 0;
- }
-
- int curX = _mainCharacter.x1 & ~3;
- int curY = _mainCharacter.y1 & ~1;
- int dstX = x & ~3;
- int dstY = y & ~1;
-
- int wayLength = findWay(curX, curY, dstX, dstY, _movFacingTable, 600);
- _pathfinderFlag = 0;
- _timer->disable(5);
-
- if (wayLength != 0 && wayLength != 0x7D00)
- refreshNPC = (trySceneChange(_movFacingTable, unk1, unk2) != 0);
-
- int charLayer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1);
- if (_layerFlagTable[charLayer] != 0 && !queryGameFlag(0x163)) {
- if (queryGameFlag(0x164)) {
- _screen->hideMouse();
- _timer->disable(5);
- runTemporaryScript("_ZANBURN.EMC", 0, 1, 1, 0);
- _deathHandler = 7;
- snd_playWanderScoreViaMap(0x53, 1);
- } else {
- objectChat(getTableString(0xFD, _cCodeBuffer, 1), 0, 0x83, 0xFD);
- setGameFlag(0x164);
- _timer->enable(5);
- _timer->setCountdown(5, 120);
- }
- } else if (queryGameFlag(0x164)) {
- objectChat(getTableString(0xFE, _cCodeBuffer, 1), 0, 0x83, 0xFE);
- resetGameFlag(0x164);
- _timer->disable(5);
+void KyraEngine_v2::remShapeFromPool(int idx) {
+ ShapeMap::iterator iter = _gameShapes.find(idx);
+ if (iter != _gameShapes.end()) {
+ delete [] iter->_value;
+ iter->_value = 0;
}
-
- if (refreshNPC)
- enterNewSceneUnk2(0);
-
- _pathfinderFlag = 0;
- return refreshNPC;
}
-bool KyraEngine_v2::checkSpecialSceneExit(int num, int x, int y) {
- if (_specialExitTable[0+num] > x || _specialExitTable[5+num] > y ||
- _specialExitTable[10+num] < x || _specialExitTable[15+num] < y)
+uint8 *KyraEngine_v2::getShapePtr(int shape) const {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::getShapePtr(%d)", shape);
+ ShapeMap::iterator iter = _gameShapes.find(shape);
+ if (iter == _gameShapes.end())
return 0;
- return 1;
+ return iter->_value;
}
void KyraEngine_v2::moveCharacter(int facing, int x, int y) {
- _mainCharacter.facing = facing;
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::moveCharacter(%d, %d, %d)", facing, x, y);
x &= ~3;
y &= ~1;
+ _mainCharacter.facing = facing;
- _screen->hideMouse();
+ Screen *scr = screen();
+ scr->hideMouse();
switch (facing) {
case 0:
- while (y < _mainCharacter.y1)
+ while (_mainCharacter.y1 > y)
updateCharPosWithUpdate();
break;
@@ -1506,7 +269,7 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) {
break;
case 4:
- while (y > _mainCharacter.y1)
+ while (_mainCharacter.y1 < y)
updateCharPosWithUpdate();
break;
@@ -1518,815 +281,25 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) {
default:
break;
}
-
- _screen->showMouse();
-}
-
-int KyraEngine_v2::updateCharPos(int *table) {
- static uint32 nextUpdate = 0;
- static const int updateX[] = { 0, 4, 4, 4, 0, -4, -4, -4 };
- static const int updateY[] = { -2, -2, 0, 2, 2, 2, 0, -2 };
-
- if (_system->getMillis() < nextUpdate)
- return 0;
-
- int facing = _mainCharacter.facing;
- _mainCharacter.x1 += updateX[facing];
- _mainCharacter.y1 += updateY[facing];
- updateCharAnimFrame(0, table);
- nextUpdate = _system->getMillis() + _timer->getDelay(0) * _tickLength;
- return 1;
+ scr->showMouse();
}
void KyraEngine_v2::updateCharPosWithUpdate() {
- updateCharPos(0);
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::updateCharPosWithUpdate()");
+ updateCharPos(0, 0);
update();
}
-void KyraEngine_v2::updateCharAnimFrame(int charId, int *table) {
- static int unkTable1[] = { 0, 0 };
- static const int unkTable2[] = { 17, 0 };
- static const int unkTable3[] = { 10, 0 };
- static const int unkTable4[] = { 24, 0 };
- static const int unkTable5[] = { 19, 0 };
- static const int unkTable6[] = { 21, 0 };
- static const int unkTable7[] = { 31, 0 };
- static const int unkTable8[] = { 26, 0 };
-
- Character *character = &_mainCharacter;
- ++character->animFrame;
-
- int facing = character->facing;
-
- if (table) {
- if (table[0] != table[-1] && table[-1] == table[1]) {
- facing = getOppositeFacingDirection(table[-1]);
- table[0] = table[-1];
- }
- }
-
- if (!facing) {
- ++unkTable1[charId];
- } else if (facing == 4) {
- ++unkTable1[charId+1];
- } else if (facing == 7 || facing == 1 || facing == 5 || facing == 3) {
- if (facing == 7 || facing == 1) {
- if (unkTable1[charId] > 2)
- facing = 0;
- } else {
- if (unkTable1[charId+1] > 2)
- facing = 4;
- }
-
- unkTable1[charId] = 0;
- unkTable1[charId+1] = 0;
- }
-
- if (facing == 0) {
- if (character->animFrame < unkTable8[charId])
- character->animFrame = unkTable8[charId];
-
- if (character->animFrame > unkTable7[charId])
- character->animFrame = unkTable8[charId];
- } else if (facing == 4) {
- if (character->animFrame < unkTable5[charId])
- character->animFrame = unkTable5[charId];
-
- if (character->animFrame > unkTable4[charId])
- character->animFrame = unkTable5[charId];
- } else {
- if (character->animFrame > unkTable5[charId])
- character->animFrame = unkTable6[charId];
-
- if (character->animFrame == unkTable2[charId])
- character->animFrame = unkTable3[charId];
-
- if (character->animFrame > unkTable2[charId])
- character->animFrame = unkTable3[charId] + 2;
- }
-
- updateCharacterAnim(charId);
-}
-
-int KyraEngine_v2::checkCharCollision(int x, int y) {
- int scale1 = 0, scale2 = 0, scale3 = 0;
- int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
- scale1 = getScale(_mainCharacter.x1, _mainCharacter.y1);
- scale2 = (scale1 * 24) >> 8;
- scale3 = (scale1 * 48) >> 8;
-
- x1 = _mainCharacter.x1 - (scale2 >> 1);
- x2 = _mainCharacter.x1 + (scale2 >> 1);
- y1 = _mainCharacter.y1 - scale3;
- y2 = _mainCharacter.y1;
-
- if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
+int KyraEngine_v2::updateCharPos(int *table, int force) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::updateCharPos(%p, %d)", (const void*)table, force);
+ if (_updateCharPosNextUpdate > _system->getMillis() && !force)
return 0;
-
- return -1;
-}
-
-int KyraEngine_v2::initNewShapes(uint8 *filedata) {
- const int lastEntry = MIN(_newShapeLastEntry, 31);
- for (int i = 0; i < lastEntry; ++i) {
- _defaultShapeTable[33+i] = _screen->getPtrToShape(filedata, i);
- ShapeDesc *desc = &_shapeDescTable[24+i];
- desc->xAdd = _newShapeXAdd;
- desc->yAdd = _newShapeYAdd;
- desc->width = _newShapeWidth;
- desc->height = _newShapeHeight;
- }
- return lastEntry;
-}
-
-void KyraEngine_v2::processNewShapes(int allowSkip, int resetChar) {
- setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
-
- _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
- _scriptInterpreter->startScript(&_temporaryScriptState, 1);
-
- resetSkipFlag();
-
- while (_scriptInterpreter->validScript(&_temporaryScriptState)) {
- _temporaryScriptExecBit = false;
- while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit)
- _scriptInterpreter->runScript(&_temporaryScriptState);
-
- if (_newShapeAnimFrame < 0)
- continue;
-
- _mainCharacter.animFrame = _newShapeAnimFrame + 33;
- updateCharacterAnim(0);
- if (_chatText)
- updateWithText();
- else
- update();
-
- uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
-
- while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
- if (_chatText)
- updateWithText();
- else
- update();
-
- delay(10);
- }
-
- if (skipFlag())
- resetSkipFlag();
- }
-
- if (resetChar) {
- if (_newShapeFlag >= 0) {
- _mainCharacter.animFrame = _newShapeFlag + 33;
- updateCharacterAnim(0);
- if (_chatText)
- updateWithText();
- else
- update();
- }
-
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- }
-
- _newShapeFlag = -1;
- resetCharacterAnimDim();
-}
-
-void KyraEngine_v2::resetNewShapes(int count, uint8 *filedata) {
- Common::set_to(_defaultShapeTable+33, _defaultShapeTable+33+count, (uint8*)0);
- delete [] filedata;
- setNextIdleAnimTimer();
-}
-
-void KyraEngine_v2::setNextIdleAnimTimer() {
- _nextIdleAnim = _system->getMillis() + _rnd.getRandomNumberRng(10, 15) * 60 * _tickLength;
-}
-
-void KyraEngine_v2::showIdleAnim() {
- static const uint8 scriptMinTable[] = {
- 0x00, 0x05, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, 0xFF, 0x00
- };
-
- static const uint8 scriptMaxTable[] = {
- 0x04, 0x06, 0x07, 0x08, 0x04, 0x09, 0x0A, 0x0B, 0xFF, 0x00
- };
-
- if (queryGameFlag(0x159) && _flags.isTalkie)
- return;
-
- static bool scriptAnimation = false;
- if (!scriptAnimation && _flags.isTalkie) {
- scriptAnimation = true;
- zanthRandomIdleChat();
- } else {
- scriptAnimation = false;
- if (_loadedZTable > 8)
- return;
-
- int scriptMin = scriptMinTable[_loadedZTable-1];
- int scriptMax = scriptMaxTable[_loadedZTable-1];
- int script = 0;
-
- if (scriptMin < scriptMax) {
- do {
- script = _rnd.getRandomNumberRng(scriptMin, scriptMax);
- } while (script == _lastIdleScript);
- } else {
- script = scriptMin;
- }
-
- runIdleScript(script);
- _lastIdleScript = script;
- }
-}
-
-void KyraEngine_v2::runIdleScript(int script) {
- if (script < 0 || script >= 12)
- script = 0;
-
- if (_mainCharacter.animFrame != 18) {
- setNextIdleAnimTimer();
- } else {
- // FIXME: move this to staticres.cpp?
- static const char *idleScriptFiles[] = {
- "_IDLHAIR.EMC", "_IDLDUST.EMC", "_IDLLEAN.EMC", "_IDLDIRT.EMC", "_IDLTOSS.EMC", "_IDLNOSE.EMC",
- "_IDLBRSH.EMC", "_Z3IDLE.EMC", "_Z4IDLE.EMC", "_Z6IDLE.EMC", "_Z7IDLE.EMC", "_Z8IDLE.EMC"
- };
-
- runTemporaryScript(idleScriptFiles[script], 1, 1, 1, 1);
- }
-}
-
-#pragma mark -
-
-void KyraEngine_v2::backUpGfxRect24x24(int x, int y) {
- _screen->copyRegionToBuffer(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect);
-}
-
-void KyraEngine_v2::restoreGfxRect24x24(int x, int y) {
- _screen->copyBlockToPage(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect);
-}
-
-void KyraEngine_v2::backUpGfxRect32x32(int x, int y) {
- _screen->copyRegionToBuffer(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
-}
-
-void KyraEngine_v2::restoreGfxRect32x32(int x, int y) {
- _screen->copyBlockToPage(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::openTalkFile(int newFile) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::openTalkFile(%d)", newFile);
- char talkFilename[16];
-
- if (_oldTalkFile > 0) {
- sprintf(talkFilename, "CH%dVOC.TLK", _oldTalkFile);
- _res->unloadPakFile(talkFilename);
- _oldTalkFile = -1;
- }
-
- if (newFile == 0) {
- strcpy(talkFilename, "ANYTALK.TLK");
- _res->loadPakFile(talkFilename);
- } else {
- sprintf(talkFilename, "CH%dVOC.TLK", newFile);
- _res->loadPakFile(talkFilename);
- }
-
- _oldTalkFile = newFile;
-}
-
-void KyraEngine_v2::snd_playVoiceFile(int id) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playVoiceFile(%d)", id);
- char vocFile[9];
- assert(id >= 0 && id <= 9999999);
- sprintf(vocFile, "%07d", id);
- if (_sound->voiceFileIsPresent(vocFile)) {
- snd_stopVoice();
-
- while (!_sound->voicePlay(vocFile)) {
- updateWithText();
- _system->delayMillis(10);
- }
-
- _speechFile = vocFile;
- }
-}
-
-void KyraEngine_v2::snd_loadSoundFile(int id) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_loadSoundFile(%d)", id);
- if (id < 0 || !_trackMap)
- return;
-
- assert(id < _trackMapSize);
- int file = _trackMap[id*2];
- _curSfxFile = _curMusicTheme = file;
- _sound->loadSoundFile(file);
-}
-
-void KyraEngine_v2::playVoice(int high, int low) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::playVoice(%d, %d)", high, low);
- if (!_flags.isTalkie)
- return;
- int vocFile = high * 10000 + low * 10;
- snd_playVoiceFile(vocFile);
-}
-
-void KyraEngine_v2::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playSoundEffect(%d)", track);
-
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
- if (track == 10)
- track = _lastSfxTrack;
-
- if (track == 10 || track == -1)
- return;
-
- _lastSfxTrack = track;
- }
-
- int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]);
- if (vocIndex != -1)
- _sound->voicePlay(_ingameSoundList[vocIndex], true);
- else if (_flags.platform == Common::kPlatformPC)
- // TODO ?? Maybe there is a way to let users select whether they want
- // voc, midi or adl sfx (even though it makes no sense to choose anything but voc).
- // For now this is used as a fallback only (if no voc file exists).
- KyraEngine::snd_playSoundEffect(track);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::loadInvWsa(const char *filename, int run, int delayTime, int page, int sfx, int sFrame, int flags) {
- int wsaFlags = 1;
- if (flags)
- wsaFlags |= 2;
-
- if (!_invWsa.wsa)
- _invWsa.wsa = new WSAMovieV2(this, _screen);
-
- if (!_invWsa.wsa->open(filename, wsaFlags, 0))
- error("Couldn't open inventory WSA file '%s'", filename);
-
- _invWsa.curFrame = 0;
- _invWsa.lastFrame = _invWsa.wsa->frames();
-
- _invWsa.x = _invWsa.wsa->xAdd();
- _invWsa.y = _invWsa.wsa->yAdd();
- _invWsa.w = _invWsa.wsa->width();
- _invWsa.h = _invWsa.wsa->height();
- _invWsa.x2 = _invWsa.x + _invWsa.w - 1;
- _invWsa.y2 = _invWsa.y + _invWsa.h - 1;
-
- _invWsa.delay = delayTime;
- _invWsa.page = page;
- _invWsa.sfx = sfx;
-
- _invWsa.specialFrame = sFrame;
-
- if (_invWsa.page)
- _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, 0, _invWsa.page, Screen::CR_NO_P_CHECK);
-
- _invWsa.running = true;
- _invWsa.timer = _system->getMillis();
-
- if (run) {
- while (_invWsa.running && !skipFlag() && !_quitFlag) {
- update();
- _system->delayMillis(10);
- }
-
- if (skipFlag()) {
- resetSkipFlag();
- displayInvWsaLastFrame();
- }
- }
-}
-
-void KyraEngine_v2::closeInvWsa() {
- _invWsa.wsa->close();
- delete _invWsa.wsa;
- _invWsa.wsa = 0;
- _invWsa.running = false;
-}
-
-void KyraEngine_v2::updateInvWsa() {
- if (!_invWsa.running || !_invWsa.wsa)
- return;
-
- if (_invWsa.timer > _system->getMillis())
- return;
-
- _invWsa.wsa->setX(0);
- _invWsa.wsa->setY(0);
- _invWsa.wsa->setDrawPage(_invWsa.page);
- _invWsa.wsa->displayFrame(_invWsa.curFrame, 0, 0, 0);
-
- if (_invWsa.page)
- _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
-
- _invWsa.timer = _system->getMillis() + _invWsa.delay * _tickLength;
-
- ++_invWsa.curFrame;
- if (_invWsa.curFrame >= _invWsa.lastFrame)
- displayInvWsaLastFrame();
-
- if (_invWsa.curFrame == _invWsa.specialFrame)
- snd_playSoundEffect(_invWsa.sfx);
-
- if (_invWsa.sfx == -2) {
- switch (_invWsa.curFrame) {
- case 9: case 27: case 40:
- snd_playSoundEffect(0x39);
- break;
-
- case 18: case 34: case 44:
- snd_playSoundEffect(0x33);
- break;
-
- case 48:
- snd_playSoundEffect(0x38);
- break;
-
- default:
- break;
- }
- }
-}
-
-void KyraEngine_v2::displayInvWsaLastFrame() {
- if (!_invWsa.wsa)
- return;
-
- _invWsa.wsa->setX(0);
- _invWsa.wsa->setY(0);
- _invWsa.wsa->setDrawPage(_invWsa.page);
- _invWsa.wsa->displayFrame(_invWsa.lastFrame-1, 0, 0, 0);
-
- if (_invWsa.page)
- _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
-
- closeInvWsa();
-
- int32 countdown = _rnd.getRandomNumberRng(45, 80);
- _timer->setCountdown(2, countdown * 60);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::setCauldronState(uint8 state, bool paletteFade) {
- memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
- Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL");
- if (!file)
- error("Couldn't load cauldron palette");
- file->seek(state*18, SEEK_SET);
- file->read(_screen->getPalette(2)+723, 18);
- delete file;
- file = 0;
-
- if (paletteFade) {
- snd_playSoundEffect((state == 0) ? 0x6B : 0x66);
- _screen->fadePalette(_screen->getPalette(2), 0x4B, &_updateFunctor);
- } else {
- _screen->setScreenPalette(_screen->getPalette(2));
- _screen->updateScreen();
- }
-
- memcpy(_screen->getPalette(0)+723, _screen->getPalette(2)+723, 18);
- _cauldronState = state;
- _cauldronUseCount = 0;
- //if (state == 5)
- // sub_27149();
-}
-
-void KyraEngine_v2::clearCauldronTable() {
- Common::set_to(_cauldronTable, _cauldronTable+ARRAYSIZE(_cauldronTable), -1);
-}
-
-void KyraEngine_v2::addFrontCauldronTable(int item) {
- for (int i = 23; i >= 0; --i)
- _cauldronTable[i+1] = _cauldronTable[i];
- _cauldronTable[0] = item;
-}
-
-void KyraEngine_v2::cauldronItemAnim(int item) {
- const int x = 282;
- const int y = 135;
- const int mouseDstX = (x + 7) & (~1);
- const int mouseDstY = (y + 15) & (~1);
- int mouseX = _mouseX & (~1);
- int mouseY = _mouseY & (~1);
-
- while (mouseY != mouseDstY) {
- if (mouseY < mouseDstY)
- mouseY += 2;
- else if (mouseY > mouseDstY)
- mouseY -= 2;
- uint32 waitEnd = _system->getMillis() + _tickLength;
- setMousePos(mouseX, mouseY);
- _system->updateScreen();
- delayUntil(waitEnd);
- }
-
- while (mouseX != mouseDstX) {
- if (mouseX < mouseDstX)
- mouseX += 2;
- else if (mouseX > mouseDstX)
- mouseX -= 2;
- uint32 waitEnd = _system->getMillis() + _tickLength;
- setMousePos(mouseX, mouseY);
- _system->updateScreen();
- delayUntil(waitEnd);
- }
-
- if (itemIsFlask(item)) {
- setHandItem(19);
- delayUntil(_system->getMillis()+_tickLength*30);
- setHandItem(18);
- } else {
- _screen->hideMouse();
- backUpGfxRect32x32(x, y);
- uint8 *shape = getShapePtr(item+64);
-
- int curY = y;
- for (int i = 0; i < 12; i += 2, curY += 2) {
- restoreGfxRect32x32(x, y);
- uint32 waitEnd = _system->getMillis() + _tickLength;
- _screen->drawShape(0, shape, x, curY, 0, 0);
- _screen->updateScreen();
- delayUntil(waitEnd);
- }
-
- snd_playSoundEffect(0x17);
-
- for (int i = 16; i > 0; i -= 2, curY += 2) {
- _screen->setNewShapeHeight(shape, i);
- restoreGfxRect32x32(x, y);
- uint32 waitEnd = _system->getMillis() + _tickLength;
- _screen->drawShape(0, shape, x, curY, 0, 0);
- _screen->updateScreen();
- delayUntil(waitEnd);
- }
-
- restoreGfxRect32x32(x, y);
- _screen->resetShapeHeight(shape);
- removeHandItem();
- _screen->showMouse();
- }
-}
-
-bool KyraEngine_v2::updateCauldron() {
- for (int i = 0; i < 23; ++i) {
- const int16 *curStateTable = _cauldronStateTables[i];
- if (*curStateTable == -2)
- continue;
-
- int cauldronState = i;
- int16 cauldronTable[25];
- memcpy(cauldronTable, _cauldronTable, sizeof(cauldronTable));
-
- while (*curStateTable != -2) {
- int stateValue = *curStateTable++;
- int j = 0;
- for (; j < 25; ++j) {
- int val = cauldronTable[j];
-
- switch (val) {
- case 68:
- val = 70;
- break;
-
- case 133:
- case 167:
- val = 119;
- break;
-
- case 130:
- case 143:
- case 100:
- val = 12;
- break;
-
- case 132:
- case 65:
- case 69:
- case 74:
- val = 137;
- break;
-
- case 157:
- val = 134;
- break;
-
- default:
- break;
- }
-
- if (val == stateValue) {
- cauldronTable[j] = -1;
- j = 26;
- }
- }
-
- if (j == 25)
- cauldronState = -1;
- }
-
- if (cauldronState >= 0) {
- showMessage(0, 0xCF);
- setCauldronState(cauldronState, true);
- if (cauldronState == 7)
- objectChat(getTableString(0xF2, _cCodeBuffer, 1), 0, 0x83, 0xF2);
- clearCauldronTable();
- return true;
- }
- }
-
- return false;
-}
-
-void KyraEngine_v2::cauldronRndPaletteFade() {
- showMessage(0, 0xCF);
- int index = _rnd.getRandomNumberRng(0x0F, 0x16);
- Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL");
- if (!file)
- error("Couldn't load cauldron palette");
- file->seek(index*18, SEEK_SET);
- file->read(_screen->getPalette(0)+723, 18);
- snd_playSoundEffect(0x6A);
- _screen->fadePalette(_screen->getPalette(0), 0x1E, &_updateFunctor);
- file->seek(0, SEEK_SET);
- file->read(_screen->getPalette(0)+723, 18);
- delete file;
- _screen->fadePalette(_screen->getPalette(0), 0x1E, &_updateFunctor);
-}
-
-void KyraEngine_v2::resetCauldronStateTable(int idx) {
- for (int i = 0; i < 7; ++i)
- _cauldronStateTables[idx][i] = -2;
-}
-
-bool KyraEngine_v2::addToCauldronStateTable(int data, int idx) {
- for (int i = 0; i < 7; ++i) {
- if (_cauldronStateTables[idx][i] == -2) {
- _cauldronStateTables[idx][i] = data;
- return true;
- }
- }
- return false;
-}
-
-void KyraEngine_v2::listItemsInCauldron() {
- int itemsInCauldron = 0;
- for (int i = 0; i < 25; ++i) {
- if (_cauldronTable[i] != -1)
- ++itemsInCauldron;
- else
- break;
- }
-
- if (!itemsInCauldron) {
- if (!_cauldronState)
- objectChat(getTableString(0xF4, _cCodeBuffer, 1), 0, 0x83, 0xF4);
- else
- objectChat(getTableString(0xF3, _cCodeBuffer, 1), 0, 0x83, 0xF3);
- } else {
- objectChat(getTableString(0xF7, _cCodeBuffer, 1), 0, 0x83, 0xF7);
-
- char buffer[80];
- for (int i = 0; i < itemsInCauldron-1; ++i) {
- char *str = buffer;
- strcpy(str, getTableString(_cauldronTable[i]+54, _cCodeBuffer, 1));
- if (_lang == 1) {
- if (*str == 37)
- str += 2;
- }
- strcpy((char*)_unkBuf500Bytes, "...");
- strcat((char*)_unkBuf500Bytes, str);
- strcat((char*)_unkBuf500Bytes, "...");
- objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[i]+54);
- }
-
- char *str = buffer;
- strcpy(str, getTableString(_cauldronTable[itemsInCauldron-1]+54, _cCodeBuffer, 1));
- if (_lang == 1) {
- if (*str == 37)
- str += 2;
- }
- strcpy((char*)_unkBuf500Bytes, "...");
- strcat((char*)_unkBuf500Bytes, str);
- strcat((char*)_unkBuf500Bytes, ".");
- objectChat((const char*)_unkBuf500Bytes, 0, 0x83, _cauldronTable[itemsInCauldron-1]+54);
- }
-}
-
-#pragma mark -
-
-void KyraEngine_v2::dinoRide() {
- _mainCharX = _mainCharY = -1;
-
- setGameFlag(0x15A);
- enterNewScene(41, -1, 0, 0, 0);
- resetGameFlag(0x15A);
-
- setGameFlag(0x15B);
- enterNewScene(39, -1, 0, 0, 0);
- resetGameFlag(0x15B);
-
- setGameFlag(0x16F);
-
- setGameFlag(0x15C);
- enterNewScene(42, -1, 0, 0, 0);
- resetGameFlag(0x15C);
-
- setGameFlag(0x15D);
- enterNewScene(39, -1, 0, 0, 0);
- resetGameFlag(0x15D);
-
- setGameFlag(0x15E);
- enterNewScene(40, -1, 0, 0, 0);
- resetGameFlag(0x15E);
-
- _mainCharX = 262;
- _mainCharY = 28;
- _mainCharacter.facing = 5;
- _mainCharacter.animFrame = _characterFrameTable[5];
- enterNewScene(39, 4, 0, 0, 0);
- setHandItem(0x61);
- _screen->showMouse();
- resetGameFlag(0x159);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::playTim(const char *filename) {
- TIM *tim = _tim->load(filename, &_timOpcodes);
- if (!tim)
- return;
-
- _tim->resetFinishedFlag();
- while (!_quitFlag && !_tim->finished()) {
- _tim->exec(tim, 0);
- if (_chatText)
- updateWithText();
- else
- update();
- delay(10);
- }
-
- _tim->unload(tim);
-}
-
-#pragma mark -
-
-void KyraEngine_v2::registerDefaultSettings() {
- KyraEngine::registerDefaultSettings();
-
- // Most settings already have sensible defaults. This one, however, is
- // specific to the Kyra engine.
- ConfMan.registerDefault("walkspeed", 5);
-}
-
-void KyraEngine_v2::writeSettings() {
- ConfMan.setInt("talkspeed", ((_configTextspeed-2) * 255) / 95);
-
- switch (_lang) {
- case 1:
- _flags.lang = Common::FR_FRA;
- break;
-
- case 2:
- _flags.lang = Common::DE_DEU;
- break;
-
- case 3:
- _flags.lang = Common::JA_JPN;
- break;
-
- case 0:
- default:
- _flags.lang = Common::EN_ANY;
- break;
- }
-
- ConfMan.set("language", Common::getLanguageCode(_flags.lang));
-
- KyraEngine::writeSettings();
-}
-
-void KyraEngine_v2::readSettings() {
- int talkspeed = ConfMan.getInt("talkspeed");
- _configTextspeed = (talkspeed*95)/255 + 2;
- KyraEngine::readSettings();
+ _mainCharacter.x1 += _updateCharPosXTable[_mainCharacter.facing];
+ _mainCharacter.y1 += _updateCharPosYTable[_mainCharacter.facing];
+ updateCharAnimFrame(0, table);
+ _updateCharPosNextUpdate = _system->getMillis() + getCharacterWalkspeed() * _tickLength;
+ return 1;
}
} // end of namespace Kyra
-
-
-
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 7a7aec803f..f0d26ca011 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -27,326 +27,63 @@
#define KYRA_KYRA_V2_H
#include "kyra/kyra.h"
-#include "kyra/script.h"
-#include "kyra/script_tim.h"
-#include "kyra/screen_v2.h"
-#include "kyra/text_v2.h"
-#include "kyra/gui_v2.h"
+#include "kyra/gui.h"
+#include "kyra/wsamovie.h"
#include "common/list.h"
-#include "common/func.h"
+#include "common/hashmap.h"
namespace Kyra {
-enum kSequences {
- kSequenceVirgin = 0,
- kSequenceWestwood,
- kSequenceTitle,
- kSequenceOverview,
- kSequenceLibrary,
- kSequenceHand,
- kSequencePoint,
- kSequenceZanfaun,
-
- kSequenceFunters,
- kSequenceFerb,
- kSequenceFish,
- kSequenceFheep,
- kSequenceFarmer,
- kSequenceFuards,
- kSequenceFirates,
- kSequenceFrash,
-
- kSequenceArraySize
-};
-
-enum kNestedSequences {
- kSequenceFiggle = 0,
- kSequenceOver1,
- kSequenceOver2,
- kSequenceForest,
- kSequenceDragon,
- kSequenceDarm,
- kSequenceLibrary2,
- kSequenceLibrary3,
- kSequenceMarco,
- kSequenceHand1a,
- kSequenceHand1b,
- kSequenceHand1c,
- kSequenceHand2,
- kSequenceHand3,
- kSequenceHand4
-};
-
-enum kSequencesDemo {
- kSequenceDemoVirgin = 0,
- kSequenceDemoWestwood,
- kSequenceDemoTitle,
- kSequenceDemoHill,
- kSequenceDemoOuthome,
- kSequenceDemoWharf,
- kSequenceDemoDinob,
- kSequenceDemoFisher
-};
-
-enum kNestedSequencesDemo {
- kSequenceDemoWharf2 = 0,
- kSequenceDemoDinob2,
- kSequenceDemoWater,
- kSequenceDemoBail,
- kSequenceDemoDig
-};
-
-class WSAMovieV2;
-class KyraEngine_v2;
-class TextDisplayer_v2;
+class Screen_v2;
class Debugger_v2;
-struct TIM;
-
-typedef int (KyraEngine_v2::*SeqProc)(WSAMovieV2*, int, int, int);
-
-struct FrameControl {
- uint16 index;
- uint16 delay;
-};
-
-struct ActiveWSA {
- int16 flags;
- WSAMovieV2 *movie;
- uint16 startFrame;
- uint16 endFrame;
- uint16 frameDelay;
- SeqProc callback;
- uint32 nextFrame;
- uint16 currentFrame;
- uint16 lastFrame;
- uint16 x;
- uint16 y;
- const FrameControl *control;
- uint16 startupCommand;
- uint16 finalCommand;
-};
-
-struct ActiveText {
- uint16 strIndex;
- uint16 x;
- uint16 y;
- int duration;
- uint16 width;
- uint32 startTime;
- int16 textcolor;
-};
-
-struct Sequence {
- uint16 flags;
- const char * wsaFile;
- const char * cpsFile;
- uint8 startupCommand;
- uint8 finalCommand;
- int16 stringIndex1;
- int16 stringIndex2;
- uint16 startFrame;
- uint16 numFrames;
- uint16 frameDelay;
- uint16 xPos;
- uint16 yPos;
- uint16 duration;
-};
-
-struct NestedSequence {
- uint16 flags;
- const char * wsaFile;
- uint16 startframe;
- uint16 endFrame;
- uint16 frameDelay;
- uint16 x;
- uint16 y;
- const FrameControl *wsaControl;
- uint16 startupCommand;
- uint16 finalCommand;
-};
-
-struct HofSeqData {
- const Sequence *seq;
- int numSeq;
- const NestedSequence *seqn;
- int numSeqn;
-};
-
-struct ItemAnimData_v1 {
- int16 itemIndex;
- uint16 y;
- const uint16 *frames;
-};
-
-struct ItemAnimData_v2 {
- int16 itemIndex;
- uint8 numFrames;
- const FrameControl *frames;
-};
-
-struct ActiveItemAnim {
- uint16 currentFrame;
- uint32 nextFrame;
-};
-
class KyraEngine_v2 : public KyraEngine {
friend class Debugger_v2;
-friend class TextDisplayer_v2;
friend class GUI_v2;
public:
- KyraEngine_v2(OSystem *system, const GameFlags &flags);
- ~KyraEngine_v2();
-
- virtual Screen *screen() { return _screen; }
- Screen_v2 *screen_v2() { return _screen; }
- virtual TextDisplayer *text() { return _text; }
- int language() const { return _lang; }
+ struct EngineDesc {
+ // Generic shape related
+ const int itemShapeStart;
+ const uint8 *characterFrameTable;
- virtual Movie *createWSAMovie();
-protected:
- // intro/outro
- void seq_playSequences(int startSeq, int endSeq = -1);
-
- int seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- void seq_sequenceCommand(int command);
- void seq_loadNestedSequence(int wsaNum, int seqNum);
- void seq_nestedSequenceFrame(int command, int wsaNum);
- void seq_animatedSubFrame(int srcPage, int dstPage, int delaytime,
- int steps, int x, int y, int w, int h, int openClose, int directionFlags);
- bool seq_processNextSubFrame(int wsaNum);
- void seq_resetActiveWSA(int wsaNum);
- void seq_unloadWSA(int wsaNum);
- void seq_processWSAs();
- void seq_cmpFadeFrame(const char *cmpFile);
- void seq_playTalkText(uint8 chatNum);
- void seq_resetAllTextEntries();
- uint32 seq_activeTextsTimeLeft();
- void seq_waitForTextsTimeout();
- int seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width);
- void seq_processText();
- char *seq_preprocessString(const char *str, int width);
- void seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor);
- void seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width,
- WSAMovieV2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos);
- void seq_finaleActorScreen();
- void seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0);
- void seq_scrollPage();
- void seq_showStarcraftLogo();
-
- void seq_init();
- void seq_uninit();
-
- int init();
- int go();
-
- Screen_v2 *_screen;
- TextDisplayer_v2 *_text;
- Debugger_v2 *_debugger;
- TIMInterpreter *_tim;
+ // Scene script
+ const int firstAnimSceneScript;
- uint8 *_mouseSHPBuf;
+ // Animation script specific
+ const int animScriptFrameAdd;
+ };
- static const int8 _dosTrackMap[];
- static const int _dosTrackMapSize;
+ KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc);
+ ~KyraEngine_v2();
- const AudioDataStruct *_soundData;
+ virtual Screen_v2 *screen_v2() const = 0;
+ virtual GUI *gui_v2() const = 0;
+ const EngineDesc &engineDesc() const { return _desc; }
protected:
- // game initialization
- void startup();
- void runLoop();
- void cleanup();
-
- void registerDefaultSettings();
- void writeSettings();
- void readSettings();
- uint8 _configTextspeed;
-
- // TODO: get rid of all variables having pointers to the static resources if possible
- // i.e. let them directly use the _staticres functions
- void initStaticResource();
-
- void setupTimers();
- void setupOpcodeTable();
-
- void loadMouseShapes();
- void loadItemShapes();
+ EngineDesc _desc;
+ Debugger_v2 *_debugger;
// run
- MainMenu *_menu;
-
bool _runFlag;
- bool _showCredits;
-
- void update();
- void updateWithText();
+ bool _showOutro;
+ int8 _deathHandler;
- Common::Functor0Mem<void, KyraEngine_v2> _updateFunctor;
+ virtual void update() = 0;
+ virtual void updateWithText() = 0;
- void updateMouse();
+ // MainMenu
+ MainMenu *_menu;
- void dinoRide();
+ // Input
+ virtual int inputSceneChange(int x, int y, int unk1, int unk2) = 0;
+ void updateInput();
int checkInput(Button *buttonList, bool mainLoop = false);
void removeInputTop();
- void handleInput(int x, int y);
- bool handleInputUnkSub(int x, int y);
-
- int inputSceneChange(int x, int y, int unk1, int unk2);
-
- // - Input
- void updateInput();
int _mouseX, _mouseY;
- int _mouseState;
struct Event {
Common::Event event;
@@ -360,102 +97,16 @@ protected:
};
Common::List<Event> _eventList;
- bool skipFlag() const;
- void resetSkipFlag(bool removeEvent = true);
-
- // gfx/animation specific
- uint8 *_gamePlayBuffer;
- void restorePage3();
-
- uint8 *_screenBuffer;
- bool _inventorySaved;
- void backUpPage0();
- void restorePage0();
-
- uint8 *_gfxBackUpRect;
-
- void backUpGfxRect24x24(int x, int y);
- void restoreGfxRect24x24(int x, int y);
- void backUpGfxRect32x32(int x, int y);
- void restoreGfxRect32x32(int x, int y);
-
- uint8 *getShapePtr(int index) { return _defaultShapeTable[index]; }
- uint8 *_defaultShapeTable[250];
- uint8 *_sceneShapeTable[50];
-
- WSAMovieV2 *_wsaSlots[10];
-
- void freeSceneShapePtrs();
-
- struct ShapeDesc {
- uint8 unk0, unk1, unk2, unk3, unk4;
- uint16 width, height;
- int16 xAdd, yAdd;
- };
-
- ShapeDesc *_shapeDescTable;
-
- struct SceneAnim {
- uint16 flags;
- int16 x, y;
- int16 x2, y2;
- int16 width, height;
- uint16 unkE;
- uint16 specialSize;
- uint16 unk12;
- int16 shapeIndex;
- uint16 wsaFlag;
- char filename[14];
- };
-
- SceneAnim _sceneAnims[10];
- WSAMovieV2 *_sceneAnimMovie[10];
- bool _specialSceneScriptState[10];
- bool _specialSceneScriptStateBackup[10];
- ScriptState _sceneSpecialScripts[10];
- uint32 _sceneSpecialScriptsTimer[10];
- int _lastProcessedSceneScript;
- bool _specialSceneScriptRunFlag;
-
- void updateSpecialSceneScripts();
- void freeSceneAnims();
-
- int _loadedZTable;
- void loadZShapes(int shapes);
- void loadInventoryShapes();
-
- void resetScaleTable();
- void setScaleTableItem(int item, int data);
- int getScale(int x, int y);
- uint16 _scaleTable[15];
-
- void setDrawLayerTableEntry(int entry, int data);
- int getDrawLayer(int x, int y);
- int _drawLayerTable[15];
+ virtual bool skipFlag() const;
+ virtual void resetSkipFlag(bool removeEvent = true);
- int _layerFlagTable[16]; // seems to indicate layers where items get destroyed when dropped to (TODO: check this!)
-
- char _newShapeFilename[13];
- int _newShapeLastEntry;
- int _newShapeWidth, _newShapeHeight;
- int _newShapeXAdd, _newShapeYAdd;
- int _newShapeFlag;
- uint8 *_newShapeFiledata;
- int _newShapeCount;
- int _newShapeAnimFrame;
- int _newShapeDelay;
-
- int initNewShapes(uint8 *filedata);
- void processNewShapes(int allowSkip, int resetChar);
- void resetNewShapes(int count, uint8 *filedata);
-
- // animator
+ // Animator
struct AnimObj {
uint16 index;
uint16 type;
- uint16 enabled;
+ bool enabled;
uint16 needRefresh;
- uint16 unk8;
+ uint16 specialRefresh;
uint16 animFlags;
uint16 flags;
int16 xPos1, yPos1;
@@ -464,52 +115,60 @@ protected:
uint16 animNum;
uint16 shapeIndex3;
uint16 shapeIndex2;
- uint16 unk1E;
- uint8 unk20;
- uint8 unk21;
- uint8 unk22;
- uint8 unk23;
int16 xPos2, yPos2;
int16 xPos3, yPos3;
int16 width, height;
int16 width2, height2;
+ uint16 palette;
AnimObj *nextObject;
};
- AnimObj _animObjects[42];
- void clearAnimObjects();
+ void allocAnimObjects(int actors, int anims, int items);
+ AnimObj *_animObjects;
+
+ AnimObj *_animActor;
+ AnimObj *_animAnims;
+ AnimObj *_animItems;
- AnimObj *_animList;
bool _drawNoShapeFlag;
+ AnimObj *_animList;
+
AnimObj *initAnimList(AnimObj *list, AnimObj *entry);
AnimObj *addToAnimListSorted(AnimObj *list, AnimObj *entry);
AnimObj *deleteAnimListEntry(AnimObj *list, AnimObj *entry);
- void drawAnimObjects();
- void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer);
- void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer);
-
- void refreshAnimObjects(int force);
+ virtual void refreshAnimObjects(int force) = 0;
void refreshAnimObjectsIfNeed();
- void updateItemAnimations();
- void flagAnimObjsUnk8();
+ void flagAnimObjsSpecialRefresh();
void flagAnimObjsForRefresh();
- void updateCharFacing();
- void updateCharacterAnim(int);
- void updateSceneAnim(int anim, int newFrame);
+ virtual void clearAnimObjects() = 0;
+
+ virtual void drawAnimObjects() = 0;
+ virtual void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer) = 0;
+ virtual void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer) = 0;
+
+ virtual void updateCharacterAnim(int) = 0;
+ virtual void updateSceneAnim(int anim, int newFrame) = 0;
void addItemToAnimList(int item);
void deleteItemAnimEntry(int item);
- int _animObj0Width, _animObj0Height;
- void setCharacterAnimDim(int w, int h);
- void resetCharacterAnimDim();
+ virtual void animSetupPaletteEntry(AnimObj *) {}
+
+ virtual void setCharacterAnimDim(int w, int h) = 0;
+ virtual void resetCharacterAnimDim() = 0;
- // scene
+ virtual int getScale(int x, int y) = 0;
+
+ uint8 *_screenBuffer;
+
+ // Scene
struct SceneDesc {
- char filename[10];
+ char filename1[10];
+ char filename2[10];
+
uint16 exit1, exit2, exit3, exit4;
uint8 flags;
uint8 sound;
@@ -519,42 +178,100 @@ protected:
int _sceneListSize;
uint16 _currentScene;
- const char *_sceneCommentString;
uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4;
int _sceneEnterX1, _sceneEnterY1, _sceneEnterX2, _sceneEnterY2,
_sceneEnterX3, _sceneEnterY3, _sceneEnterX4, _sceneEnterY4;
int _specialExitCount;
uint16 _specialExitTable[25];
bool checkSpecialSceneExit(int num, int x, int y);
- uint8 _scenePal[688];
+
bool _overwriteSceneFacing;
- void enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3);
- void enterNewSceneUnk1(int facing, int unk1, int unk2);
- void enterNewSceneUnk2(int unk1);
- void unloadScene();
+ virtual void enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3) = 0;
+
+ void runSceneScript6();
- void loadScenePal();
- void loadSceneMsc();
+ EMCData _sceneScriptData;
+ EMCState _sceneScriptState;
- void fadeScenePal(int srcIndex, int delay);
+ virtual int trySceneChange(int *moveTable, int unk1, int unk2) = 0;
- void startSceneScript(int unk1);
- void runSceneScript2();
- void runSceneScript4(int unk1);
- void runSceneScript6();
- void runSceneScript7();
+ // Animation
+ virtual void restorePage3() = 0;
+
+ struct SceneAnim {
+ uint16 flags;
+ int16 x, y;
+ int16 x2, y2;
+ int16 width, height;
+ uint16 specialSize;
+ int16 shapeIndex;
+ uint16 wsaFlag;
+ char filename[14];
+ };
- void initSceneAnims(int unk1);
- void initSceneScreen(int unk1);
+ SceneAnim _sceneAnims[16];
+ WSAMovieV2 *_sceneAnimMovie[16];
- int trySceneChange(int *moveTable, int unk1, int updateChar);
- int checkSceneChange();
+ void freeSceneAnims();
+ bool _specialSceneScriptState[10];
+ bool _specialSceneScriptStateBackup[10];
+ EMCState _sceneSpecialScripts[10];
+ uint32 _sceneSpecialScriptsTimer[10];
+ int _lastProcessedSceneScript;
+ bool _specialSceneScriptRunFlag;
+
+ void updateSpecialSceneScripts();
+
+ // Sequences
+ EMCData _animationScriptData;
+ EMCState _animationScriptState;
+ Common::Array<const Opcode*> _opcodesAnimation;
+
+ void runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload);
+
+ int o2a_setAnimationShapes(EMCState *script);
+ int o2a_setResetFrame(EMCState *script);
+
+ char _animShapeFilename[14];
+
+ uint8 *_animShapeFiledata;
+ int _animShapeCount;
+ int _animShapeLastEntry;
+
+ int _animNewFrame;
+ int _animDelayTime;
+
+ int _animResetFrame;
+
+ int _animShapeWidth, _animShapeHeight;
+ int _animShapeXAdd, _animShapeYAdd;
+
+ bool _animNeedUpdate;
+
+ virtual int initAnimationShapes(uint8 *filedata) = 0;
+ void processAnimationScript(int allowSkip, int resetChar);
+ virtual void uninitAnimationShapes(int count, uint8 *filedata) = 0;
+
+ // Shapes
+ typedef Common::HashMap<int, uint8*> ShapeMap;
+ ShapeMap _gameShapes;
+
+ uint8 *getShapePtr(int index) const;
+ void addShapeToPool(const uint8 *data, int realIndex, int shape);
+ void addShapeToPool(uint8 *shpData, int index);
+ void remShapeFromPool(int idx);
+
+ int _characterShapeFile;
+ virtual void loadCharacterShapes(int shapes) = 0;
+
// pathfinder
int _movFacingTable[600];
+ int _pathfinderFlag;
+
int findWay(int curX, int curY, int dstX, int dstY, int *moveTable, int moveTableSize);
- bool lineIsPassable(int x, int y);
+
bool directLinePassable(int x, int y, int toX, int toY);
int pathfinderInitPositionTable(int *moveTable);
@@ -566,603 +283,138 @@ protected:
int _pathfinderPositionTable[400];
int _pathfinderPositionIndexTable[200];
- // item
- uint8 _itemHtDat[176];
-
+ // items
struct Item {
uint16 id;
uint16 sceneId;
int16 x;
uint8 y;
- uint16 unk7;
};
- Item *_itemList;
- uint16 _hiddenItems[20];
+ void initItemList(int size);
- int findFreeItem();
- int countAllItems();
- int findItem(uint16 sceneId, uint16 id);
- int checkItemCollision(int x, int y);
- void resetItemList();
- void updateWaterFlasks();
+ uint16 _hiddenItems[100];
+
+ Item *_itemList;
+ int _itemListSize;
int _itemInHand;
int _handItemSet;
- bool dropItem(int unk1, uint16 item, int x, int y, int unk2);
- bool processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2);
- void itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item);
- void exchangeMouseItem(int itemPos);
- bool pickUpItem(int x, int y);
+ int findFreeItem();
+ int countAllItems();
+
+ int findItem(uint16 sceneId, uint16 id);
+ int findItem(uint16 item);
- bool isDropable(int x, int y);
+ void resetItemList();
+ void resetItem(int index);
- static const byte _itemStringMap[];
- static const int _itemStringMapSize;
+ virtual void setMouseCursor(uint16 item) = 0;
- void setMouseCursor(uint16 item);
void setHandItem(uint16 item);
void removeHandItem();
- static const int16 _flaskTable[];
- bool itemIsFlask(int item);
-
- // inventory
- static const int _inventoryX[];
- static const int _inventoryY[];
- static const uint16 _itemMagicTable[];
-
- int getInventoryItemSlot(uint16 item);
- void removeItemFromInventory(int slot);
- bool checkInventoryItemExchange(uint16 item, int slot);
- void drawInventoryShape(int page, uint16 item, int slot);
- void clearInventorySlot(int slot, int page);
- void redrawInventory(int page);
- void scrollInventoryWheel();
- int findFreeVisibleInventorySlot();
-
- ActiveItemAnim _activeItemAnim[15];
- int _nextAnimItem;
-
- // gui
- bool _menuDirectlyToLoad;
- GUI_v2 *_gui;
-
- void loadButtonShapes();
- void setupLangButtonShapes();
- uint8 *_buttonShapes[19];
-
- void initInventoryButtonList();
- Button *_inventoryButtons;
- Button *_buttonList;
-
- int scrollInventory(Button *button);
- int buttonInventory(Button *button);
- int bookButton(Button *button);
- int cauldronButton(Button *button);
- int cauldronClearButton(Button *button);
-
- // book
- static const int _bookPageYOffset[];
- static const byte _bookTextColorMap[];
-
- int _bookMaxPage;
- int _bookNewPage;
- int _bookCurPage;
- int _bookBkgd;
- bool _bookShown;
-
- void loadBookBkgd();
- void showBookPage();
- void bookLoop();
-
- void bookDecodeText(uint8 *text);
- void bookPrintText(int dstPage, const uint8 *text, int x, int y, uint8 color);
-
- int bookPrevPage(Button *button);
- int bookNextPage(Button *button);
- int bookClose(Button *button);
-
- // cauldron
- uint8 _cauldronState;
- int16 _cauldronUseCount;
- int16 _cauldronTable[25];
- int16 _cauldronStateTables[23][7];
-
- static const int16 _cauldronProtectedItems[];
- static const int16 _cauldronBowlTable[];
- static const int16 _cauldronMagicTable[];
- static const int16 _cauldronMagicTableScene77[];
- static const uint8 _cauldronStateTable[];
-
- void resetCauldronStateTable(int idx);
- bool addToCauldronStateTable(int data, int idx);
-
- void setCauldronState(uint8 state, bool paletteFade);
- void clearCauldronTable();
- void addFrontCauldronTable(int item);
- void cauldronItemAnim(int item);
- void cauldronRndPaletteFade();
- bool updateCauldron();
- void listItemsInCauldron();
-
- // localization
- void loadCCodeBuffer(const char *file);
- void loadOptionsBuffer(const char *file);
- void loadChapterBuffer(int chapter);
- uint8 *_optionsBuffer;
- uint8 *_cCodeBuffer;
-
- uint8 *_chapterBuffer;
- int _currentChapter;
- int _newChapterFile;
-
- uint8 *getTableEntry(uint8 *buffer, int id);
- char *getTableString(int id, uint8 *buffer, int decode);
- const char *getChapterString(int id);
- int decodeString1(const char *src, char *dst);
- void decodeString2(const char *src, char *dst);
-
- void changeFileExtension(char *buffer);
-
- // - Just used in French version
- int getItemCommandStringDrop(uint16 item);
- int getItemCommandStringPickUp(uint16 item);
- int getItemCommandStringInv(uint16 item);
- // -
-
- char _internStringBuf[200];
- static const char *_languageExtension[];
- static const char *_scriptLangExt[];
-
// character
struct Character {
uint16 sceneId;
- uint16 dlgIndex;
+ int16 dlgIndex;
uint8 height;
uint8 facing;
uint16 animFrame;
- uint8 unk8;
- uint8 unk9;
- uint8 unkA;
+ byte walkspeed;
uint16 inventory[20];
int16 x1, y1;
int16 x2, y2;
+ int16 x3, y3;
};
- int8 _deathHandler;
Character _mainCharacter;
- bool _useCharPal;
- int _charPalEntry;
- uint8 _charPalTable[16];
- void updateCharPal(int unk1);
- void setCharPalEntry(int entry, int value);
+ int _mainCharX, _mainCharY;
+ int _charScale;
void moveCharacter(int facing, int x, int y);
- int updateCharPos(int *table);
+ int updateCharPos(int *table, int force = 0);
void updateCharPosWithUpdate();
- void updateCharAnimFrame(int num, int *table);
- int checkCharCollision(int x, int y);
+ uint32 _updateCharPosNextUpdate;
+ static const int8 _updateCharPosXTable[];
+ static const int8 _updateCharPosYTable[];
- int _mainCharX, _mainCharY;
- int _charScaleX, _charScaleY;
-
- static const int _characterFrameTable[];
-
- // text
- void showMessageFromCCode(int id, int16 palIndex, int);
- void showMessage(const char *string, int16 palIndex);
- void showChapterMessage(int id, int16 palIndex);
-
- void updateCommandLineEx(int str1, int str2, int16 palIndex);
-
- const char *_shownMessage;
-
- byte _messagePal[3];
- bool _fadeMessagePalette;
- void fadeMessagePalette();
+ virtual int getCharacterWalkspeed() const = 0;
+ virtual void updateCharAnimFrame(int num, int *table) = 0;
// chat
int _vocHigh;
const char *_chatText;
int _chatObject;
- bool _chatIsNote;
uint32 _chatEndTime;
int _chatVocHigh, _chatVocLow;
- ScriptData _chatScriptData;
- ScriptState _chatScriptState;
-
- int chatGetType(const char *text);
- int chatCalcDuration(const char *text);
-
- void objectChat(const char *text, int object, int vocHigh = -1, int vocLow = -1);
- void objectChatInit(const char *text, int object, int vocHigh = -1, int vocLow = -1);
- void objectChatPrintText(const char *text, int object);
- void objectChatProcess(const char *script);
- void objectChatWaitToFinish();
-
- void startDialogue(int dlgIndex);
-
- void zanthSceneStartupChat();
- void zanthRandomIdleChat();
- void updateDlgBuffer();
- void loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2);
- void processDialogue(int dlgOffset, int vocH = 0, int csEntry = 0);
- void npcChatSequence(const char *str, int objectId, int vocHigh = -1, int vocLow = -1);
- void setNewDlgIndex(int dlgIndex);
-
- int _npcTalkChpIndex;
- int _npcTalkDlgIndex;
- uint8 _newSceneDlgState[32];
- int8 **_conversationState;
- uint8 *_dlgBuffer;
-
- // Talk object handling
- void initTalkObject(int index);
- void deinitTalkObject(int index);
-
- struct TalkObject {
- char filename[13];
- int8 scriptId;
- int16 x, y;
- int8 color;
- };
- TalkObject *_talkObjectList;
-
- struct TalkSections {
- TIM *STATim;
- TIM *TLKTim;
- TIM *ENDTim;
- };
- TalkSections _currentTalkSections;
-
- char _TLKFilename[13];
+ EMCData _chatScriptData;
+ EMCState _chatScriptState;
- // tim
- void playTim(const char *filename);
+ virtual void setDlgIndex(int dlgIndex) = 0;
- int t2_initChat(const TIM *tim, const uint16 *param);
- int t2_updateSceneAnim(const TIM *tim, const uint16 *param);
- int t2_resetChat(const TIM *tim, const uint16 *param);
- int t2_playSoundEffect(const TIM *tim, const uint16 *param);
+ virtual void randomSceneChat() = 0;
- Common::Array<const TIMOpcode*> _timOpcodes;
-
- // sound
- int _oldTalkFile;
- int _currentTalkFile;
- void openTalkFile(int newFile);
- int _lastSfxTrack;
-
- virtual void snd_playVoiceFile(int id);
- void snd_loadSoundFile(int id);
-
- void playVoice(int high, int low);
- void snd_playSoundEffect(int track);
-
- // timer
- void timerFadeOutMessage(int);
- void timerCauldronAnimation(int);
- void timerFunc4(int);
- void timerFunc5(int);
- void timerBurnZanthia(int);
-
- void setTimer1DelaySecs(int secs);
-
- uint32 _nextIdleAnim;
- int _lastIdleScript;
-
- void setNextIdleAnimTimer();
- void showIdleAnim();
- void runIdleScript(int script);
-
- void setWalkspeed(uint8 speed);
-
- // delay
- void delay(uint32 millis, bool updateGame = false, bool isMainLoop = false);
-
- // ingame static sequence handling
- void seq_makeBookOrCauldronAppear(int type);
- void seq_makeBookAppear();
-
- struct InventoryWsa {
- int x, y, x2, y2, w, h;
- int page;
- int curFrame, lastFrame, specialFrame;
- int sfx;
- int delay;
- bool running;
- uint32 timer;
- WSAMovieV2 *wsa;
- } _invWsa;
-
- // TODO: move inside KyraEngine_v2::InventoryWsa?
- void loadInvWsa(const char *filename, int run, int delay, int page, int sfx, int sFrame, int flags);
- void closeInvWsa();
-
- void updateInvWsa();
- void displayInvWsaLastFrame();
-
- // opcodes
- int o2_setCharacterFacingRefresh(ScriptState *script);
- int o2_setCharacterPos(ScriptState *script);
- int o2_defineObject(ScriptState *script);
- int o2_refreshCharacter(ScriptState *script);
- int o2_getCharacterX(ScriptState *script);
- int o2_getCharacterY(ScriptState *script);
- int o2_getCharacterFacing(ScriptState *script);
- int o2_getCharacterScene(ScriptState *script);
- int o2_setSceneComment(ScriptState *script);
- int o2_setCharacterAnimFrame(ScriptState *script);
- int o2_setCharacterFacing(ScriptState *script);
- int o2_trySceneChange(ScriptState *script);
- int o2_moveCharacter(ScriptState *script);
- int o2_customCharacterChat(ScriptState *script);
- int o2_soundFadeOut(ScriptState *script);
- int o2_showChapterMessage(ScriptState *script);
- int o2_restoreTalkTextMessageBkgd(ScriptState *script);
- int o2_wsaClose(ScriptState *script);
- int o2_meanWhileScene(ScriptState *script);
- int o2_backUpScreen(ScriptState *script);
- int o2_restoreScreen(ScriptState *script);
- int o2_displayWsaFrame(ScriptState *script);
- int o2_displayWsaSequentialFramesLooping(ScriptState *script);
- int o2_wsaOpen(ScriptState *script);
- int o2_displayWsaSequentialFrames(ScriptState *script);
- int o2_displayWsaSequence(ScriptState *script);
- int o2_addItemToInventory(ScriptState *script);
- int o2_drawShape(ScriptState *script);
- int o2_addItemToCurScene(ScriptState *script);
- int o2_checkForItem(ScriptState *script);
- int o2_loadSoundFile(ScriptState *script);
- int o2_removeItemSlotFromInventory(ScriptState *script);
- int o2_defineItem(ScriptState *script);
- int o2_removeItemFromInventory(ScriptState *script);
- int o2_countItemInInventory(ScriptState *script);
- int o2_countItemsInScene(ScriptState *script);
- int o2_queryGameFlag(ScriptState *script);
- int o2_resetGameFlag(ScriptState *script);
- int o2_setGameFlag(ScriptState *script);
- int o2_setHandItem(ScriptState *script);
- int o2_removeHandItem(ScriptState *script);
- int o2_handItemSet(ScriptState *script);
- int o2_hideMouse(ScriptState *script);
- int o2_addSpecialExit(ScriptState *script);
- int o2_setMousePos(ScriptState *script);
- int o2_showMouse(ScriptState *script);
- int o2_wipeDownMouseItem(ScriptState *script);
- int o2_getElapsedSecs(ScriptState *script);
- int o2_getTimerDelay(ScriptState *script);
- //int o2_playSoundEffect(ScriptState *script);
- int o2_delaySecs(ScriptState *script);
- int o2_delay(ScriptState *script);
- int o2_setTimerDelay(ScriptState *script);
- int o2_setScaleTableItem(ScriptState *script);
- int o2_setDrawLayerTableItem(ScriptState *script);
- int o2_setCharPalEntry(ScriptState *script);
- int o2_loadZShapes(ScriptState *script);
- int o2_drawSceneShape(ScriptState *script);
- int o2_drawSceneShapeOnPage(ScriptState *script);
- int o2_disableAnimObject(ScriptState *script);
- int o2_enableAnimObject(ScriptState *script);
- int o2_loadPalette384(ScriptState *script);
- int o2_setPalette384(ScriptState *script);
- int o2_restoreBackBuffer(ScriptState *script);
- int o2_backUpInventoryGfx(ScriptState *script);
- int o2_disableSceneAnim(ScriptState *script);
- int o2_enableSceneAnim(ScriptState *script);
- int o2_restoreInventoryGfx(ScriptState *script);
- int o2_setSceneAnimPos2(ScriptState *script);
- int o2_update(ScriptState *script);
- int o2_fadeScenePal(ScriptState *script);
- int o2_enterNewSceneEx(ScriptState *script);
- int o2_switchScene(ScriptState *script);
- int o2_getShapeFlag1(ScriptState *script);
- int o2_setPathfinderFlag(ScriptState *script);
- int o2_getSceneExitToFacing(ScriptState *script);
- int o2_setLayerFlag(ScriptState *script);
- int o2_setZanthiaPos(ScriptState *script);
- int o2_loadMusicTrack(ScriptState *script);
- int o2_playWanderScoreViaMap(ScriptState *script);
- int o2_playSoundEffect(ScriptState *script);
- int o2_setSceneAnimPos(ScriptState *script);
- int o2_blockInRegion(ScriptState *script);
- int o2_blockOutRegion(ScriptState *script);
- int o2_setCauldronState(ScriptState *script);
- int o2_showItemString(ScriptState *script);
- int o2_getRand(ScriptState *script);
- int o2_isAnySoundPlaying(ScriptState *script);
- int o2_setDeathHandlerFlag(ScriptState *script);
- int o2_setDrawNoShapeFlag(ScriptState *script);
- int o2_setRunFlag(ScriptState *script);
- int o2_showLetter(ScriptState *script);
- int o2_fillRect(ScriptState *script);
- int o2_waitForConfirmationClick(ScriptState *script);
- int o2_encodeShape(ScriptState *script);
- int o2_defineRoomEntrance(ScriptState *script);
- int o2_runTemporaryScript(ScriptState *script);
- int o2_setSpecialSceneScriptRunTime(ScriptState *script);
- int o2_defineSceneAnim(ScriptState *script);
- int o2_updateSceneAnim(ScriptState *script);
- int o2_addToSceneAnimPosAndUpdate(ScriptState *script);
- int o2_useItemOnMainChar(ScriptState *script);
- int o2_startDialogue(ScriptState *script);
- int o2_zanthRandomChat(ScriptState *script);
- int o2_setupDialogue(ScriptState *script);
- int o2_getDlgIndex(ScriptState *script);
- int o2_defineRoom(ScriptState *script);
- int o2_addCauldronStateTableEntry(ScriptState *script);
- int o2_setCountDown(ScriptState *script);
- int o2_getCountDown(ScriptState *script);
- int o2_pressColorKey(ScriptState *script);
- int o2_objectChat(ScriptState *script);
- int o2_chapterChange(ScriptState *script);
- int o2_getColorCodeFlag1(ScriptState *script);
- int o2_setColorCodeFlag1(ScriptState *script);
- int o2_getColorCodeFlag2(ScriptState *script);
- int o2_setColorCodeFlag2(ScriptState *script);
- int o2_getColorCodeValue(ScriptState *script);
- int o2_setColorCodeValue(ScriptState *script);
- int o2_countItemInstances(ScriptState *script);
- int o2_removeItemFromScene(ScriptState *script);
- int o2_initObject(ScriptState *script);
- int o2_npcChat(ScriptState *script);
- int o2_deinitObject(ScriptState *script);
- int o2_playTimSequence(ScriptState *script);
- int o2_makeBookOrCauldronAppear(ScriptState *script);
- int o2_setSpecialSceneScriptState(ScriptState *script);
- int o2_clearSpecialSceneScriptState(ScriptState *script);
- int o2_querySpecialSceneScriptState(ScriptState *script);
- int o2_resetInputColorCode(ScriptState *script);
- int o2_setHiddenItemsEntry(ScriptState *script);
- int o2_getHiddenItemsEntry(ScriptState *script);
- int o2_mushroomEffect(ScriptState *script);
- int o2_customChat(ScriptState *script);
- int o2_customChatFinish(ScriptState *script);
- int o2_setupSceneAnimation(ScriptState *script);
- int o2_stopSceneAnimation(ScriptState *script);
- int o2_disableTimer(ScriptState *script);
- int o2_enableTimer(ScriptState *script);
- int o2_setTimerCountdown(ScriptState *script);
- int o2_processPaletteIndex(ScriptState *script);
- int o2_updateTwoSceneAnims(ScriptState *script);
- int o2_getRainbowRoomData(ScriptState *script);
- int o2_drawSceneShapeEx(ScriptState *script);
- int o2_getBoolFromStack(ScriptState *script);
- int o2_getSfxDriver(ScriptState *script);
- int o2_getVocSupport(ScriptState *script);
- int o2_getMusicDriver(ScriptState *script);
- int o2_setVocHigh(ScriptState *script);
- int o2_getVocHigh(ScriptState *script);
- int o2_zanthiaChat(ScriptState *script);
- int o2_isVoiceEnabled(ScriptState *script);
- int o2_isVoicePlaying(ScriptState *script);
- int o2_stopVoicePlaying(ScriptState *script);
- int o2_getGameLanguage(ScriptState *script);
- int o2_demoFinale(ScriptState *script);
- int o2_dummy(ScriptState *script);
-
- // opcodes temporary
- // TODO: rename it from temporary to something more appropriate
- int o2t_defineNewShapes(ScriptState *script);
- int o2t_setCurrentFrame(ScriptState *script);
- int o2t_playSoundEffect(ScriptState *script);
- int o2t_fadeScenePal(ScriptState *script);
- int o2t_setShapeFlag(ScriptState *script);
-
- // script
- void runStartScript(int script, int unk1);
- void loadNPCScript();
-
- bool _noScriptEnter;
-
- ScriptData _npcScriptData;
-
- ScriptData _sceneScriptData;
- ScriptState _sceneScriptState;
-
- ScriptData _temporaryScriptData;
- ScriptState _temporaryScriptState;
- bool _temporaryScriptExecBit;
- Common::Array<const Opcode*> _opcodesTemporary;
-
- void runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload);
-
- // pathfinder
- int _pathfinderFlag;
-
- uint8 *_unkBuf500Bytes;
- uint8 *_unkBuf200kByte;
- bool _chatAltFlag;
+ // unknown
int _unk3, _unk4, _unk5;
bool _unkSceneScreenFlag1;
bool _unkHandleSceneChangeFlag;
- // sequence player
- ActiveWSA *_activeWSA;
- ActiveText *_activeText;
-
- const char *const *_sequencePakList;
- int _sequencePakListSize;
- const char *const *_ingamePakList;
- int _ingamePakListSize;
-
- const char *const *_musicFileListIntro;
- int _musicFileListIntroSize;
- const char *const *_musicFileListFinale;
- int _musicFileListFinaleSize;
- const char *const *_musicFileListIngame;
- int _musicFileListIngameSize;
- const uint8 *_cdaTrackTableIntro;
- int _cdaTrackTableIntroSize;
- const uint8 *_cdaTrackTableIngame;
- int _cdaTrackTableIngameSize;
- const uint8 *_cdaTrackTableFinale;
- int _cdaTrackTableFinaleSize;
- const char *const *_sequenceSoundList;
- int _sequenceSoundListSize;
- const char *const *_ingameSoundList;
- int _ingameSoundListSize;
- const uint16 *_ingameSoundIndex;
- int _ingameSoundIndexSize;
- const char *const *_sequenceStrings;
- int _sequenceStringsSize;
- const uint16 *_ingameTalkObjIndex;
- int _ingameTalkObjIndexSize;
- const char *const *_ingameTimJpStr;
- int _ingameTimJpStrSize;
- const HofSeqData *_sequences;
- const ItemAnimData_v2 *_itemAnimData;
- int _itemAnimDataSize;
- const ItemAnimData_v1 *_demoAnimData;
- int _demoAnimSize;
-
- int _sequenceStringsDuration[33];
-
- static const uint8 _seqTextColorPresets[];
- char *_seqProcessedString;
- WSAMovieV2 *_seqWsa;
-
- bool _abortIntroFlag;
- int _menuChoice;
-
- uint32 _seqFrameDelay;
- uint32 _seqStartTime;
- uint32 _seqEndTime;
- int _seqFrameCounter;
- int _seqScrollTextCounter;
- int _seqWsaCurrentFrame;
- bool _seqSpecialFlag;
- bool _seqSubframePlaying;
- uint8 _seqTextColor[2];
- uint8 _seqTextColorMap[16];
-
- const SeqProc *_callbackS;
- const SeqProc *_callbackN;
-
- static const uint8 _rainbowRoomData[];
-
- // color code related vars
- int _colorCodeFlag1;
- int _colorCodeFlag2;
- uint8 _presetColorCode[7];
- uint8 _inputColorCode[7];
- uint32 _scriptCountDown;
- int _dbgPass;
+ // opcodes
+ int o2_getCharacterX(EMCState *script);
+ int o2_getCharacterY(EMCState *script);
+ int o2_getCharacterFacing(EMCState *script);
+ int o2_getCharacterScene(EMCState *script);
+ int o2_setCharacterFacingOverwrite(EMCState *script);
+ int o2_trySceneChange(EMCState *script);
+ int o2_moveCharacter(EMCState *script);
+ int o2_checkForItem(EMCState *script);
+ int o2_defineItem(EMCState *script);
+ int o2_queryGameFlag(EMCState *script);
+ int o2_resetGameFlag(EMCState *script);
+ int o2_setGameFlag(EMCState *script);
+ int o2_setHandItem(EMCState *script);
+ int o2_removeHandItem(EMCState *script);
+ int o2_handItemSet(EMCState *script);
+ int o2_hideMouse(EMCState *script);
+ int o2_addSpecialExit(EMCState *script);
+ int o2_setMousePos(EMCState *script);
+ int o2_showMouse(EMCState *script);
+ int o2_delay(EMCState *script);
+ int o2_update(EMCState *script);
+ int o2_getShapeFlag1(EMCState *script);
+ int o2_playWanderScoreViaMap(EMCState *script);
+ int o2_getRand(EMCState *script);
+ int o2_setDeathHandler(EMCState *script);
+ int o2_waitForConfirmationClick(EMCState *script);
+ int o2_randomSceneChat(EMCState *script);
+ int o2_setDlgIndex(EMCState *script);
+ int o2_getDlgIndex(EMCState *script);
+ int o2_defineRoomEntrance(EMCState *script);
+ int o2_runAnimationScript(EMCState *script);
+ int o2_setSpecialSceneScriptRunTime(EMCState *script);
+ int o2_defineScene(EMCState *script);
+ int o2_setSpecialSceneScriptState(EMCState *script);
+ int o2_clearSpecialSceneScriptState(EMCState *script);
+ int o2_querySpecialSceneScriptState(EMCState *script);
+ int o2_setHiddenItemsEntry(EMCState *script);
+ int o2_getHiddenItemsEntry(EMCState *script);
+ int o2_disableTimer(EMCState *script);
+ int o2_enableTimer(EMCState *script);
+ int o2_setTimerCountdown(EMCState *script);
+ int o2_setVocHigh(EMCState *script);
+ int o2_getVocHigh(EMCState *script);
// save/load specific
- void saveGame(const char *fileName, const char *saveName);
- void loadGame(const char *fileName);
+ virtual void saveGame(const char *fileName, const char *saveName) = 0;
+ virtual void loadGame(const char *fileName) = 0;
};
} // end of namespace Kyra
#endif
-
-
-
diff --git a/engines/kyra/module.mk b/engines/kyra/module.mk
index bfb0e057fe..aec2778def 100644
--- a/engines/kyra/module.mk
+++ b/engines/kyra/module.mk
@@ -3,41 +3,50 @@ MODULE := engines/kyra
MODULE_OBJS := \
animator_v1.o \
animator_v2.o \
- animator_v3.o \
+ animator_hof.o \
+ animator_mr.o \
debugger.o \
detection.o \
gui.o \
gui_v1.o \
gui_v2.o \
- gui_v3.o \
+ gui_hof.o \
+ gui_mr.o \
items_v1.o \
items_v2.o \
- items_v3.o \
+ items_hof.o \
+ items_mr.o \
kyra.o \
kyra_v1.o \
kyra_v2.o \
- kyra_v3.o \
+ kyra_hof.o \
+ kyra_mr.o \
resource.o \
saveload.o \
saveload_v1.o \
- saveload_v2.o \
+ saveload_hof.o \
+ saveload_mr.o \
scene.o \
scene_v1.o \
scene_v2.o \
- scene_v3.o \
+ scene_hof.o \
+ scene_mr.o \
screen.o \
screen_v1.o \
screen_v2.o \
- screen_v3.o \
+ screen_hof.o \
+ screen_mr.o \
script_v1.o \
script_v2.o \
- script_v3.o \
+ script_hof.o \
+ script_mr.o \
script.o \
script_tim.o \
seqplayer.o \
sequences_v1.o \
sequences_v2.o \
- sequences_v3.o \
+ sequences_hof.o \
+ sequences_mr.o \
sound_adlib.o \
sound_digital.o \
sound_towns.o \
@@ -47,17 +56,17 @@ MODULE_OBJS := \
staticres.o \
text.o \
text_v1.o \
- text_v2.o \
- text_v3.o \
+ text_hof.o \
+ text_mr.o \
timer.o \
timer_v1.o \
- timer_v2.o \
- timer_v3.o \
+ timer_hof.o \
+ timer_mr.o \
vqa.o \
wsamovie.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_KYRA), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 0a07392d8d..b2564221fc 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -716,7 +716,6 @@ bool ResLoaderTlk::loadFile(const Common::String &filename, Common::SeekableRead
char realFilename[20];
snprintf(realFilename, 20, "%u.AUD", resFilename);
-
uint32 curOffset = stream.pos();
stream.seek(resOffset, SEEK_SET);
entry.size = stream.readUint32LE();
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 7a6bdbd73e..f414cacee8 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -37,7 +37,7 @@
#include "common/ptr.h"
#include "kyra/kyra.h"
-#include "kyra/kyra_v2.h"
+#include "kyra/kyra_hof.h"
namespace Kyra {
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 358f61addf..fa3266685f 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -29,7 +29,7 @@
#include "kyra/kyra.h"
-#define CURRENT_SAVE_VERSION 9
+#define CURRENT_SAVE_VERSION 11
#define GF_FLOPPY (1 << 0)
#define GF_TALKIE (1 << 1)
@@ -188,6 +188,9 @@ Common::OutSaveFile *KyraEngine::openSaveForWriting(const char *filename, const
const char *KyraEngine::getSavegameFilename(int num) {
static Common::String filename;
+
+ assert(num >= 0 && num <= 999);
+
char extension[5];
sprintf(extension, "%.3d", num);
diff --git a/engines/kyra/saveload_v2.cpp b/engines/kyra/saveload_hof.cpp
index 94824c9895..954cbccfa9 100644
--- a/engines/kyra/saveload_v2.cpp
+++ b/engines/kyra/saveload_hof.cpp
@@ -35,8 +35,8 @@
namespace Kyra {
-void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::saveGame('%s', '%s')", fileName, saveName);
+void KyraEngine_HoF::saveGame(const char *fileName, const char *saveName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::saveGame('%s', '%s')", fileName, saveName);
Common::OutSaveFile *out = openSaveForWriting(fileName, saveName);
if (!out) {
@@ -53,7 +53,7 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
//out->writeUint16BE(word_2AB05);
out->writeSint16BE(_lastMusicCommand);
out->writeByte(_newChapterFile);
- out->writeByte(_loadedZTable);
+ out->writeByte(_characterShapeFile);
out->writeByte(_cauldronState);
out->writeByte(_colorCodeFlag1);
out->writeByte(_colorCodeFlag2);
@@ -73,13 +73,10 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
out->writeSint16BE(_cauldronUseCount);
out->writeUint16BE(_mainCharacter.sceneId);
- out->writeUint16BE(_mainCharacter.dlgIndex);
+ out->writeSint16BE(_mainCharacter.dlgIndex);
out->writeByte(_mainCharacter.height);
out->writeByte(_mainCharacter.facing);
out->writeUint16BE(_mainCharacter.animFrame);
- out->writeByte(_mainCharacter.unk8);
- out->writeByte(_mainCharacter.unk9);
- out->writeByte(_mainCharacter.unkA);
for (int i = 0; i < 20; ++i)
out->writeUint16BE(_mainCharacter.inventory[i]);
out->writeSint16BE(_mainCharacter.x1);
@@ -92,7 +89,6 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
out->writeUint16BE(_itemList[i].sceneId);
out->writeSint16BE(_itemList[i].x);
out->writeByte(_itemList[i].y);
- out->writeUint16BE(_itemList[i].unk7);
}
for (int i = 0; i < 72; ++i) {
@@ -104,7 +100,7 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
}
for (int i = 0; i < 86; ++i) {
- out->write(_sceneList[i].filename, 10);
+ out->write(_sceneList[i].filename1, 10);
out->writeUint16BE(_sceneList[i].exit1);
out->writeUint16BE(_sceneList[i].exit2);
out->writeUint16BE(_sceneList[i].exit3);
@@ -130,8 +126,8 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) {
delete out;
}
-void KyraEngine_v2::loadGame(const char *fileName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::loadGame('%s')", fileName);
+void KyraEngine_HoF::loadGame(const char *fileName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadGame('%s')", fileName);
SaveHeader header;
Common::InSaveFile *saveFile = openSaveForReading(fileName, header);
@@ -153,7 +149,7 @@ void KyraEngine_v2::loadGame(const char *fileName) {
_lastMusicCommand = -1;
}
- int loadedZTable = _loadedZTable;
+ int loadedZTable = _characterShapeFile;
Common::SeekableSubReadStreamEndian in(saveFile, saveFile->pos(), saveFile->size(), !header.originalSave, true);
@@ -173,7 +169,7 @@ void KyraEngine_v2::loadGame(const char *fileName) {
in.readUint16();
_lastMusicCommand = in.readSint16();
_newChapterFile = in.readByte();
- _loadedZTable = in.readByte();
+ _characterShapeFile = in.readByte();
_cauldronState = in.readByte();
_colorCodeFlag1 = in.readByte();
_colorCodeFlag2 = in.readByte();
@@ -209,13 +205,14 @@ void KyraEngine_v2::loadGame(const char *fileName) {
in.seek(6, SEEK_CUR);
_mainCharacter.sceneId = in.readUint16();
- _mainCharacter.dlgIndex = in.readUint16();
+ _mainCharacter.dlgIndex = in.readSint16();
_mainCharacter.height = in.readByte();
_mainCharacter.facing = in.readByte();
_mainCharacter.animFrame = in.readUint16();
- _mainCharacter.unk8 = in.readByte();
- _mainCharacter.unk9 = in.readByte();
- _mainCharacter.unkA = in.readByte();
+
+ if (header.version <= 10 || header.originalSave)
+ in.seek(3, SEEK_CUR);
+
for (int i = 0; i < 20; ++i)
_mainCharacter.inventory[i] = in.readUint16();
_mainCharacter.x1 = in.readSint16();
@@ -228,7 +225,8 @@ void KyraEngine_v2::loadGame(const char *fileName) {
_itemList[i].sceneId = in.readUint16();
_itemList[i].x = in.readSint16();
_itemList[i].y = in.readByte();
- _itemList[i].unk7 = in.readUint16();
+ if (header.version <= 9 || header.originalSave)
+ in.readUint16();
}
for (int i = 0; i < 72; ++i) {
@@ -241,10 +239,10 @@ void KyraEngine_v2::loadGame(const char *fileName) {
for (int i = 0; i < 86; ++i) {
if (!header.originalSave) {
- in.read(_sceneList[i].filename, 10);
+ in.read(_sceneList[i].filename1, 10);
} else {
- in.read(_sceneList[i].filename, 9);
- _sceneList[i].filename[9] = 0;
+ in.read(_sceneList[i].filename1, 9);
+ _sceneList[i].filename1[9] = 0;
}
_sceneList[i].exit1 = in.readUint16();
@@ -286,8 +284,8 @@ void KyraEngine_v2::loadGame(const char *fileName) {
else
debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str());
- if (loadedZTable != _loadedZTable)
- loadZShapes(_loadedZTable);
+ if (loadedZTable != _characterShapeFile)
+ loadCharacterShapes(_characterShapeFile);
_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
if (!queryGameFlag(1))
diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp
new file mode 100644
index 0000000000..8b727862a5
--- /dev/null
+++ b/engines/kyra/saveload_mr.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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/savefile.h"
+#include "common/system.h"
+
+#include "kyra/kyra_mr.h"
+#include "kyra/timer.h"
+
+namespace Kyra {
+
+void KyraEngine_MR::saveGame(const char *fileName, const char *saveName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::saveGame('%s', '%s')", fileName, saveName);
+
+ Common::OutSaveFile *out = openSaveForWriting(fileName, saveName);
+ if (!out) {
+ warning("Can't open file '%s', game not loadable", fileName);
+ return;
+ }
+
+ _timer->saveDataToFile(*out);
+
+ out->writeUint32BE(sizeof(_flagsTable));
+ out->write(_flagsTable, sizeof(_flagsTable));
+
+ out->writeSint16BE(_lastMusicCommand);
+ out->writeByte(_currentChapter);
+ out->writeByte(_characterShapeFile);
+ //XXX
+ out->writeSint16BE(_score);
+ out->writeSint16BE(_scoreMax);
+ out->writeByte(_malcolmsMood);
+ out->write(_conversationState, sizeof(_conversationState));
+ out->write(_newSceneDlgState, sizeof(_newSceneDlgState));
+ for (int i = 0; i < 100; ++i)
+ out->writeUint16BE(_hiddenItems[i]);
+ out->write(_scoreFlagTable, sizeof(_scoreFlagTable));
+
+ out->writeUint16BE(_mainCharacter.sceneId);
+ out->writeSint16BE(_mainCharacter.dlgIndex);
+ out->writeByte(_mainCharacter.height);
+ out->writeByte(_mainCharacter.facing);
+ out->writeUint16BE(_mainCharacter.animFrame);
+ out->writeByte(_mainCharacter.walkspeed);
+ for (int i = 0; i < 10; ++i)
+ out->writeUint16BE(_mainCharacter.inventory[i]);
+ out->writeSint16BE(_mainCharacter.x1);
+ out->writeSint16BE(_mainCharacter.y1);
+ out->writeSint16BE(_mainCharacter.x2);
+ out->writeSint16BE(_mainCharacter.y2);
+ out->writeSint16BE(_mainCharacter.x3);
+ out->writeSint16BE(_mainCharacter.y3);
+
+ for (int i = 0; i < 50; ++i) {
+ out->writeUint16BE(_itemList[i].id);
+ out->writeUint16BE(_itemList[i].sceneId);
+ out->writeSint16BE(_itemList[i].x);
+ out->writeSint16BE(_itemList[i].y);
+ }
+
+ for (int i = 0; i < 88; ++i) {
+ out->write(_talkObjectList[i].filename, 13);
+ out->writeByte(_talkObjectList[i].sceneAnim);
+ out->writeByte(_talkObjectList[i].sceneScript);
+ out->writeSint16BE(_talkObjectList[i].x);
+ out->writeSint16BE(_talkObjectList[i].y);
+ out->writeByte(_talkObjectList[i].color);
+ }
+
+ for (int i = 0; i < 98; ++i) {
+ out->write(_sceneList[i].filename1, 10);
+ out->write(_sceneList[i].filename2, 10);
+ out->writeUint16BE(_sceneList[i].exit1);
+ out->writeUint16BE(_sceneList[i].exit2);
+ out->writeUint16BE(_sceneList[i].exit3);
+ out->writeUint16BE(_sceneList[i].exit4);
+ out->writeByte(_sceneList[i].flags);
+ out->writeByte(_sceneList[i].sound);
+ }
+
+ out->writeSint16BE(_itemInHand);
+ out->writeUint16BE(_sceneExit1);
+ out->writeUint16BE(_sceneExit2);
+ out->writeUint16BE(_sceneExit3);
+ out->writeUint16BE(_sceneExit4);
+
+ out->finalize();
+
+ // check for errors
+ if (out->ioFailed())
+ warning("Can't write file '%s'. (Disk full?)", fileName);
+ else
+ debugC(1, kDebugLevelMain, "Saved game '%s.'", saveName);
+
+ delete out;
+}
+
+void KyraEngine_MR::loadGame(const char *fileName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadGame('%s')", fileName);
+
+ SaveHeader header;
+ Common::InSaveFile *saveFile = openSaveForReading(fileName, header);
+ if (!saveFile) {
+ showMessageFromCCode(17, 0xB3, 0);
+ snd_playSoundEffect(0x0D, 0xC8);
+ return;
+ }
+
+ if (_inventoryState) {
+ updateCharacterAnim(0);
+ restorePage3();
+ drawAnimObjects();
+ _inventoryState = true;
+ refreshAnimObjects(0);
+ hideInventory();
+ }
+
+ _deathHandler = -1;
+ if (!_unkSceneScreenFlag1)
+ _lastMusicCommand = -1;
+
+ int curShapes = _characterShapeFile;
+
+ Common::SeekableSubReadStreamEndian in(saveFile, saveFile->pos(), saveFile->size(), !header.originalSave, true);
+
+ _screen->hideMouse();
+
+ _timer->loadDataFromFile(in, header.version);
+
+ uint32 flagsSize = in.readUint32BE();
+ assert(flagsSize <= sizeof(_flagsTable));
+ in.read(_flagsTable, flagsSize);
+
+ // usually we have to save the flag set by opcode 10 here
+ _lastMusicCommand = in.readSint16();
+ _currentChapter = in.readByte();
+ _characterShapeFile = in.readByte();
+ //XXX
+ _score = in.readSint16();
+ _scoreMax = in.readSint16();
+ _malcolmsMood = in.readByte();
+ in.read(_conversationState, sizeof(_conversationState));
+ in.read(_newSceneDlgState, sizeof(_newSceneDlgState));
+ for (int i = 0; i < 100; ++i)
+ _hiddenItems[i] = in.readUint16();
+ in.read(_scoreFlagTable, sizeof(_scoreFlagTable));
+
+ _mainCharacter.sceneId = in.readUint16();
+ _mainCharacter.dlgIndex = in.readSint16();
+ _mainCharacter.height = in.readByte();
+ _mainCharacter.facing = in.readByte();
+ _mainCharacter.animFrame = in.readUint16();
+ _mainCharacter.walkspeed = in.readByte();
+ for (int i = 0; i < 10; ++i)
+ _mainCharacter.inventory[i] = in.readUint16();
+ _mainCharacter.x1 = in.readSint16();
+ _mainCharacter.y1 = in.readSint16();
+ _mainCharacter.x2 = in.readSint16();
+ _mainCharacter.y2 = in.readSint16();
+ _mainCharacter.x3 = in.readSint16();
+ _mainCharacter.y3 = in.readSint16();
+
+ for (int i = 0; i < 50; ++i) {
+ _itemList[i].id = in.readUint16();
+ _itemList[i].sceneId = in.readUint16();
+ _itemList[i].x = in.readSint16();
+ _itemList[i].y = in.readSint16();
+ if (header.version <= 9)
+ in.readUint16();
+ }
+
+ for (int i = 0; i < 88; ++i) {
+ in.read(_talkObjectList[i].filename, 13);
+ _talkObjectList[i].sceneAnim = in.readByte();
+ _talkObjectList[i].sceneScript = in.readByte();
+ _talkObjectList[i].x = in.readSint16();
+ _talkObjectList[i].y = in.readSint16();
+ _talkObjectList[i].color = in.readByte();
+ }
+
+ for (int i = 0; i < 98; ++i) {
+ in.read(_sceneList[i].filename1, 10);
+ in.read(_sceneList[i].filename2, 10);
+ _sceneList[i].exit1 = in.readUint16();
+ _sceneList[i].exit2 = in.readUint16();
+ _sceneList[i].exit3 = in.readUint16();
+ _sceneList[i].exit4 = in.readUint16();
+ _sceneList[i].flags = in.readByte();
+ _sceneList[i].sound = in.readByte();
+ }
+
+ _itemInHand = in.readSint16();
+ _sceneExit1 = in.readUint16();
+ _sceneExit2 = in.readUint16();
+ _sceneExit3 = in.readUint16();
+ _sceneExit4 = in.readUint16();
+
+ if (saveFile->ioFailed())
+ error("Load failed ('%s', '%s').", fileName, header.description.c_str());
+ else
+ debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str());
+
+ _loadingState = true;
+ updateCharacterAnim(0);
+ _loadingState = false;
+
+ if (curShapes != _characterShapeFile)
+ loadCharacterShapes(_characterShapeFile);
+
+ _mainCharX = _mainCharacter.x2 = _mainCharacter.x1;
+ _mainCharY = _mainCharacter.y2 = _mainCharacter.y1;
+ _mainCharacter.facing = 4;
+ _badConscienceShown = false;
+ _badConsciencePosition = false;
+ _goodConscienceShown = false;
+ _goodConsciencePosition = false;
+
+ enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
+ setHandItem(_itemInHand);
+
+ if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
+ snd_playWanderScoreViaMap(_lastMusicCommand, 1);
+ else if (_lastMusicCommand == -1)
+ snd_playWanderScoreViaMap(28, 1);
+
+ while (!_screen->isMouseVisible())
+ _screen->showMouse();
+
+ setCommandLineRestoreTimer(7);
+ _shownMessage = " ";
+ _restoreCommandLine = false;
+
+ // We didn't explicitly set the walk speed, but it's saved as part of
+ // the _timers array, so we need to re-sync it with _configWalkspeed.
+ setWalkspeed(_configWalkspeed);
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp
new file mode 100644
index 0000000000..3fc7947253
--- /dev/null
+++ b/engines/kyra/scene_hof.cpp
@@ -0,0 +1,763 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_hof.h"
+#include "kyra/screen_v2.h"
+#include "kyra/sound.h"
+#include "kyra/wsamovie.h"
+#include "kyra/resource.h"
+
+#include "common/func.h"
+
+namespace Kyra {
+
+void KyraEngine_HoF::enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewScene(%d, %d, %d, %d, %d)", newScene, facing, unk1, unk2, unk3);
+ if (_newChapterFile != _currentTalkFile) {
+ _currentTalkFile = _newChapterFile;
+ if (_flags.isTalkie) {
+ showMessageFromCCode(265, 150, 0);
+ _screen->updateScreen();
+ openTalkFile(_currentTalkFile);
+ }
+ showMessage(0, 207);
+ _screen->updateScreen();
+ }
+
+ _screen->hideMouse();
+
+ if (!unk3) {
+ updateWaterFlasks();
+ displayInvWsaLastFrame();
+ }
+
+ if (unk1) {
+ int x = _mainCharacter.x1;
+ int y = _mainCharacter.y1;
+
+ switch (facing) {
+ case 0:
+ y -= 6;
+ break;
+
+ case 2:
+ x = 335;
+ break;
+
+ case 4:
+ y = 147;
+ break;
+
+ case 6:
+ x = -16;
+ break;
+
+ default:
+ break;
+ }
+
+ moveCharacter(facing, x, y);
+ }
+
+ bool newSoundFile = false;
+ uint32 waitTime = 0;
+ if (_sceneList[newScene].sound != _lastMusicCommand) {
+ newSoundFile = true;
+ waitTime = _system->getMillis() + 1000;
+ _sound->beginFadeOut();
+ }
+
+ _chatAltFlag = false;
+
+ if (!unk3) {
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
+ _emc->start(&_sceneScriptState, 5);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+ }
+
+ Common::for_each(_wsaSlots, _wsaSlots+ARRAYSIZE(_wsaSlots), Common::mem_fun(&WSAMovieV2::close));
+ _specialExitCount = 0;
+ memset(_specialExitTable, -1, sizeof(_specialExitTable));
+
+ _mainCharacter.sceneId = newScene;
+ _sceneList[newScene].flags &= ~1;
+ loadScenePal();
+ unloadScene();
+ loadSceneMsc();
+
+ SceneDesc &scene = _sceneList[newScene];
+ _sceneExit1 = scene.exit1;
+ _sceneExit2 = scene.exit2;
+ _sceneExit3 = scene.exit3;
+ _sceneExit4 = scene.exit4;
+
+ if (newSoundFile) {
+ if (_sound->getMusicType() == Sound::kAdlib) {
+ while (_sound->isPlaying())
+ _system->delayMillis(10);
+ } else {
+ while (waitTime > _system->getMillis())
+ _system->delayMillis(10);
+ }
+ snd_loadSoundFile(_sceneList[newScene].sound);
+ }
+
+ startSceneScript(unk3);
+
+ if (_overwriteSceneFacing) {
+ facing = _mainCharacter.facing;
+ _overwriteSceneFacing = false;
+ }
+
+ enterNewSceneUnk1(facing, unk2, unk3);
+
+ setTimer1DelaySecs(-1);
+ _sceneScriptState.regs[3] = 1;
+ enterNewSceneUnk2(unk3);
+ _screen->showMouse();
+ _unk5 = 0;
+ setNextIdleAnimTimer();
+
+ _currentScene = newScene;
+}
+
+void KyraEngine_HoF::enterNewSceneUnk1(int facing, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2);
+ int x = 0, y = 0;
+ int x2 = 0, y2 = 0;
+ bool needProc = true;
+
+ if (_mainCharX == -1 && _mainCharY == -1) {
+ switch (facing+1) {
+ case 1: case 2: case 8:
+ x2 = _sceneEnterX3;
+ y2 = _sceneEnterY3;
+ break;
+
+ case 3:
+ x2 = _sceneEnterX4;
+ y2 = _sceneEnterY4;
+ break;
+
+ case 4: case 5: case 6:
+ x2 = _sceneEnterX1;
+ y2 = _sceneEnterY1;
+ break;
+
+ case 7:
+ x2 = _sceneEnterX2;
+ y2 = _sceneEnterY2;
+ break;
+
+ default:
+ x2 = y2 = -1;
+ break;
+ }
+
+ if (x2 >= 316)
+ x2 = 312;
+ if (y2 >= 141)
+ y2 = 139;
+ if (x2 <= 4)
+ x2 = 8;
+ }
+
+ if (_mainCharX >= 0) {
+ x = x2 = _mainCharX;
+ needProc = false;
+ }
+
+ if (_mainCharY >= 0) {
+ y = y2 = _mainCharY;
+ needProc = false;
+ }
+
+ _mainCharX = _mainCharY = -1;
+
+ if (unk1 && needProc) {
+ x = x2;
+ y = y2;
+
+ switch (facing) {
+ case 0:
+ y2 = 147;
+ break;
+
+ case 2:
+ x2 = -16;
+ break;
+
+ case 4:
+ y2 = y - 4;
+ break;
+
+ case 6:
+ x2 = 335;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ x2 &= ~3;
+ x &= ~3;
+ y2 &= ~1;
+ y &= ~1;
+
+ _mainCharacter.facing = facing;
+ _mainCharacter.x1 = _mainCharacter.x2 = x2;
+ _mainCharacter.y1 = _mainCharacter.y2 = y2;
+ initSceneAnims(unk2);
+
+ if (!unk2)
+ snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
+
+ if (unk1 && !unk2 && _mainCharacter.animFrame != 32)
+ moveCharacter(facing, x, y);
+}
+
+void KyraEngine_HoF::enterNewSceneUnk2(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewSceneUnk2(%d)", unk1);
+ _unk3 = -1;
+
+ if (_flags.isTalkie) {
+ if (_mainCharX == -1 && _mainCharY == -1 && _mainCharacter.sceneId != 61 &&
+ !queryGameFlag(0x1F1) && !queryGameFlag(0x192) && !queryGameFlag(0x193) &&
+ _mainCharacter.sceneId != 70 && !queryGameFlag(0x159) && _mainCharacter.sceneId != 37) {
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+ }
+ } else if (_mainCharX != -1 && _mainCharY != -1) {
+ if (_characterFrameTable[_mainCharacter.facing] == 25)
+ _mainCharacter.facing = 5;
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+ }
+
+ if (!unk1) {
+ runSceneScript4(0);
+ zanthSceneStartupChat();
+ }
+
+ _unk4 = 0;
+ _unk3 = -1;
+}
+
+int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar);
+ bool running = true;
+ bool unkFlag = false;
+ int8 updateType = -1;
+ int changedScene = 0;
+ const int *moveTableStart = moveTable;
+ _unk4 = 0;
+ while (running && !_quitFlag) {
+ if (*moveTable >= 0 && *moveTable <= 7) {
+ _mainCharacter.facing = getOppositeFacingDirection(*moveTable);
+ unkFlag = true;
+ } else {
+ if (*moveTable == 8) {
+ running = false;
+ } else {
+ ++moveTable;
+ unkFlag = false;
+ }
+ }
+
+ if (checkSceneChange()) {
+ running = false;
+ changedScene = 1;
+ }
+
+ if (unk1) {
+ if (skipFlag()) {
+ resetSkipFlag(false);
+ running = false;
+ _unk4 = 1;
+ }
+ }
+
+ if (!unkFlag || !running)
+ continue;
+
+ int ret = 0;
+ if (moveTable == moveTableStart || moveTable[1] == 8)
+ ret = updateCharPos(0);
+ else
+ ret = updateCharPos(moveTable);
+
+ if (ret)
+ ++moveTable;
+
+ ++updateType;
+ if (!updateType) {
+ update();
+ } else if (updateType == 1) {
+ refreshAnimObjectsIfNeed();
+ updateType = -1;
+ }
+ }
+
+ if (updateChar)
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+
+ if (!changedScene && !_unk4) {
+ //XXX
+ }
+ return changedScene;
+}
+
+int KyraEngine_HoF::checkSceneChange() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::checkSceneChange()");
+ SceneDesc &curScene = _sceneList[_mainCharacter.sceneId];
+ int charX = _mainCharacter.x1, charY = _mainCharacter.y1;
+ int facing = 0;
+ int process = 0;
+
+ if (_screen->getLayer(charX, charY) == 1 && _unk3 == -6) {
+ facing = 0;
+ process = 1;
+ } else if (charX >= 316 && _unk3 == -5) {
+ facing = 2;
+ process = 1;
+ } else if (charY >= 142 && _unk3 == -4) {
+ facing = 4;
+ process = 1;
+ } else if (charX <= 4 && _unk3 == -3) {
+ facing = 6;
+ process = 1;
+ }
+
+ if (!process)
+ return 0;
+
+ uint16 newScene = 0xFFFF;
+ switch (facing) {
+ case 0:
+ newScene = curScene.exit1;
+ break;
+
+ case 2:
+ newScene = curScene.exit2;
+ break;
+
+ case 4:
+ newScene = curScene.exit3;
+ break;
+
+ case 6:
+ newScene = curScene.exit4;
+ break;
+
+ default:
+ newScene = _mainCharacter.sceneId;
+ break;
+ }
+
+ if (newScene == 0xFFFF)
+ return 0;
+
+ enterNewScene(newScene, facing, 1, 1, 0);
+ return 1;
+}
+
+void KyraEngine_HoF::unloadScene() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::unloadScene()");
+ _emc->unload(&_sceneScriptData);
+ freeSceneShapePtrs();
+ freeSceneAnims();
+}
+
+void KyraEngine_HoF::loadScenePal() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadScenePal()");
+ uint16 sceneId = _mainCharacter.sceneId;
+ memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
+
+ char filename[14];
+ strcpy(filename, _sceneList[sceneId].filename1);
+ strcat(filename, ".COL");
+ _screen->loadBitmap(filename, 3, 3, 0);
+ memcpy(_screen->getPalette(1), _screen->getCPagePtr(3), 384);
+ memset(_screen->getPalette(1), 0, 3);
+ memcpy(_scenePal, _screen->getCPagePtr(3)+336, 432);
+}
+
+void KyraEngine_HoF::loadSceneMsc() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadSceneMsc()");
+ uint16 sceneId = _mainCharacter.sceneId;
+ char filename[14];
+ strcpy(filename, _sceneList[sceneId].filename1);
+ strcat(filename, ".MSC");
+ _screen->loadBitmap(filename, 3, 5, 0);
+}
+
+void KyraEngine_HoF::startSceneScript(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::startSceneScript(%d)", unk1);
+ uint16 sceneId = _mainCharacter.sceneId;
+ char filename[14];
+
+ strcpy(filename, _sceneList[sceneId].filename1);
+ if (sceneId == 68 && (queryGameFlag(0x1BC) || queryGameFlag(0x1BD)))
+ strcpy(filename, "DOORX");
+ strcat(filename, ".CPS");
+
+ _screen->loadBitmap(filename, 3, 3, 0);
+ resetScaleTable();
+ _useCharPal = false;
+ memset(_charPalTable, 0, sizeof(_charPalTable));
+ memset(_layerFlagTable, 0, sizeof(_layerFlagTable));
+ memset(_specialSceneScriptState, 0, sizeof(_specialSceneScriptState));
+
+ _sceneEnterX1 = 160;
+ _sceneEnterY1 = 0;
+ _sceneEnterX2 = 296;
+ _sceneEnterY2 = 72;
+ _sceneEnterX3 = 160;
+ _sceneEnterY3 = 128;
+ _sceneEnterX4 = 24;
+ _sceneEnterY4 = 72;
+
+ _sceneCommentString = "Undefined scene comment string!";
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
+
+ strcpy(filename, _sceneList[sceneId].filename1);
+ strcat(filename, ".");
+ strcat(filename, _scriptLangExt[(_flags.platform == Common::kPlatformPC && !_flags.isTalkie) ? 0 : _lang]);
+
+ _res->exists(filename, true);
+ _emc->load(filename, &_sceneScriptData, &_opcodes);
+ runSceneScript7();
+
+ _emc->start(&_sceneScriptState, 0);
+ _sceneScriptState.regs[0] = sceneId;
+ _sceneScriptState.regs[5] = unk1;
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+
+ memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
+
+ for (int i = 0; i < 10; ++i) {
+ _emc->init(&_sceneSpecialScripts[i], &_sceneScriptData);
+ _emc->start(&_sceneSpecialScripts[i], i+8);
+ _sceneSpecialScriptsTimer[i] = 0;
+ }
+
+ _sceneEnterX1 &= ~3;
+ _sceneEnterX2 &= ~3;
+ _sceneEnterX3 &= ~3;
+ _sceneEnterX4 &= ~3;
+ _sceneEnterY1 &= ~1;
+ _sceneEnterY2 &= ~1;
+ _sceneEnterY3 &= ~1;
+ _sceneEnterY4 &= ~1;
+}
+
+void KyraEngine_HoF::runSceneScript2() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript2()");
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
+ _sceneScriptState.regs[4] = _itemInHand;
+ _emc->start(&_sceneScriptState, 2);
+
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+}
+
+void KyraEngine_HoF::runSceneScript4(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript4(%d)", unk1);
+ _sceneScriptState.regs[4] = _itemInHand;
+ _sceneScriptState.regs[5] = unk1;
+
+ _emc->start(&_sceneScriptState, 4);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+}
+
+void KyraEngine_HoF::runSceneScript7() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript7()");
+ int oldPage = _screen->_curPage;
+ _screen->_curPage = 2;
+
+ _emc->start(&_sceneScriptState, 7);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+
+ _screen->_curPage = oldPage;
+}
+
+void KyraEngine_HoF::initSceneAnims(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::initSceneAnims(%d)", unk1);
+ for (int i = 0; i < ARRAYSIZE(_animObjects); ++i)
+ _animObjects[i].enabled = 0;
+
+ bool animInit = false;
+
+ AnimObj *animState = &_animObjects[0];
+
+ if (_mainCharacter.animFrame != 32)
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+
+ animState->enabled = 1;
+ animState->xPos1 = _mainCharacter.x1;
+ animState->yPos1 = _mainCharacter.y1;
+ animState->shapePtr = getShapePtr(_mainCharacter.animFrame);
+ animState->shapeIndex1 = animState->shapeIndex2 = _mainCharacter.animFrame;
+
+ int frame = _mainCharacter.animFrame - 9;
+ int shapeX = _shapeDescTable[frame].xAdd;
+ int shapeY = _shapeDescTable[frame].yAdd;
+
+ animState->xPos2 = _mainCharacter.x1;
+ animState->yPos2 = _mainCharacter.y1;
+
+ _charScale = getScale(_mainCharacter.x1, _mainCharacter.y1);
+
+ int shapeXScaled = (shapeX * _charScale) >> 8;
+ int shapeYScaled = (shapeY * _charScale) >> 8;
+
+ animState->xPos2 += shapeXScaled;
+ animState->yPos2 += shapeYScaled;
+ animState->xPos3 = animState->xPos2;
+ animState->yPos3 = animState->yPos2;
+ animState->needRefresh = 1;
+ animState->specialRefresh = 1;
+
+ _animList = 0;
+
+ AnimObj *charAnimState = animState;
+
+ for (int i = 0; i < 10; ++i) {
+ animState = &_animObjects[i+1];
+ animState->enabled = 0;
+ animState->needRefresh = 0;
+ animState->specialRefresh = 0;
+
+ if (_sceneAnims[i].flags & 1) {
+ animState->enabled = 1;
+ animState->needRefresh = 1;
+ animState->specialRefresh = 1;
+ }
+
+ animState->animFlags = _sceneAnims[i].flags & 8;
+
+ if (_sceneAnims[i].flags & 2)
+ animState->flags = 0x800;
+ else
+ animState->flags = 0;
+
+ if (_sceneAnims[i].flags & 4)
+ animState->flags |= 1;
+
+ animState->xPos1 = _sceneAnims[i].x;
+ animState->yPos1 = _sceneAnims[i].y;
+
+ if (_sceneAnims[i].flags & 0x20)
+ animState->shapePtr = _sceneShapeTable[_sceneAnims[i].shapeIndex];
+ else
+ animState->shapePtr = 0;
+
+ if (_sceneAnims[i].flags & 0x40) {
+ animState->shapeIndex3 = _sceneAnims[i].shapeIndex;
+ animState->animNum = i;
+ } else {
+ animState->shapeIndex3 = 0xFFFF;
+ animState->animNum = 0xFFFF;
+ }
+
+ animState->shapeIndex2 = 0xFFFF;
+
+ animState->xPos3 = animState->xPos2 = _sceneAnims[i].x2;
+ animState->yPos3 = animState->yPos2 = _sceneAnims[i].y2;
+ animState->width = _sceneAnims[i].width;
+ animState->height = _sceneAnims[i].height;
+ animState->width2 = animState->height2 = _sceneAnims[i].specialSize;
+
+ if (_sceneAnims[i].flags & 1) {
+ if (animInit) {
+ _animList = addToAnimListSorted(_animList, animState);
+ } else {
+ _animList = initAnimList(_animList, animState);
+ animInit = true;
+ }
+ }
+ }
+
+ if (animInit) {
+ _animList = addToAnimListSorted(_animList, charAnimState);
+ } else {
+ _animList = initAnimList(_animList, charAnimState);
+ animInit = true;
+ }
+
+ for (int i = 0; i < 30; ++i) {
+ animState = &_animObjects[i+11];
+
+ uint16 shapeIndex = _itemList[i].id;
+ if (shapeIndex == 0xFFFF || _itemList[i].sceneId != _mainCharacter.sceneId) {
+ animState->enabled = 0;
+ animState->needRefresh = 0;
+ animState->specialRefresh = 0;
+ } else {
+ animState->xPos1 = _itemList[i].x;
+ animState->yPos1 = _itemList[i].y;
+ animState->shapePtr = getShapePtr(64+shapeIndex);
+ animState->shapeIndex1 = animState->shapeIndex2 = shapeIndex+64;
+
+ animState->xPos2 = _itemList[i].x;
+ animState->yPos2 = _itemList[i].y;
+ int objectScale = getScale(animState->xPos2, animState->yPos2);
+
+ const uint8 *shape = getShapePtr(animState->shapeIndex1);
+ animState->xPos2 -= (_screen->getShapeScaledWidth(shape, objectScale) >> 1);
+ animState->yPos2 -= (_screen->getShapeScaledHeight(shape, objectScale) >> 1);
+ animState->xPos3 = animState->xPos2;
+ animState->yPos3 = animState->yPos2;
+
+ animState->enabled = 1;
+ animState->needRefresh = 1;
+ animState->specialRefresh = 1;
+
+ if (animInit) {
+ _animList = addToAnimListSorted(_animList, animState);
+ } else {
+ _animList = initAnimList(_animList, animState);
+ animInit = true;
+ }
+ }
+ }
+
+ _animObjects[0].specialRefresh = 1;
+ _animObjects[0].needRefresh = 1;
+
+ for (int i = 1; i < 41; ++i) {
+ if (_animObjects[i].enabled) {
+ _animObjects[i].needRefresh = 1;
+ _animObjects[i].specialRefresh = 1;
+ }
+ }
+
+ restorePage3();
+ drawAnimObjects();
+ _screen->hideMouse();
+ initSceneScreen(unk1);
+ _screen->showMouse();
+ refreshAnimObjects(0);
+}
+
+void KyraEngine_HoF::initSceneScreen(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::initSceneScreen(%d)", unk1);
+ if (_unkSceneScreenFlag1) {
+ _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
+ return;
+ }
+
+ if (_noScriptEnter) {
+ memset(_screen->getPalette(0), 0, 384);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
+
+ _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
+
+ if (_noScriptEnter) {
+ _screen->setScreenPalette(_screen->getPalette(1));
+ memcpy(_screen->getPalette(0), _screen->getPalette(1), 384);
+ }
+
+ updateCharPal(0);
+
+ _emc->start(&_sceneScriptState, 3);
+ _sceneScriptState.regs[5] = unk1;
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
+}
+
+void KyraEngine_HoF::freeSceneShapePtrs() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::freeSceneShapePtrs()");
+ for (int i = 0; i < ARRAYSIZE(_sceneShapeTable); ++i)
+ delete [] _sceneShapeTable[i];
+ memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
+}
+
+void KyraEngine_HoF::fadeScenePal(int srcIndex, int delayTime) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::fadeScenePal(%d, %d)", srcIndex, delayTime);
+ uint8 *dst = _screen->getPalette(0) + 336;
+ const uint8 *src = _scenePal + (srcIndex << 4)*3;
+ memcpy(dst, src, 48);
+
+ _screen->fadePalette(_screen->getPalette(0), delayTime, &_updateFunctor);
+}
+
+#pragma mark -
+#pragma mark - Pathfinder
+#pragma mark -
+
+bool KyraEngine_HoF::lineIsPassable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::lineIsPassable(%d, %d)", x, y);
+ static int unkTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 };
+
+ if (_pathfinderFlag & 2) {
+ if (x >= 320)
+ return false;
+ }
+
+ if (_pathfinderFlag & 4) {
+ if (y >= 144)
+ return false;
+ }
+
+ if (_pathfinderFlag & 8) {
+ if (x < 0)
+ return false;
+ }
+
+ if (y > 143)
+ return false;
+
+ int unk1 = unkTable[getScale(x, y) >> 5];
+
+ if (y < 0)
+ y = 0;
+ x -= unk1 >> 1;
+ if (x < 0)
+ x = 0;
+ int x2 = x + unk1;
+ if (x2 > 320)
+ x2 = 320;
+
+ for (;x < x2; ++x)
+ if (!_screen->getShapeFlag1(x, y))
+ return false;
+
+ return true;
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/scene_v3.cpp b/engines/kyra/scene_mr.cpp
index 27144ff505..196c87424d 100644
--- a/engines/kyra/scene_v3.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -23,15 +23,16 @@
*
*/
-#include "kyra/kyra_v3.h"
-#include "kyra/screen_v3.h"
+#include "kyra/kyra_mr.h"
+#include "kyra/screen_mr.h"
#include "kyra/wsamovie.h"
#include "kyra/sound.h"
+#include "kyra/resource.h"
namespace Kyra {
-void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewScene('%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, unk3);
+void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewScene('%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, unk3);
++_enterNewSceneLock;
_screen->hideMouse();
@@ -42,7 +43,10 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
}
musicUpdate(0);
- //XXX
+ if (_currentChapter != _currentTalkFile) {
+ _currentTalkFile = _currentChapter;
+ openTalkFile(_currentTalkFile);
+ }
musicUpdate(0);
if (!unk3) {
@@ -79,7 +83,7 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
musicUpdate(0);
uint32 waitUntilTimer = 0;
bool newSoundFile = false;
- if (_curMusicTrack != _sceneList[sceneId].sound) {
+ if (_lastMusicCommand != _sceneList[sceneId].sound) {
fadeOutMusic(60);
waitUntilTimer = _system->getMillis() + 60 * _tickLength;
newSoundFile = true;
@@ -88,21 +92,16 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
//XXX
if (!unk3) {
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
- _scriptInterpreter->startScript(&_sceneScriptState, 5);
- while (_scriptInterpreter->validScript(&_sceneScriptState)) {
- _scriptInterpreter->runScript(&_sceneScriptState);
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
+ _emc->start(&_sceneScriptState, 5);
+ while (_emc->isValid(&_sceneScriptState)) {
+ _emc->run(&_sceneScriptState);
musicUpdate(0);
}
}
musicUpdate(0);
- for (int i = 0; i < 10; ++i)
- _wsaSlots[i]->close();
-
- musicUpdate(0);
-
_specialExitCount = 0;
Common::set_to(_specialExitTable, _specialExitTable+ARRAYSIZE(_specialExitTable), 0xFFFF);
@@ -113,7 +112,6 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
musicUpdate(0);
unloadScene();
musicUpdate(0);
- //XXX resetMaskPage();
for (int i = 0; i < 4; ++i) {
if (i != _musicSoundChannel && i != _fadeOutMusicChannel)
@@ -125,7 +123,27 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
musicUpdate(0);
if (queryGameFlag(0x1D9)) {
- //XXX VQA code here
+ char filename[20];
+ if (queryGameFlag(0x20D)) {
+ resetGameFlag(0x20D);
+ strcpy(filename, "COW1_");
+ } else if (queryGameFlag(0x20E)) {
+ resetGameFlag(0x20E);
+ strcpy(filename, "COW2_");
+ } else if (queryGameFlag(0x20F)) {
+ resetGameFlag(0x20F);
+ strcpy(filename, "COW3_");
+ } else if (queryGameFlag(0x20C)) {
+ resetGameFlag(0x20C);
+ strcpy(filename, "BOAT");
+ } else if (queryGameFlag(0x210)) {
+ resetGameFlag(0x210);
+ strcpy(filename, "JUNG");
+ }
+
+ playVQA(filename);
+
+ resetGameFlag(0x1D9);
}
musicUpdate(0);
@@ -154,6 +172,7 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
_sceneScriptState.regs[3] = 1;
enterNewSceneUnk2(unk3);
if (queryGameFlag(0)) {
+ _showOutro = true;
_runFlag = false;
} else {
if (!--_enterNewSceneLock)
@@ -161,7 +180,7 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
setNextIdleAnimTimer();
- if (_itemInHand <= 0) {
+ if (_itemInHand < 0) {
_itemInHand = -1;
_handItemSet = -1;
_screen->setMouseCursor(0, 0, _gameShapes[0]);
@@ -174,8 +193,8 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
_screen->showMouse();
}
-void KyraEngine_v3::enterNewSceneUnk1(int facing, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2);
+void KyraEngine_MR::enterNewSceneUnk1(int facing, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2);
int x = 0, y = 0;
int x2 = 0, y2 = 0;
bool needProc = true;
@@ -264,16 +283,16 @@ void KyraEngine_v3::enterNewSceneUnk1(int facing, int unk1, int unk2) {
initSceneAnims(unk2);
if (_mainCharacter.sceneId == 9 && !_soundDigital->isPlaying(_musicSoundChannel))
- playMusicTrack(_sceneList[_mainCharacter.sceneId].sound, 0);
+ snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
if (!unk2)
- playMusicTrack(_sceneList[_mainCharacter.sceneId].sound, 0);
+ snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
if (unk1 && !unk2 && _mainCharacter.animFrame != 87)
moveCharacter(facing, x, y);
}
-void KyraEngine_v3::enterNewSceneUnk2(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewSceneUnk2(%d)", unk1);
+void KyraEngine_MR::enterNewSceneUnk2(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewSceneUnk2(%d)", unk1);
_unk3 = -1;
if (_mainCharX == -1 && _mainCharY == -1 && !unk1) {
_mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
@@ -290,12 +309,12 @@ void KyraEngine_v3::enterNewSceneUnk2(int unk1) {
_unk3 = -1;
}
-void KyraEngine_v3::unloadScene() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::unloadScene()");
+void KyraEngine_MR::unloadScene() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::unloadScene()");
delete [] _sceneStrings;
_sceneStrings = 0;
musicUpdate(0);
- _scriptInterpreter->unloadScript(&_sceneScriptData);
+ _emc->unload(&_sceneScriptData);
musicUpdate(0);
freeSceneShapes();
musicUpdate(0);
@@ -303,24 +322,16 @@ void KyraEngine_v3::unloadScene() {
musicUpdate(0);
}
-void KyraEngine_v3::freeSceneShapes() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::freeSceneShapes()");
+void KyraEngine_MR::freeSceneShapes() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::freeSceneShapes()");
for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i) {
delete [] _sceneShapes[i];
_sceneShapes[i] = 0;
}
}
-void KyraEngine_v3::freeSceneAnims() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::freeSceneAnims()");
- for (int i = 0; i < 16; ++i) {
- _sceneAnims[i].flags = 0;
- _sceneAnimMovie[i]->close();
- }
-}
-
-void KyraEngine_v3::loadScenePal() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadScenePal()");
+void KyraEngine_MR::loadScenePal() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadScenePal()");
char filename[16];
memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
strcpy(filename, _sceneList[_mainCharacter.sceneId].filename1);
@@ -339,12 +350,12 @@ void KyraEngine_v3::loadScenePal() {
_screen->generateOverlay(_screen->getPalette(2), _paletteOverlay, 0xF0, 0x19);
uint8 *palette = _screen->getPalette(2) + 432;
- const uint8 *costPal = _costPalBuffer + _malcolmShapes * 72;
+ const uint8 *costPal = _costPalBuffer + _characterShapeFile * 72;
memcpy(palette, costPal, 24*3);
}
-void KyraEngine_v3::loadSceneMsc() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadSceneMsc()");
+void KyraEngine_MR::loadSceneMsc() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadSceneMsc()");
char filename[16];
strcpy(filename, _sceneList[_mainCharacter.sceneId].filename1);
strcat(filename, ".MSC");
@@ -375,8 +386,8 @@ void KyraEngine_v3::loadSceneMsc() {
musicUpdate(0);
}
-void KyraEngine_v3::initSceneScript(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneScript(%d)", unk1);
+void KyraEngine_MR::initSceneScript(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneScript(%d)", unk1);
const SceneDesc &scene = _sceneList[_mainCharacter.sceneId];
musicUpdate(0);
@@ -438,31 +449,31 @@ void KyraEngine_v3::initSceneScript(int unk1) {
_sceneMinX = 0;
_sceneMaxX = 319;
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
strcpy(filename, scene.filename2);
strcat(filename, ".EMC");
musicUpdate(0);
_res->exists(filename, true);
- _scriptInterpreter->loadScript(filename, &_sceneScriptData, &_opcodes);
+ _emc->load(filename, &_sceneScriptData, &_opcodes);
- strcpy(filename, scene.filename1);
+ strcpy(filename, scene.filename2);
strcat(filename, ".");
loadLanguageFile(filename, _sceneStrings);
musicUpdate(0);
runSceneScript8();
- _scriptInterpreter->startScript(&_sceneScriptState, 0);
+ _emc->start(&_sceneScriptState, 0);
_sceneScriptState.regs[0] = _mainCharacter.sceneId;
_sceneScriptState.regs[5] = unk1;
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
_screen->copyRegionToBuffer(3, 0, 0, 320, 200, _gamePlayBuffer);
musicUpdate(0);
for (int i = 0; i < 10; ++i) {
- _scriptInterpreter->initScript(&_sceneSpecialScripts[i], &_sceneScriptData);
- _scriptInterpreter->startScript(&_sceneSpecialScripts[i], i+9);
+ _emc->init(&_sceneSpecialScripts[i], &_sceneScriptData);
+ _emc->start(&_sceneSpecialScripts[i], i+9);
musicUpdate(0);
_sceneSpecialScriptsTimer[i] = 0;
}
@@ -478,8 +489,8 @@ void KyraEngine_v3::initSceneScript(int unk1) {
musicUpdate(0);
}
-void KyraEngine_v3::initSceneAnims(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneAnims(%d)", unk1);
+void KyraEngine_MR::initSceneAnims(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneAnims(%d)", unk1);
for (int i = 0; i < 67; ++i)
_animObjects[i].enabled = false;
@@ -492,7 +503,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) {
obj->xPos1 = _mainCharacter.x1;
obj->yPos1 = _mainCharacter.y1;
obj->shapePtr = getShapePtr(_mainCharacter.animFrame);
- obj->shapeIndex2 = obj->shapeIndex = _mainCharacter.animFrame;
+ obj->shapeIndex2 = obj->shapeIndex1 = _mainCharacter.animFrame;
obj->xPos2 = _mainCharacter.x1;
obj->yPos2 = _mainCharacter.y1;
_charScale = getScale(_mainCharacter.x1, _mainCharacter.y1);
@@ -514,7 +525,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) {
obj->needRefresh = true;
}
- obj->unk8 = (anim.flags & 0x20) ? 1 : 0;
+ obj->specialRefresh = (anim.flags & 0x20) ? 1 : 0;
obj->flags = (anim.flags & 0x10) ? 0x800 : 0;
if (anim.flags & 2)
obj->flags |= 1;
@@ -522,7 +533,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) {
obj->xPos1 = anim.x;
obj->yPos1 = anim.y;
- if ((anim.flags & 4) && anim.shapeIndex != 0xFFFF)
+ if ((anim.flags & 4) && anim.shapeIndex != -1)
obj->shapePtr = _sceneShapes[anim.shapeIndex];
else
obj->shapePtr = 0;
@@ -562,12 +573,12 @@ void KyraEngine_v3::initSceneAnims(int unk1) {
obj->yPos1 = item.y;
animSetupPaletteEntry(obj);
obj->shapePtr = 0;
- obj->shapeIndex = obj->shapeIndex2 = item.id + 248;
+ obj->shapeIndex1 = obj->shapeIndex2 = item.id + 248;
obj->xPos2 = item.x;
obj->yPos2 = item.y;
int scale = getScale(obj->xPos1, obj->yPos1);
- const uint8 *shape = getShapePtr(obj->shapeIndex);
+ const uint8 *shape = getShapePtr(obj->shapeIndex1);
obj->xPos3 = obj->xPos2 -= (_screen->getShapeScaledWidth(shape, scale) >> 1);
obj->yPos3 = obj->yPos2 -= _screen->getShapeScaledHeight(shape, scale) - 1;
obj->enabled = true;
@@ -594,8 +605,8 @@ void KyraEngine_v3::initSceneAnims(int unk1) {
refreshAnimObjects(0);
}
-void KyraEngine_v3::initSceneScreen(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneScreen(%d)", unk1);
+void KyraEngine_MR::initSceneScreen(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneScreen(%d)", unk1);
_screen->copyBlockToPage(2, 0, 188, 320, 12, _interfaceCommandLine);
if (_unkSceneScreenFlag1) {
@@ -605,65 +616,35 @@ void KyraEngine_v3::initSceneScreen(int unk1) {
if (_noScriptEnter) {
memset(_screen->getPalette(0), 0, 432);
- if (!_wsaPlayingVQA)
+ if (!_wasPlayingVQA)
_screen->setScreenPalette(_screen->getPalette(0));
}
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
if (_noScriptEnter) {
- if (!_wsaPlayingVQA)
+ if (!_wasPlayingVQA)
_screen->setScreenPalette(_screen->getPalette(2));
memcpy(_screen->getPalette(0), _screen->getPalette(2), 432);
- if (_wsaPlayingVQA) {
+ if (_wasPlayingVQA) {
_screen->fadeFromBlack(0x3C);
- _wsaPlayingVQA = false;
+ _wasPlayingVQA = false;
}
}
updateCharPal(0);
- if (1/*!_menuDirectlyToLoad*/) {
- _scriptInterpreter->startScript(&_sceneScriptState, 3);
+ if (!_menuDirectlyToLoad) {
+ _emc->start(&_sceneScriptState, 3);
_sceneScriptState.regs[5] = unk1;
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
- }
-}
-
-void KyraEngine_v3::updateSpecialSceneScripts() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateSpecialSceneScripts()");
- uint32 nextTime = _system->getMillis() + _tickLength;
- const int startScript = _lastProcessedSceneScript;
-
- while (_system->getMillis() <= nextTime) {
- if (_sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis() &&
- !_specialSceneScriptState[_lastProcessedSceneScript]) {
- _specialSceneScriptRunFlag = true;
-
- while (_specialSceneScriptRunFlag && _sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis()) {
- if (!_scriptInterpreter->runScript(&_sceneSpecialScripts[_lastProcessedSceneScript]))
- _specialSceneScriptRunFlag = false;
- }
- }
-
- if (!_scriptInterpreter->validScript(&_sceneSpecialScripts[_lastProcessedSceneScript])) {
- _scriptInterpreter->startScript(&_sceneSpecialScripts[_lastProcessedSceneScript], 9+_lastProcessedSceneScript);
- _specialSceneScriptRunFlag = false;
- }
-
- ++_lastProcessedSceneScript;
- if (_lastProcessedSceneScript >= 10)
- _lastProcessedSceneScript = 0;
-
- if (_lastProcessedSceneScript == startScript)
- return;
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
}
}
-int KyraEngine_v3::trySceneChange(int *moveTable, int unk1, int updateChar) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar);
+int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar);
bool running = true;
bool unkFlag = false;
int changedScene = 0;
@@ -689,7 +670,9 @@ int KyraEngine_v3::trySceneChange(int *moveTable, int unk1, int updateChar) {
}
if (unk1) {
- if (skipFlag()) {
+ // Notice that we can't use KyraEngine_MR's skipFlag handling
+ // here, since Kyra3 allows disabling of skipFlag support
+ if (KyraEngine_v2::skipFlag()) {
resetSkipFlag(false);
running = false;
_unk4 = 1;
@@ -720,8 +703,8 @@ int KyraEngine_v3::trySceneChange(int *moveTable, int unk1, int updateChar) {
return changedScene;
}
-int KyraEngine_v3::checkSceneChange() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::checkSceneChange()");
+int KyraEngine_MR::checkSceneChange() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::checkSceneChange()");
const SceneDesc &curScene = _sceneList[_mainCharacter.sceneId];
int charX = _mainCharacter.x1, charY = _mainCharacter.y1;
int facing = 0;
@@ -773,97 +756,66 @@ int KyraEngine_v3::checkSceneChange() {
enterNewScene(newScene, facing, 1, 1, 0);
return 1;
}
-int KyraEngine_v3::runSceneScript1(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript1(%d, %d)", x, y);
+int KyraEngine_MR::runSceneScript1(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript1(%d, %d)", x, y);
if (y > 187 && _unk3 > -4)
return 0;
if (_deathHandler >= 0)
return 0;
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
_sceneScriptState.regs[1] = x;
_sceneScriptState.regs[2] = y;
_sceneScriptState.regs[3] = 0;
_sceneScriptState.regs[4] = _itemInHand;
- _scriptInterpreter->startScript(&_sceneScriptState, 1);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
+ _emc->start(&_sceneScriptState, 1);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
return _sceneScriptState.regs[3];
}
-int KyraEngine_v3::runSceneScript2() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript2()");
+int KyraEngine_MR::runSceneScript2() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript2()");
_sceneScriptState.regs[1] = _mouseX;
_sceneScriptState.regs[2] = _mouseY;
_sceneScriptState.regs[3] = 0;
_sceneScriptState.regs[4] = _itemInHand;
- _scriptInterpreter->startScript(&_sceneScriptState, 2);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
+ _emc->start(&_sceneScriptState, 2);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
return _sceneScriptState.regs[3];
}
-void KyraEngine_v3::runSceneScript4(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript4(%d)", unk1);
+void KyraEngine_MR::runSceneScript4(int unk1) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript4(%d)", unk1);
_sceneScriptState.regs[4] = _itemInHand;
_sceneScriptState.regs[5] = unk1;
_sceneScriptState.regs[3] = 0;
_noStartupChat = false;
- _scriptInterpreter->startScript(&_sceneScriptState, 4);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
+ _emc->start(&_sceneScriptState, 4);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
if (_sceneScriptState.regs[3])
_noStartupChat = true;
}
-void KyraEngine_v3::runSceneScript6() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript6()");
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
-
- _sceneScriptState.regs[0] = _mainCharacter.sceneId;
- _sceneScriptState.regs[1] = _mouseX;
- _sceneScriptState.regs[2] = _mouseY;
- _sceneScriptState.regs[3] = _itemInHand;
-
- _scriptInterpreter->startScript(&_sceneScriptState, 6);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-}
-
-void KyraEngine_v3::runSceneScript8() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript8()");
- _scriptInterpreter->startScript(&_sceneScriptState, 8);
- while (_scriptInterpreter->validScript(&_sceneScriptState)) {
+void KyraEngine_MR::runSceneScript8() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript8()");
+ _emc->start(&_sceneScriptState, 8);
+ while (_emc->isValid(&_sceneScriptState)) {
musicUpdate(0);
- _scriptInterpreter->runScript(&_sceneScriptState);
+ _emc->run(&_sceneScriptState);
}
}
-bool KyraEngine_v3::checkSpecialSceneExit(int index, int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::checkSpecialSceneExit(%d, %d, %d)", index, x, y);
- if (_specialExitTable[index] < x && _specialExitTable[5+index] < y &&
- _specialExitTable[10+index] > x && _specialExitTable[15+index] > y)
- return true;
-
- return false;
-}
-
-int KyraEngine_v3::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
- int ret = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize);
- if (ret == 0x7D00)
- return 0;
- return getMoveTableSize(moveTable);
-}
-
-bool KyraEngine_v3::lineIsPassable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::lineIsPassable(%d, %d)", x, y);
+bool KyraEngine_MR::lineIsPassable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::lineIsPassable(%d, %d)", x, y);
static const uint8 widthTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 };
if ((_pathfinderFlag & 2) && x >= 320)
diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp
index c531ac11e5..c5d1de82a9 100644
--- a/engines/kyra/scene_v1.cpp
+++ b/engines/kyra/scene_v1.cpp
@@ -135,10 +135,10 @@ void KyraEngine_v1::enterNewScene(int sceneId, int facing, int unk1, int unk2, i
_movieObjects[i]->close();
if (!brandonAlive) {
- _scriptInterpreter->initScript(_scriptClick, _scriptClickData);
- _scriptInterpreter->startScript(_scriptClick, 5);
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _emc->start(&_scriptClick, 5);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
}
memset(_entranceMouseCursorTracks, 0xFFFF, sizeof(uint16)*4);
@@ -159,7 +159,7 @@ void KyraEngine_v1::enterNewScene(int sceneId, int facing, int unk1, int unk2, i
strcat(fileNameBuffer, ".DAT");
_sprites->loadDat(fileNameBuffer, _sceneExits);
_sprites->setupSceneAnims();
- _scriptInterpreter->unloadScript(_scriptClickData);
+ _emc->unload(&_scriptClickData);
loadSceneMsc();
_walkBlockNorth = currentRoom->northExit;
@@ -424,18 +424,18 @@ void KyraEngine_v1::startSceneScript(int brandonAlive) {
_scaleTable[i] = 256;
clearNoDropRects();
- _scriptInterpreter->initScript(_scriptClick, _scriptClickData);
+ _emc->init(&_scriptClick, &_scriptClickData);
strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
strcat(fileNameBuffer, ".EMC");
_res->exists(fileNameBuffer, true);
- _scriptInterpreter->unloadScript(_scriptClickData);
- _scriptInterpreter->loadScript(fileNameBuffer, _scriptClickData, &_opcodes);
- _scriptInterpreter->startScript(_scriptClick, 0);
- _scriptClick->regs[0] = _currentCharacter->sceneId;
- _scriptClick->regs[7] = brandonAlive;
-
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ _emc->unload(&_scriptClickData);
+ _emc->load(fileNameBuffer, &_scriptClickData, &_opcodes);
+ _emc->start(&_scriptClick, 0);
+ _scriptClick.regs[0] = _currentCharacter->sceneId;
+ _scriptClick.regs[7] = brandonAlive;
+
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
}
void KyraEngine_v1::initSceneData(int facing, int unk1, int brandonAlive) {
@@ -601,11 +601,11 @@ void KyraEngine_v1::initSceneData(int facing, int unk1, int brandonAlive) {
if (unk1 && brandonAlive == 0)
moveCharacterToPos(0, facing, xpos2, ypos2);
- _scriptClick->regs[4] = _itemInHand;
- _scriptClick->regs[7] = brandonAlive;
- _scriptInterpreter->startScript(_scriptClick, 3);
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ _scriptClick.regs[4] = _itemInHand;
+ _scriptClick.regs[7] = brandonAlive;
+ _emc->start(&_scriptClick, 3);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
}
void KyraEngine_v1::initSceneObjectList(int brandonAlive) {
@@ -615,7 +615,7 @@ void KyraEngine_v1::initSceneObjectList(int brandonAlive) {
int startAnimFrame = 0;
- AnimObject *curAnimState = _animator->actors();
+ Animator_v1::AnimObject *curAnimState = _animator->actors();
curAnimState->active = 1;
curAnimState->drawY = _currentCharacter->y1;
curAnimState->sceneAnimPtr = _shapes[_currentCharacter->currentAnimFrame];
@@ -827,13 +827,13 @@ void KyraEngine_v1::initSceneScreen(int brandonAlive) {
}
}
- if (!_scriptInterpreter->startScript(_scriptClick, 2))
+ if (!_emc->start(&_scriptClick, 2))
error("Could not start script function 2 of scene script");
- _scriptClick->regs[7] = brandonAlive;
+ _scriptClick.regs[7] = brandonAlive;
- while (_scriptInterpreter->validScript(_scriptClick))
- _scriptInterpreter->runScript(_scriptClick);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
setTextFadeTimerCountdown(-1);
if (_currentCharacter->sceneId == 210) {
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index 80353eb468..5d811bcf44 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -24,692 +24,20 @@
*/
#include "kyra/kyra_v2.h"
-#include "kyra/screen_v2.h"
-#include "kyra/sound.h"
-#include "kyra/wsamovie.h"
-
-#include "common/func.h"
+#include "kyra/screen.h"
namespace Kyra {
-void KyraEngine_v2::enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewScene(%d, %d, %d, %d, %d)", newScene, facing, unk1, unk2, unk3);
- if (_newChapterFile != _currentTalkFile) {
- _currentTalkFile = _newChapterFile;
- if (_flags.isTalkie) {
- showMessageFromCCode(265, 150, 0);
- _screen->updateScreen();
- openTalkFile(_currentTalkFile);
- }
- showMessage(0, 207);
- _screen->updateScreen();
- }
-
- _screen->hideMouse();
-
- if (!unk3) {
- updateWaterFlasks();
- displayInvWsaLastFrame();
- }
-
- if (unk1) {
- int x = _mainCharacter.x1;
- int y = _mainCharacter.y1;
-
- switch (facing) {
- case 0:
- y -= 6;
- break;
-
- case 2:
- x = 335;
- break;
-
- case 4:
- y = 147;
- break;
-
- case 6:
- x = -16;
- break;
-
- default:
- break;
- }
-
- moveCharacter(facing, x, y);
- }
-
- bool newSoundFile = false;
- uint32 waitTime = 0;
- if (_sceneList[newScene].sound != _lastMusicCommand) {
- newSoundFile = true;
- waitTime = _system->getMillis() + 1000;
- _sound->beginFadeOut();
- }
-
- _chatAltFlag = false;
-
- if (!unk3) {
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
- _scriptInterpreter->startScript(&_sceneScriptState, 5);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
- }
-
- Common::for_each(_wsaSlots, _wsaSlots+ARRAYSIZE(_wsaSlots), Common::mem_fun(&WSAMovieV2::close));
- _specialExitCount = 0;
- memset(_specialExitTable, -1, sizeof(_specialExitTable));
-
- _mainCharacter.sceneId = newScene;
- _sceneList[newScene].flags &= ~1;
- loadScenePal();
- unloadScene();
- loadSceneMsc();
-
- SceneDesc &scene = _sceneList[newScene];
- _sceneExit1 = scene.exit1;
- _sceneExit2 = scene.exit2;
- _sceneExit3 = scene.exit3;
- _sceneExit4 = scene.exit4;
-
- if (newSoundFile) {
- if (_sound->getMusicType() == Sound::kAdlib) {
- while (_sound->isPlaying())
- _system->delayMillis(10);
- } else {
- while (waitTime > _system->getMillis())
- _system->delayMillis(10);
- }
- snd_loadSoundFile(_sceneList[newScene].sound);
- }
-
- startSceneScript(unk3);
-
- if (_overwriteSceneFacing) {
- facing = _mainCharacter.facing;
- _overwriteSceneFacing = false;
- }
-
- enterNewSceneUnk1(facing, unk2, unk3);
-
- setTimer1DelaySecs(-1);
- _sceneScriptState.regs[3] = 1;
- enterNewSceneUnk2(unk3);
- _screen->showMouse();
- _unk5 = 0;
- setNextIdleAnimTimer();
-
- _currentScene = newScene;
-}
-
-void KyraEngine_v2::enterNewSceneUnk1(int facing, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2);
- int x = 0, y = 0;
- int x2 = 0, y2 = 0;
- bool needProc = true;
-
- if (_mainCharX == -1 && _mainCharY == -1) {
- switch (facing+1) {
- case 1: case 2: case 8:
- x2 = _sceneEnterX3;
- y2 = _sceneEnterY3;
- break;
-
- case 3:
- x2 = _sceneEnterX4;
- y2 = _sceneEnterY4;
- break;
-
- case 4: case 5: case 6:
- x2 = _sceneEnterX1;
- y2 = _sceneEnterY1;
- break;
-
- case 7:
- x2 = _sceneEnterX2;
- y2 = _sceneEnterY2;
- break;
-
- default:
- x2 = y2 = -1;
- break;
- }
-
- if (x2 >= 316)
- x2 = 312;
- if (y2 >= 141)
- y2 = 139;
- if (x2 <= 4)
- x2 = 8;
- }
-
- if (_mainCharX >= 0) {
- x = x2 = _mainCharX;
- needProc = false;
- }
-
- if (_mainCharY >= 0) {
- y = y2 = _mainCharY;
- needProc = false;
- }
-
- _mainCharX = _mainCharY = -1;
-
- if (unk1 && needProc) {
- x = x2;
- y = y2;
-
- switch (facing) {
- case 0:
- y2 = 147;
- break;
-
- case 2:
- x2 = -16;
- break;
-
- case 4:
- y2 = y - 4;
- break;
-
- case 6:
- x2 = 335;
- break;
-
- default:
- break;
- }
- }
-
- x2 &= ~3;
- x &= ~3;
- y2 &= ~1;
- y &= ~1;
-
- _mainCharacter.facing = facing;
- _mainCharacter.x1 = _mainCharacter.x2 = x2;
- _mainCharacter.y1 = _mainCharacter.y2 = y2;
- initSceneAnims(unk2);
-
- if (!unk2)
- snd_playWanderScoreViaMap(_sceneList[_mainCharacter.sceneId].sound, 0);
-
- if (unk1 && !unk2 && _mainCharacter.animFrame != 32)
- moveCharacter(facing, x, y);
-}
-
-void KyraEngine_v2::enterNewSceneUnk2(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewSceneUnk2(%d)", unk1);
- _unk3 = -1;
-
- if (_flags.isTalkie) {
- if (_mainCharX == -1 && _mainCharY == -1 && _mainCharacter.sceneId != 61 &&
- !queryGameFlag(0x1F1) && !queryGameFlag(0x192) && !queryGameFlag(0x193) &&
- _mainCharacter.sceneId != 70 && !queryGameFlag(0x159) && _mainCharacter.sceneId != 37) {
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
- }
- } else if (_mainCharX != -1 && _mainCharY != -1) {
- if (_characterFrameTable[_mainCharacter.facing] == 25)
- _mainCharacter.facing = 5;
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
- }
-
- if (!unk1) {
- runSceneScript4(0);
- zanthSceneStartupChat();
- }
-
- _unk4 = 0;
- _unk3 = -1;
-}
-
-int KyraEngine_v2::trySceneChange(int *moveTable, int unk1, int updateChar) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar);
- bool running = true;
- bool unkFlag = false;
- int8 updateType = -1;
- int changedScene = 0;
- const int *moveTableStart = moveTable;
- _unk4 = 0;
- while (running && !_quitFlag) {
- if (*moveTable >= 0 && *moveTable <= 7) {
- _mainCharacter.facing = getOppositeFacingDirection(*moveTable);
- unkFlag = true;
- } else {
- if (*moveTable == 8) {
- running = false;
- } else {
- ++moveTable;
- unkFlag = false;
- }
- }
-
- if (checkSceneChange()) {
- running = false;
- changedScene = 1;
- }
-
- if (unk1) {
- if (skipFlag()) {
- resetSkipFlag(false);
- running = false;
- _unk4 = 1;
- }
- }
-
- if (!unkFlag || !running)
- continue;
-
- int ret = 0;
- if (moveTable == moveTableStart || moveTable[1] == 8)
- ret = updateCharPos(0);
- else
- ret = updateCharPos(moveTable);
-
- if (ret)
- ++moveTable;
-
- ++updateType;
- if (!updateType) {
- update();
- } else if (updateType == 1) {
- refreshAnimObjectsIfNeed();
- updateType = -1;
- }
- }
-
- if (updateChar)
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
-
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
-
- if (!changedScene && !_unk4) {
- //XXX
- }
- return changedScene;
-}
-
-int KyraEngine_v2::checkSceneChange() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::checkSceneChange()");
- SceneDesc &curScene = _sceneList[_mainCharacter.sceneId];
- int charX = _mainCharacter.x1, charY = _mainCharacter.y1;
- int facing = 0;
- int process = 0;
-
- if (_screen->getLayer(charX, charY) == 1 && _unk3 == -6) {
- facing = 0;
- process = 1;
- } else if (charX >= 316 && _unk3 == -5) {
- facing = 2;
- process = 1;
- } else if (charY >= 142 && _unk3 == -4) {
- facing = 4;
- process = 1;
- } else if (charX <= 4 && _unk3 == -3) {
- facing = 6;
- process = 1;
- }
-
- if (!process)
- return 0;
-
- uint16 newScene = 0xFFFF;
- switch (facing) {
- case 0:
- newScene = curScene.exit1;
- break;
-
- case 2:
- newScene = curScene.exit2;
- break;
-
- case 4:
- newScene = curScene.exit3;
- break;
-
- case 6:
- newScene = curScene.exit4;
- break;
-
- default:
- newScene = _mainCharacter.sceneId;
- break;
- }
-
- if (newScene == 0xFFFF)
- return 0;
-
- enterNewScene(newScene, facing, 1, 1, 0);
- return 1;
-}
-
-void KyraEngine_v2::unloadScene() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::unloadScene()");
- _scriptInterpreter->unloadScript(&_sceneScriptData);
- freeSceneShapePtrs();
- freeSceneAnims();
-}
-
-void KyraEngine_v2::loadScenePal() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::loadScenePal()");
- uint16 sceneId = _mainCharacter.sceneId;
- memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
-
- char filename[14];
- strcpy(filename, _sceneList[sceneId].filename);
- strcat(filename, ".COL");
- _screen->loadBitmap(filename, 3, 3, 0);
- memcpy(_screen->getPalette(1), _screen->getCPagePtr(3), 384);
- memset(_screen->getPalette(1), 0, 3);
- memcpy(_scenePal, _screen->getCPagePtr(3)+336, 432);
-}
-
-void KyraEngine_v2::loadSceneMsc() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::loadSceneMsc()");
- uint16 sceneId = _mainCharacter.sceneId;
- char filename[14];
- strcpy(filename, _sceneList[sceneId].filename);
- strcat(filename, ".MSC");
- _screen->loadBitmap(filename, 3, 5, 0);
-}
-
-void KyraEngine_v2::startSceneScript(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::startSceneScript(%d)", unk1);
- uint16 sceneId = _mainCharacter.sceneId;
- char filename[14];
-
- strcpy(filename, _sceneList[sceneId].filename);
- if (sceneId == 68 && (queryGameFlag(0x1BC) || queryGameFlag(0x1BD)))
- strcpy(filename, "DOORX");
- strcat(filename, ".CPS");
-
- _screen->loadBitmap(filename, 3, 3, 0);
- resetScaleTable();
- _useCharPal = false;
- memset(_charPalTable, 0, sizeof(_charPalTable));
- memset(_layerFlagTable, 0, sizeof(_layerFlagTable));
- memset(_specialSceneScriptState, 0, sizeof(_specialSceneScriptState));
-
- _sceneEnterX1 = 160;
- _sceneEnterY1 = 0;
- _sceneEnterX2 = 296;
- _sceneEnterY2 = 72;
- _sceneEnterX3 = 160;
- _sceneEnterY3 = 128;
- _sceneEnterX4 = 24;
- _sceneEnterY4 = 72;
-
- _sceneCommentString = "Undefined scene comment string!";
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
-
- strcpy(filename, _sceneList[sceneId].filename);
- strcat(filename, ".");
- strcat(filename, _scriptLangExt[(_flags.platform == Common::kPlatformPC && !_flags.isTalkie) ? 0 : _lang]);
-
- _res->exists(filename, true);
- _scriptInterpreter->loadScript(filename, &_sceneScriptData, &_opcodes);
- runSceneScript7();
-
- _scriptInterpreter->startScript(&_sceneScriptState, 0);
- _sceneScriptState.regs[0] = sceneId;
- _sceneScriptState.regs[5] = unk1;
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-
- memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
-
- for (int i = 0; i < 10; ++i) {
- _scriptInterpreter->initScript(&_sceneSpecialScripts[i], &_sceneScriptData);
- _scriptInterpreter->startScript(&_sceneSpecialScripts[i], i+8);
- _sceneSpecialScriptsTimer[i] = 0;
- }
-
- _sceneEnterX1 &= ~3;
- _sceneEnterX2 &= ~3;
- _sceneEnterX3 &= ~3;
- _sceneEnterX4 &= ~3;
- _sceneEnterY1 &= ~1;
- _sceneEnterY2 &= ~1;
- _sceneEnterY3 &= ~1;
- _sceneEnterY4 &= ~1;
-}
-
-void KyraEngine_v2::runSceneScript2() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript2()");
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
- _sceneScriptState.regs[4] = _itemInHand;
- _scriptInterpreter->startScript(&_sceneScriptState, 2);
-
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-}
-
-void KyraEngine_v2::runSceneScript4(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript4(%d)", unk1);
- _sceneScriptState.regs[4] = _itemInHand;
- _sceneScriptState.regs[5] = unk1;
-
- _scriptInterpreter->startScript(&_sceneScriptState, 4);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-}
-
-void KyraEngine_v2::runSceneScript6() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript6()");
- _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData);
-
- _sceneScriptState.regs[0] = _mainCharacter.sceneId;
- _sceneScriptState.regs[1] = _mouseX;
- _sceneScriptState.regs[2] = _mouseY;
- _sceneScriptState.regs[4] = _itemInHand;
-
- _scriptInterpreter->startScript(&_sceneScriptState, 6);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-}
-
-void KyraEngine_v2::runSceneScript7() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript7()");
- int oldPage = _screen->_curPage;
- _screen->_curPage = 2;
-
- _scriptInterpreter->startScript(&_sceneScriptState, 7);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
-
- _screen->_curPage = oldPage;
-}
-
-void KyraEngine_v2::initSceneAnims(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::initSceneAnims(%d)", unk1);
- for (int i = 0; i < ARRAYSIZE(_animObjects); ++i)
- _animObjects[i].enabled = 0;
-
- bool animInit = false;
-
- AnimObj *animState = &_animObjects[0];
-
- if (_mainCharacter.animFrame != 32)
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
-
- animState->enabled = 1;
- animState->xPos1 = _mainCharacter.x1;
- animState->yPos1 = _mainCharacter.y1;
- animState->shapePtr = _defaultShapeTable[_mainCharacter.animFrame];
- animState->shapeIndex1 = animState->shapeIndex2 = _mainCharacter.animFrame;
-
- int frame = _mainCharacter.animFrame - 9;
- int shapeX = _shapeDescTable[frame].xAdd;
- int shapeY = _shapeDescTable[frame].yAdd;
-
- animState->xPos2 = _mainCharacter.x1;
- animState->yPos2 = _mainCharacter.y1;
-
- _charScaleX = _charScaleY = getScale(_mainCharacter.x1, _mainCharacter.y1);
-
- int shapeXScaled = (shapeX * _charScaleX) >> 8;
- int shapeYScaled = (shapeY * _charScaleY) >> 8;
-
- animState->xPos2 += shapeXScaled;
- animState->yPos2 += shapeYScaled;
- animState->xPos3 = animState->xPos2;
- animState->yPos3 = animState->yPos2;
- animState->needRefresh = 1;
- animState->unk8 = 1;
-
- _animList = 0;
-
- AnimObj *charAnimState = animState;
-
- for (int i = 0; i < 10; ++i) {
- animState = &_animObjects[i+1];
- animState->enabled = 0;
- animState->needRefresh = 0;
- animState->unk8 = 0;
-
- if (_sceneAnims[i].flags & 1) {
- animState->enabled = 1;
- animState->needRefresh = 1;
- animState->unk8 = 1;
- }
-
- animState->animFlags = _sceneAnims[i].flags & 8;
-
- if (_sceneAnims[i].flags & 2)
- animState->flags = 0x800;
- else
- animState->flags = 0;
-
- if (_sceneAnims[i].flags & 4)
- animState->flags |= 1;
-
- animState->xPos1 = _sceneAnims[i].x;
- animState->yPos1 = _sceneAnims[i].y;
-
- if (_sceneAnims[i].flags & 0x20)
- animState->shapePtr = _sceneShapeTable[_sceneAnims[i].shapeIndex];
- else
- animState->shapePtr = 0;
-
- if (_sceneAnims[i].flags & 0x40) {
- animState->shapeIndex3 = _sceneAnims[i].shapeIndex;
- animState->animNum = i;
- } else {
- animState->shapeIndex3 = 0xFFFF;
- animState->animNum = 0xFFFF;
- }
-
- animState->shapeIndex2 = 0xFFFF;
-
- animState->xPos3 = animState->xPos2 = _sceneAnims[i].x2;
- animState->yPos3 = animState->yPos2 = _sceneAnims[i].y2;
- animState->width = _sceneAnims[i].width;
- animState->height = _sceneAnims[i].height;
- animState->width2 = animState->height2 = _sceneAnims[i].specialSize;
-
- if (_sceneAnims[i].flags & 1) {
- if (animInit) {
- _animList = addToAnimListSorted(_animList, animState);
- } else {
- _animList = initAnimList(_animList, animState);
- animInit = true;
- }
- }
- }
-
- if (animInit) {
- _animList = addToAnimListSorted(_animList, charAnimState);
- } else {
- _animList = initAnimList(_animList, charAnimState);
- animInit = true;
- }
-
- for (int i = 0; i < 30; ++i) {
- animState = &_animObjects[i+11];
-
- uint16 shapeIndex = _itemList[i].id;
- if (shapeIndex == 0xFFFF || _itemList[i].sceneId != _mainCharacter.sceneId) {
- animState->enabled = 0;
- animState->needRefresh = 0;
- animState->unk8 = 0;
- } else {
- animState->xPos1 = _itemList[i].x;
- animState->yPos1 = _itemList[i].y;
- animState->shapePtr = _defaultShapeTable[64+shapeIndex];
- animState->shapeIndex1 = animState->shapeIndex2 = shapeIndex+64;
-
- animState->xPos2 = _itemList[i].x;
- animState->yPos2 = _itemList[i].y;
- int objectScale = getScale(animState->xPos2, animState->yPos2);
-
- const uint8 *shape = getShapePtr(animState->shapeIndex1);
- animState->xPos2 -= (_screen->getShapeScaledWidth(shape, objectScale) >> 1);
- animState->yPos2 -= (_screen->getShapeScaledHeight(shape, objectScale) >> 1);
- animState->xPos3 = animState->xPos2;
- animState->yPos3 = animState->yPos2;
-
- animState->enabled = 1;
- animState->needRefresh = 1;
- animState->unk8 = 1;
-
- if (animInit) {
- _animList = addToAnimListSorted(_animList, animState);
- } else {
- _animList = initAnimList(_animList, animState);
- animInit = true;
- }
- }
- }
-
- _animObjects[0].unk8 = 1;
- _animObjects[0].needRefresh = 1;
-
- for (int i = 1; i < 41; ++i) {
- if (_animObjects[i].enabled) {
- _animObjects[i].needRefresh = 1;
- _animObjects[i].unk8 = 1;
- }
- }
-
- restorePage3();
- drawAnimObjects();
- _screen->hideMouse();
- initSceneScreen(unk1);
- _screen->showMouse();
- refreshAnimObjects(0);
-}
-
-void KyraEngine_v2::initSceneScreen(int unk1) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::initSceneScreen(%d)", unk1);
- if (_unkSceneScreenFlag1) {
- _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
- return;
- }
-
- if (_noScriptEnter) {
- memset(_screen->getPalette(0), 0, 384);
- _screen->setScreenPalette(_screen->getPalette(0));
- }
+void KyraEngine_v2::freeSceneAnims() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneAnims()");
- _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK);
+ for (int i = 0; i < ARRAYSIZE(_sceneAnims); ++i)
+ _sceneAnims[i].flags = 0;
- if (_noScriptEnter) {
- _screen->setScreenPalette(_screen->getPalette(1));
- memcpy(_screen->getPalette(0), _screen->getPalette(1), 384);
+ for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) {
+ if (_sceneAnimMovie[i])
+ _sceneAnimMovie[i]->close();
}
-
- updateCharPal(0);
-
- _scriptInterpreter->startScript(&_sceneScriptState, 3);
- _sceneScriptState.regs[5] = unk1;
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
}
void KyraEngine_v2::updateSpecialSceneScripts() {
@@ -723,13 +51,13 @@ void KyraEngine_v2::updateSpecialSceneScripts() {
_specialSceneScriptRunFlag = true;
while (_specialSceneScriptRunFlag && _sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis()) {
- if (!_scriptInterpreter->runScript(&_sceneSpecialScripts[_lastProcessedSceneScript]))
+ if (!_emc->run(&_sceneSpecialScripts[_lastProcessedSceneScript]))
_specialSceneScriptRunFlag = false;
}
}
- if (!_scriptInterpreter->validScript(&_sceneSpecialScripts[_lastProcessedSceneScript])) {
- _scriptInterpreter->startScript(&_sceneSpecialScripts[_lastProcessedSceneScript], 8+_lastProcessedSceneScript);
+ if (!_emc->isValid(&_sceneSpecialScripts[_lastProcessedSceneScript])) {
+ _emc->start(&_sceneSpecialScripts[_lastProcessedSceneScript], _desc.firstAnimSceneScript+_lastProcessedSceneScript);
_specialSceneScriptRunFlag = false;
}
@@ -742,32 +70,21 @@ void KyraEngine_v2::updateSpecialSceneScripts() {
}
}
-void KyraEngine_v2::freeSceneShapePtrs() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneShapePtrs()");
- for (int i = 0; i < ARRAYSIZE(_sceneShapeTable); ++i)
- delete [] _sceneShapeTable[i];
- memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
-}
-
-void KyraEngine_v2::freeSceneAnims() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneAnims()");
- for (int i = 0; i < ARRAYSIZE(_sceneAnims); ++i)
- _sceneAnims[i].flags = 0;
- Common::for_each(_sceneAnimMovie, _sceneAnimMovie+ARRAYSIZE(_sceneAnimMovie), Common::mem_fun(&WSAMovieV2::close));
-}
+void KyraEngine_v2::runSceneScript6() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript6()");
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
-void KyraEngine_v2::fadeScenePal(int srcIndex, int delayTime) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::fadeScenePal(%d, %d)", srcIndex, delayTime);
- uint8 *dst = _screen->getPalette(0) + 336;
- const uint8 *src = _scenePal + (srcIndex << 4)*3;
- memcpy(dst, src, 48);
+ _sceneScriptState.regs[0] = _mainCharacter.sceneId;
+ _sceneScriptState.regs[1] = _mouseX;
+ _sceneScriptState.regs[2] = _mouseY;
+ _sceneScriptState.regs[3] = _itemInHand;
- _screen->fadePalette(_screen->getPalette(0), delayTime, &_updateFunctor);
+ _emc->start(&_sceneScriptState, 6);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
}
-#pragma mark -
-#pragma mark - Pathfinder
-#pragma mark -
+#pragma mark - pathfinder
int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
@@ -785,53 +102,15 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
return usePostProcess ? size : getMoveTableSize(moveTable);
}
-bool KyraEngine_v2::lineIsPassable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::lineIsPassable(%d, %d)", x, y);
- static int unkTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 };
-
- if (_pathfinderFlag & 2) {
- if (x >= 320)
- return false;
- }
-
- if (_pathfinderFlag & 4) {
- if (y >= 144)
- return false;
- }
-
- if (_pathfinderFlag & 8) {
- if (x < 0)
- return false;
- }
-
- if (y > 143)
- return false;
-
- int unk1 = unkTable[getScale(x, y) >> 5];
-
- if (y < 0)
- y = 0;
- x -= unk1 >> 1;
- if (x < 0)
- x = 0;
- int x2 = x + unk1;
- if (x2 > 320)
- x2 = 320;
-
- for (;x < x2; ++x)
- if (!_screen->getShapeFlag1(x, y))
- return false;
-
- return true;
-}
-
bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::directLinePassable(%d, %d, %d, %d)", x, y, toX, toY);
+ Screen *scr = screen();
+
while (x != toX && y != toY) {
int facing = getFacingFromPointToPoint(x, y, toX, toY);
x += _addXPosTable[facing];
y += _addYPosTable[facing];
- if (!_screen->getShapeFlag1(x, y))
+ if (!scr->getShapeFlag1(x, y))
return false;
}
return true;
@@ -957,3 +236,4 @@ void KyraEngine_v2::pathfinderFinializePath(int *moveTable, int tableLen, int x,
}
} // end of namespace Kyra
+
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 6ffd0ace79..298483465e 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -34,7 +34,8 @@
namespace Kyra {
Screen::Screen(KyraEngine *vm, OSystem *system)
-: _system(system), _vm(vm), _sjisInvisibleColor(0) {
+ : _system(system), _vm(vm), _sjisInvisibleColor(0) {
+ _debugEnabled = false;
}
Screen::~Screen() {
@@ -75,7 +76,34 @@ bool Screen::init() {
_useSJIS = false;
_sjisTempPage = _sjisFontData = 0;
- setResolution();
+ if (_vm->gameFlags().useHiResOverlay) {
+ _useOverlays = true;
+ _useSJIS = (_vm->gameFlags().lang == Common::JA_JPN);
+ _sjisInvisibleColor = (_vm->gameFlags().gameID == GI_KYRA1) ? 0x80 : 0xF6;
+
+ for (int i = 0; i < SCREEN_OVLS_NUM; ++i) {
+ if (!_sjisOverlayPtrs[i]) {
+ _sjisOverlayPtrs[i] = new uint8[SCREEN_OVL_SJIS_SIZE];
+ assert(_sjisOverlayPtrs[i]);
+ memset(_sjisOverlayPtrs[i], _sjisInvisibleColor, SCREEN_OVL_SJIS_SIZE);
+ }
+ }
+
+ if (_useSJIS) {
+ if (!_sjisFontData) {
+ _sjisFontData = _vm->resource()->fileData("FMT_FNT.ROM", 0);
+ if (!_sjisFontData)
+ error("missing font rom ('FMT_FNT.ROM') required for this version");
+ }
+
+ if (!_sjisTempPage) {
+ _sjisTempPage = new uint8[420];
+ assert(_sjisTempPage);
+ _sjisTempPage2 = _sjisTempPage + 60;
+ _sjisSourceChar = _sjisTempPage + 384;
+ }
+ }
+ }
_curPage = 0;
uint8 *pagePtr = new uint8[SCREEN_PAGE_SIZE * 8];
@@ -155,32 +183,6 @@ void Screen::setResolution() {
else
_system->initSize(640, 400);
_system->endGFXTransaction();
-
- _useOverlays = true;
- _useSJIS = (_vm->gameFlags().lang == Common::JA_JPN);
- _sjisInvisibleColor = (_vm->gameFlags().gameID == GI_KYRA1) ? 0x80 : 0xF6;
-
- for (int i = 0; i < SCREEN_OVLS_NUM; ++i) {
- if (!_sjisOverlayPtrs[i]) {
- _sjisOverlayPtrs[i] = new uint8[SCREEN_OVL_SJIS_SIZE];
- assert(_sjisOverlayPtrs[i]);
- memset(_sjisOverlayPtrs[i], _sjisInvisibleColor, SCREEN_OVL_SJIS_SIZE);
- }
- }
- if (_useSJIS) {
- if (!_sjisFontData) {
- _sjisFontData = _vm->resource()->fileData("FMT_FNT.ROM", 0);
- if (!_sjisFontData)
- error("missing font rom ('FMT_FNT.ROM') required for this version");
- }
-
- if (!_sjisTempPage) {
- _sjisTempPage = new uint8[420];
- assert(_sjisTempPage);
- _sjisTempPage2 = _sjisTempPage + 60;
- _sjisSourceChar = _sjisTempPage + 384;
- }
- }
} else {
_system->beginGFXTransaction();
_vm->initCommonGFX(false);
@@ -1181,7 +1183,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
&Screen::drawShapePlotType0, // used by Kyra 1 + 2
&Screen::drawShapePlotType1, // used by Kyra 3
0,
- &Screen::drawShapePlotType3_7, // used by Kyra 1 (invisibility)
+ &Screen::drawShapePlotType3_7, // used by Kyra 3 (shadow)
&Screen::drawShapePlotType4, // used by Kyra 1, 2 + 3
&Screen::drawShapePlotType5, // used by Kyra 1
&Screen::drawShapePlotType6, // used by Kyra 1 (invisibility)
@@ -1189,7 +1191,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
&Screen::drawShapePlotType8, // used by Kyra 2
&Screen::drawShapePlotType9, // used by Kyra 1 + 3
0,
- &Screen::drawShapePlotType11_15, // used by Kyra 1 /invisibility)
+ &Screen::drawShapePlotType11_15, // used by Kyra 1 (invisibility) + Kyra 3 (shadow)
&Screen::drawShapePlotType12, // used by Kyra 2
&Screen::drawShapePlotType13, // used by Kyra 1
&Screen::drawShapePlotType14, // used by Kyra 1 (invisibility)
@@ -1635,7 +1637,7 @@ void Screen::drawShapePlotType1(uint8 *dst, uint8 cmd) {
}
void Screen::drawShapePlotType3_7(uint8 *dst, uint8 cmd) {
- cmd = dst[cmd];
+ cmd = *dst;
for (int i = 0; i < _dsTableLoopCount; ++i)
cmd = _dsTable[cmd];
@@ -3110,305 +3112,5 @@ void Screen::drawCharSJIS(uint16 c, int x, int y) {
#pragma mark -
-uint8 *ScreenEx::generateOverlay(const uint8 *palette, uint8 *buffer, int startColor, uint16 factor) {
- if (!palette || !buffer)
- return buffer;
-
- factor = MIN<uint16>(255, factor);
- factor >>= 1;
- factor &= 0xFF;
-
- const byte col1 = palette[startColor * 3 + 0];
- const byte col2 = palette[startColor * 3 + 1];
- const byte col3 = palette[startColor * 3 + 2];
-
- uint8 *dst = buffer;
- *dst++ = 0;
-
- for (int i = 1; i != 255; ++i) {
- uint8 processedPalette[3];
- const uint8 *src = palette + i*3;
- byte col;
-
- col = *src++;
- col -= ((((col - col1) * factor) << 1) >> 8) & 0xFF;
- processedPalette[0] = col;
-
- col = *src++;
- col -= ((((col - col2) * factor) << 1) >> 8) & 0xFF;
- processedPalette[1] = col;
-
- col = *src++;
- col -= ((((col - col3) * factor) << 1) >> 8) & 0xFF;
- processedPalette[2] = col;
-
- *dst++ = findLeastDifferentColor(processedPalette, palette+3, 255)+1;
- }
-
- return buffer;
-}
-
-void ScreenEx::applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay) {
- if (pageNum == 0 || pageNum == 1)
- addDirtyRect(x, y, w, h);
-
- uint8 *dst = getPagePtr(pageNum) + y * 320 + x;
- while (h--) {
- for (int wi = 0; wi < w; ++wi) {
- uint8 index = *dst;
- *dst++ = overlay[index];
- }
- dst += 320 - w;
- }
-}
-
-int ScreenEx::findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors) {
- int m = 0x7fff;
- int r = 0x101;
-
- for (int i = 0; i < numColors; i++) {
- int v = paletteEntry[0] - *palette++;
- int c = v * v;
- v = paletteEntry[1] - *palette++;
- c += (v * v);
- v = paletteEntry[2] - *palette++;
- c += (v * v);
-
- if (c <= m) {
- m = c;
- r = i;
- }
- }
-
- return r;
-}
-
-void ScreenEx::copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
- int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2) {
- uint8 *dstPtr = getPagePtr(_curPage);
- uint8 *origDst = dstPtr;
-
- const ScreenDim *dim = getScreenDim(dimState);
- int dimX1 = dim->sx << 3;
- int dimX2 = dim->w << 3;
- dimX2 += dimX1;
-
- int dimY1 = dim->sy;
- int dimY2 = dim->h;
- dimY2 += dimY1;
-
- int temp = y - dimY1;
- if (temp < 0) {
- if ((temp += h) <= 0)
- return;
- else {
- SWAP(temp, h);
- y += temp - h;
- src += (temp - h) * w;
- }
- }
-
- temp = dimY2 - y;
- if (temp <= 0)
- return;
-
- if (temp < h)
- h = temp;
-
- int srcOffset = 0;
- temp = x - dimX1;
- if (temp < 0) {
- temp = -temp;
- srcOffset = temp;
- x += temp;
- w -= temp;
- }
-
- int srcAdd = 0;
-
- temp = dimX2 - x;
- if (temp <= 0)
- return;
-
- if (temp < w) {
- SWAP(w, temp);
- temp -= w;
- srcAdd = temp;
- }
-
- dstPtr += y * SCREEN_W + x;
- uint8 *dst = dstPtr;
-
- if (_curPage == 0 || _curPage == 1)
- addDirtyRect(x, y, w, h);
-
- clearOverlayRect(_curPage, x, y, w, h);
-
- temp = h;
- int curY = y;
- while (h--) {
- src += srcOffset;
- ++curY;
- int cW = w;
-
- switch (plotFunc) {
- case 0:
- memcpy(dst, src, cW);
- dst += cW; src += cW;
- break;
-
- case 1:
- while (cW--) {
- uint8 d = *src++;
- uint8 t = unkPtr1[d];
- if (t != 0xFF)
- d = unkPtr2[*dst + (t << 8)];
- *dst++ = d;
- }
- break;
-
- case 4:
- while (cW--) {
- uint8 d = *src++;
- if (d)
- *dst = d;
- ++dst;
- }
- break;
-
- case 5:
- while (cW--) {
- uint8 d = *src++;
- if (d) {
- uint8 t = unkPtr1[d];
- if (t != 0xFF)
- d = unkPtr2[*dst + (t << 8)];
- *dst = d;
- }
- ++dst;
- }
- break;
-
- case 8:
- case 9:
- while (cW--) {
- uint8 d = *src++;
- uint8 t = _shapePages[0][dst - origDst] & 7;
- if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- }
- break;
-
- case 12:
- case 13:
- while (cW--) {
- uint8 d = *src++;
- if (d) {
- uint8 t = _shapePages[0][dst - origDst] & 7;
- if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- } else {
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- }
- }
- break;
-
- default:
- break;
- }
-
- dst = (dstPtr += SCREEN_W);
- src += srcAdd;
- }
-}
-
-const uint8 *ScreenEx::getPtrToShape(const uint8 *shpFile, int shape) {
- debugC(9, kDebugLevelScreen, "ScreenEx::getPtrToShape(%p, %d)", (const void *)shpFile, shape);
- uint16 shapes = READ_LE_UINT16(shpFile);
-
- if (shapes <= shape)
- return 0;
-
- uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
-
- return shpFile + offset + 2;
-}
-
-uint8 *ScreenEx::getPtrToShape(uint8 *shpFile, int shape) {
- debugC(9, kDebugLevelScreen, "ScreenEx::getPtrToShape(%p, %d)", (void *)shpFile, shape);
- uint16 shapes = READ_LE_UINT16(shpFile);
-
- if (shapes <= shape)
- return 0;
-
- uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
-
- return shpFile + offset + 2;
-}
-
-int ScreenEx::getShapeScaledWidth(const uint8 *shpFile, int scale) {
- int width = READ_LE_UINT16(shpFile+3);
- return (width * scale) >> 8;
-}
-
-int ScreenEx::getShapeScaledHeight(const uint8 *shpFile, int scale) {
- int height = shpFile[2];
- return (height * scale) >> 8;
-}
-
-uint16 ScreenEx::getShapeSize(const uint8 *shp) {
- debugC(9, kDebugLevelScreen, "ScreenEx::getShapeSize(%p)", (const void *)shp);
-
- return READ_LE_UINT16(shp+6);
-}
-
-uint8 *ScreenEx::makeShapeCopy(const uint8 *src, int index) {
- debugC(9, kDebugLevelScreen, "ScreenEx::makeShapeCopy(%p, %d)", (const void *)src, index);
-
- const uint8 *shape = getPtrToShape(src, index);
- int size = getShapeSize(shape);
-
- uint8 *copy = new uint8[size];
- assert(copy);
- memcpy(copy, shape, size);
-
- return copy;
-}
-
-int ScreenEx::getLayer(int x, int y) {
- if (x < 0)
- x = 0;
- else if (x >= 320)
- x = 319;
- if (y < 0)
- y = 0;
- else if (y >= 144)
- y = 143;
-
- uint8 pixel = *(getCPagePtr(5) + y * 320 + x);
- pixel &= 0x7F;
- pixel >>= 3;
-
- if (pixel < 1)
- pixel = 1;
- else if (pixel > 15)
- pixel = 15;
- return pixel;
-}
-
-int ScreenEx::getRectSize(int w, int h) {
- if (w > 320 || h > 200)
- return 0;
- return w*h;
-}
-
-void ScreenEx::setTextColorMap(const uint8 *cmap) {
- debugC(9, kDebugLevelScreen, "ScreenEx::setTextColorMap(%p)", (const void *)cmap);
- setTextColor(cmap, 0, 15);
-}
-
} // End of namespace Kyra
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index ed69e9260e..bf23747daf 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -36,7 +36,11 @@ namespace Kyra {
typedef Common::Functor0<void> UpdateFunctor;
class KyraEngine;
-struct Rect;
+
+struct Rect {
+ int x, y;
+ int x2, y2;
+};
struct ScreenDim {
uint16 sx;
@@ -59,9 +63,7 @@ struct Font {
};
class Screen {
- friend class Debugger_v1;
public:
-
enum {
SCREEN_W = 320,
SCREEN_H = 200,
@@ -97,7 +99,10 @@ public:
Screen(KyraEngine *vm, OSystem *system);
virtual ~Screen();
+ // init
virtual bool init();
+ virtual void setResolution();
+
void updateScreen();
@@ -349,48 +354,10 @@ protected:
int _drawShapeVar4;
int _drawShapeVar5;
- // init
- virtual void setResolution();
-
// debug
bool _debugEnabled;
};
-class ScreenEx : public Screen {
-public:
- ScreenEx(KyraEngine *vm, OSystem *system) : Screen(vm, system) {}
-
- // screen page handling
- void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
- int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2);
-
- // palette handling
- uint8 *generateOverlay(const uint8 *palette, uint8 *buffer, int color, uint16 factor);
- void applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay);
- int findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors);
-
- // shape handling
- uint8 *getPtrToShape(uint8 *shpFile, int shape);
- const uint8 *getPtrToShape(const uint8 *shpFile, int shape);
-
- int getShapeScaledWidth(const uint8 *shpFile, int scale);
- int getShapeScaledHeight(const uint8 *shpFile, int scale);
-
- uint16 getShapeSize(const uint8 *shp);
-
- uint8 *makeShapeCopy(const uint8 *src, int index);
-
- // rect handling
- int getRectSize(int w, int h);
-
- // text display
- void setTextColorMap(const uint8 *cmap);
-
- // layer handling
- virtual int getLayer(int x, int y);
-protected:
-};
-
} // End of namespace Kyra
#endif
diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp
new file mode 100644
index 0000000000..9192626159
--- /dev/null
+++ b/engines/kyra/screen_hof.cpp
@@ -0,0 +1,279 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+
+#include "kyra/kyra_hof.h"
+#include "kyra/screen_hof.h"
+
+namespace Kyra {
+
+Screen_HoF::Screen_HoF(KyraEngine_HoF *vm, OSystem *system)
+ : Screen_v2(vm, system) {
+ _vm = vm;
+ _wsaFrameAnimBuffer = new uint8[1024];
+}
+
+Screen_HoF::~Screen_HoF() {
+ delete [] _wsaFrameAnimBuffer;
+}
+
+void Screen_HoF::setScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_HoF::setScreenDim(%d)", dim);
+ assert(dim < _screenDimTableCount);
+ _curDim = &_screenDimTable[dim];
+}
+
+const ScreenDim *Screen_HoF::getScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_HoF::getScreenDim(%d)", dim);
+ assert(dim < _screenDimTableCount);
+ return &_screenDimTable[dim];
+}
+
+void Screen_HoF::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag) {
+ uint8 tmpPal[768];
+
+ for (int i = 0; i != lastColor; i++) {
+ if (flag) {
+ int v = ((((srcPal[3 * i] & 0x3f) + (srcPal[3 * i + 1] & 0x3f)
+ + (srcPal[3 * i + 2] & 0x3f)) / 3) * factor) / 0x40;
+ tmpPal[3 * i] = tmpPal[3 * i + 1] = tmpPal[3 * i + 2] = v & 0xff;
+ } else {
+ int v = (((srcPal[3 * i] & 0x3f) * factor) / 0x40) + addR;
+ tmpPal[3 * i] = (v > 0x3f) ? 0x3f : v & 0xff;
+ v = (((srcPal[3 * i + 1] & 0x3f) * factor) / 0x40) + addG;
+ tmpPal[3 * i + 1] = (v > 0x3f) ? 0x3f : v & 0xff;
+ v = (((srcPal[3 * i + 2] & 0x3f) * factor) / 0x40) + addB;
+ tmpPal[3 * i + 2] = (v > 0x3f) ? 0x3f : v & 0xff;
+ }
+ }
+
+ for (int i = 0; i < lastColor; i++)
+ grayOverlay[i] = findLeastDifferentColor(tmpPal + 3 * i, srcPal, lastColor);
+}
+
+void Screen_HoF::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
+ int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) {
+
+ if (!(w1 || h1 || w2 || h2))
+ return;
+
+ ScreenDim cdm = _screenDimTable[dim];
+ cdm.sx <<= 3;
+ cdm.w <<= 3;
+
+ int na = 0, nb = 0, nc = w2;
+
+ if (!calcBounds(cdm.w, cdm.h, x2, y2, w2, h2, na, nb, nc))
+ return;
+
+ const uint8 *src = getPagePtr(srcPage) + y1 * 320;
+ uint8 *dst = getPagePtr(dstPage) + (y2 + cdm.sy) * 320;
+
+ int u = -1;
+
+ do {
+ int t = (nb * h1) / h2;
+ if (t != u) {
+ u = t;
+ const uint8 *s = src + (x1 + t) * 320;
+ uint8 *dt = (uint8*) _wsaFrameAnimBuffer;
+
+ t = w2 - w1;
+ if (!t) {
+ memcpy(dt, s, w2);
+ } else if (t > 0) {
+ if (w1 == 1) {
+ memset(dt, *s, w2);
+ } else {
+ t = ((((((w2 - w1 + 1) & 0xffff) << 8) / w1) + 0x100) & 0xffff) << 8;
+ int bp = 0;
+ for (int i = 0; i < w1; i++) {
+ int cnt = (t >> 16);
+ bp += (t & 0xffff);
+ if (bp > 0xffff) {
+ bp -= 0xffff;
+ cnt++;
+ }
+ memset(dt, *s++, cnt);
+ dt += cnt;
+ }
+ }
+ } else {
+ if (w2 == 1) {
+ *dt = *s;
+ } else {
+ t = (((((w1 - w2) & 0xffff) << 8) / w2) & 0xffff) << 8;
+ int bp = 0;
+ for (int i = 0; i < w2; i++) {
+ *dt++ = *s++;
+ bp += (t & 0xffff);
+ if (bp > 0xffff) {
+ bp -= 0xffff;
+ s++;
+ }
+ s += (t >> 16);
+ }
+ }
+ }
+ }
+ memcpy(dst + x2 + cdm.sx, _wsaFrameAnimBuffer + na, w2);
+ dst += 320;
+ } while (++nb < h2);
+}
+
+void Screen_HoF::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW,
+ int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage) {
+
+ if (!(cmpW || cmpH ))
+ return;
+
+ int r1, r2, r3, r4, r5, r6;
+
+ int X1 = srcX;
+ int Y1 = srcY;
+ int W1 = cmpW;
+ int H1 = cmpH;
+
+ if (!calcBounds(srcW, srcH, X1, Y1, W1, H1, r1, r2, r3))
+ return;
+
+ int X2 = dstX;
+ int Y2 = dstY;
+ int W2 = W1;
+ int H2 = H1;
+
+ if (!calcBounds(dstW, dstH, X2, Y2, W2, H2, r4, r5, r6))
+ return;
+
+ const uint8 *src = getPagePtr(srcPage) + srcW * (Y1 + r5);
+ uint8 *dst = getPagePtr(dstPage) + dstW * (Y2 + r2);
+ const uint8 *cmp = getPagePtr(cmpPage);
+
+ while (H2--) {
+ const uint8 *s = src + r4 + X1;
+ uint8 *d = dst + r1 + X2;
+
+ for (int i = 0; i < W2; i++) {
+ int ix = (*s++ << 8) + *d;
+ *d++ = cmp[ix];
+ }
+
+ src += W1;
+ dst += W2;
+ }
+}
+
+void Screen_HoF::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes) {
+ const uint8 *src = getPagePtr(srcPage) + srcPos;
+ uint8 *dst = getPagePtr(dstPage) + dstPos;
+ memcpy(dst, src, numBytes);
+}
+
+
+void Screen_HoF::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) {
+ int x0 = dim->sx << 3;
+ int y0 = dim->sy;
+ int w0 = dim->w << 3;
+ int h0 = dim->h;
+
+ int x1 = dstX;
+ int y1 = dstY;
+ int w1 = dstW;
+ int h1 = dstH;
+
+ int x2, y2, w2;
+
+ calcBounds(w0, h0, x1, y1, w1, h1, x2, y2, w2);
+
+ const uint8 *src = getPagePtr(srcPage) + (320 * srcH) + srcW;
+ uint8 *dst = getPagePtr(dstPage) + 320 * (y0 + y1);
+
+ for (int y = 0; y < h1; y++) {
+ const uint8 *s = src + x2;
+ uint8 *d = dst + x0 + x1;
+
+ if (flag)
+ d += (h1 >> 1);
+
+ for (int x = 0; x < w1; x++) {
+ if (*s)
+ *d = *s;
+ s++;
+ d++;
+ }
+ dst += 320;
+ src += 320;
+ }
+}
+
+bool Screen_HoF::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) {
+ x2 = 0;
+ y2 = 0;
+ w2 = w1;
+
+ int t = x1 + w1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= x1) {
+ x2 = w1 - t;
+ w1 = t;
+ x1 = 0;
+ }
+ t = w0 - x1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= w1) {
+ w1 = t;
+ }
+ w2 -= w1;
+ t = h1 + y1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= y1) {
+ y2 = h1 - t;
+ h1 = t;
+ y1 = 0;
+ }
+ t = h0 - y1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= h1) {
+ h1 = t;
+ }
+ }
+ }
+ }
+ }
+
+ return (w1 == -1) ? false : true;
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/screen_hof.h b/engines/kyra/screen_hof.h
new file mode 100644
index 0000000000..a6df749538
--- /dev/null
+++ b/engines/kyra/screen_hof.h
@@ -0,0 +1,63 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA_SCREEN_HOF_H
+#define KYRA_SCREEN_HOF_H
+
+#include "kyra/screen_v2.h"
+
+namespace Kyra {
+
+class KyraEngine_HoF;
+
+class Screen_HoF : public Screen_v2 {
+friend class Debugger_v2;
+public:
+ Screen_HoF(KyraEngine_HoF *vm, OSystem *system);
+ ~Screen_HoF();
+
+ void setScreenDim(int dim);
+ const ScreenDim *getScreenDim(int dim);
+
+ // sequence player
+ void generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag);
+ bool calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2);
+ void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim);
+ void cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW, int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage);
+ void copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes);
+ void copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *d, bool flag = false);
+private:
+ KyraEngine_HoF *_vm;
+
+ static const ScreenDim _screenDimTable[];
+ static const int _screenDimTableCount;
+
+ uint8 *_wsaFrameAnimBuffer;
+};
+
+} // End of namespace Kyra
+
+#endif
+
diff --git a/engines/kyra/screen_v3.cpp b/engines/kyra/screen_mr.cpp
index 938307b774..4cea50927c 100644
--- a/engines/kyra/screen_v3.cpp
+++ b/engines/kyra/screen_mr.cpp
@@ -23,32 +23,32 @@
*
*/
-#include "kyra/screen_v3.h"
+#include "kyra/screen_mr.h"
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_mr.h"
namespace Kyra {
-Screen_v3::Screen_v3(KyraEngine_v3 *vm, OSystem *system) : ScreenEx(vm, system) {
+Screen_MR::Screen_MR(KyraEngine_MR *vm, OSystem *system) : Screen_v2(vm, system) {
}
-Screen_v3::~Screen_v3() {
+Screen_MR::~Screen_MR() {
}
-void Screen_v3::setScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v3::setScreenDim(%d)", dim);
+void Screen_MR::setScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::setScreenDim(%d)", dim);
assert(dim < _screenDimTableCount);
_curDim = &_screenDimTable[dim];
}
-const ScreenDim *Screen_v3::getScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getScreenDim(%d)", dim);
+const ScreenDim *Screen_MR::getScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getScreenDim(%d)", dim);
assert(dim < _screenDimTableCount);
return &_screenDimTable[dim];
}
-int Screen_v3::getLayer(int x, int y) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getLayer(%d, %d)", x, y);
+int Screen_MR::getLayer(int x, int y) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getLayer(%d, %d)", x, y);
if (x < 0)
x = 0;
else if (x >= 320)
@@ -72,8 +72,8 @@ int Screen_v3::getLayer(int x, int y) {
return pixel;
}
-byte Screen_v3::getShapeFlag1(int x, int y) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getShapeFlag1(%d, %d)", x, y);
+byte Screen_MR::getShapeFlag1(int x, int y) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getShapeFlag1(%d, %d)", x, y);
if (y < _maskMinY || y > _maskMaxY)
return 0;
@@ -86,8 +86,8 @@ byte Screen_v3::getShapeFlag1(int x, int y) {
return 0;
}
-byte Screen_v3::getShapeFlag2(int x, int y) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getShapeFlag2(%d, %d)", x, y);
+byte Screen_MR::getShapeFlag2(int x, int y) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getShapeFlag2(%d, %d)", x, y);
if (y < _maskMinY || y > _maskMaxY)
return 0;
@@ -97,8 +97,8 @@ byte Screen_v3::getShapeFlag2(int x, int y) {
return color;
}
-int Screen_v3::getDrawLayer(int x, int y) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getDrawLayer(%d, %d)", x, y);
+int Screen_MR::getDrawLayer(int x, int y) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getDrawLayer(%d, %d)", x, y);
int xpos = x - 8;
int ypos = y;
int layer = 1;
@@ -115,8 +115,8 @@ int Screen_v3::getDrawLayer(int x, int y) {
return layer;
}
-int Screen_v3::getDrawLayer2(int x, int y, int height) {
- debugC(9, kDebugLevelScreen, "Screen_v3::getDrawLayer2(%d, %d, %d)", x, y, height);
+int Screen_MR::getDrawLayer2(int x, int y, int height) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::getDrawLayer2(%d, %d, %d)", x, y, height);
int xpos = x - 8;
int ypos = y;
int layer = 1;
@@ -135,4 +135,18 @@ int Screen_v3::getDrawLayer2(int x, int y, int height) {
return layer;
}
+void Screen_MR::drawFilledBox(int x1, int y1, int x2, int y2, uint8 c1, uint8 c2, uint8 c3) {
+ debugC(9, kDebugLevelScreen, "Screen_MR::drawFilledBox(%d, %d, %d, %d, %d, %d, %d,)", x1, y1, x2, y2, c1, c2, c3);
+
+ fillRect(x1, y1, x2, y2, c1);
+
+ fillRect(x1, y1, x2, y1+1, c2);
+ fillRect(x2-1, y1, x2, y2, c2);
+
+ drawClippedLine(x1, y1, x1, y2, c3);
+ drawClippedLine(x1+1, y1+1, x1+1, y2-2, c3);
+ drawClippedLine(x1, y2, x2, y2, c3);
+ drawClippedLine(x1, y2-1, x2-1, y2-1, c3);
+}
+
} // end of namespace Kyra
diff --git a/engines/kyra/screen_v3.h b/engines/kyra/screen_mr.h
index dc49268ad6..7fbcbdcb6e 100644
--- a/engines/kyra/screen_v3.h
+++ b/engines/kyra/screen_mr.h
@@ -23,22 +23,22 @@
*
*/
-#ifndef KYRA_SCREEN_V3_H
-#define KYRA_SCREEN_V3_H
+#ifndef KYRA_SCREEN_MR_H
+#define KYRA_SCREEN_MR_H
-#include "kyra/screen.h"
+#include "kyra/screen_v2.h"
namespace Kyra {
-class KyraEngine_v3;
+class KyraEngine_MR;
-class Screen_v3 : public ScreenEx {
+class Screen_MR : public Screen_v2 {
public:
- Screen_v3(KyraEngine_v3 *vm, OSystem *system);
- virtual ~Screen_v3();
+ Screen_MR(KyraEngine_MR *vm, OSystem *system);
+ ~Screen_MR();
- virtual void setScreenDim(int dim);
- virtual const ScreenDim *getScreenDim(int dim);
+ void setScreenDim(int dim);
+ const ScreenDim *getScreenDim(int dim);
int getLayer(int x, int y);
@@ -47,6 +47,8 @@ public:
int getDrawLayer(int x, int y);
int getDrawLayer2(int x, int y, int height);
+
+ void drawFilledBox(int x1, int y1, int x2, int y2, uint8 c1, uint8 c2, uint8 c3);
private:
static const ScreenDim _screenDimTable[];
static const int _screenDimTableCount;
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index f3eb840ca2..704296c534 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -11,7 +11,7 @@
* 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
+ * 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
@@ -23,256 +23,314 @@
*
*/
-#include "common/endian.h"
-
-#include "kyra/kyra_v2.h"
#include "kyra/screen_v2.h"
+#include "common/endian.h"
+
namespace Kyra {
-Screen_v2::Screen_v2(KyraEngine_v2 *vm, OSystem *system)
- : ScreenEx(vm, system) {
- _vm = vm;
- _wsaFrameAnimBuffer = new uint8[1024];
-}
+uint8 *Screen_v2::generateOverlay(const uint8 *palette, uint8 *buffer, int startColor, uint16 factor) {
+ if (!palette || !buffer)
+ return buffer;
-Screen_v2::~Screen_v2() {
- delete [] _wsaFrameAnimBuffer;
-}
+ factor = MIN<uint16>(255, factor);
+ factor >>= 1;
+ factor &= 0xFF;
+
+ const byte col1 = palette[startColor * 3 + 0];
+ const byte col2 = palette[startColor * 3 + 1];
+ const byte col3 = palette[startColor * 3 + 2];
-void Screen_v2::setScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v2::setScreenDim(%d)", dim);
- assert(dim < _screenDimTableCount);
- _curDim = &_screenDimTable[dim];
+ uint8 *dst = buffer;
+ *dst++ = 0;
+
+ for (int i = 1; i != 255; ++i) {
+ uint8 processedPalette[3];
+ const uint8 *src = palette + i*3;
+ byte col;
+
+ col = *src++;
+ col -= ((((col - col1) * factor) << 1) >> 8) & 0xFF;
+ processedPalette[0] = col;
+
+ col = *src++;
+ col -= ((((col - col2) * factor) << 1) >> 8) & 0xFF;
+ processedPalette[1] = col;
+
+ col = *src++;
+ col -= ((((col - col3) * factor) << 1) >> 8) & 0xFF;
+ processedPalette[2] = col;
+
+ *dst++ = findLeastDifferentColor(processedPalette, palette+3, 255)+1;
+ }
+
+ return buffer;
}
-const ScreenDim *Screen_v2::getScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v2::getScreenDim(%d)", dim);
- assert(dim < _screenDimTableCount);
- return &_screenDimTable[dim];
+void Screen_v2::applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay) {
+ if (pageNum == 0 || pageNum == 1)
+ addDirtyRect(x, y, w, h);
+
+ uint8 *dst = getPagePtr(pageNum) + y * 320 + x;
+ while (h--) {
+ for (int wi = 0; wi < w; ++wi) {
+ uint8 index = *dst;
+ *dst++ = overlay[index];
+ }
+ dst += 320 - w;
+ }
}
-void Screen_v2::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag) {
- uint8 tmpPal[768];
-
- for (int i = 0; i != lastColor; i++) {
- if (flag) {
- int v = ((((srcPal[3 * i] & 0x3f) + (srcPal[3 * i + 1] & 0x3f)
- + (srcPal[3 * i + 2] & 0x3f)) / 3) * factor) / 0x40;
- tmpPal[3 * i] = tmpPal[3 * i + 1] = tmpPal[3 * i + 2] = v & 0xff;
- } else {
- int v = (((srcPal[3 * i] & 0x3f) * factor) / 0x40) + addR;
- tmpPal[3 * i] = (v > 0x3f) ? 0x3f : v & 0xff;
- v = (((srcPal[3 * i + 1] & 0x3f) * factor) / 0x40) + addG;
- tmpPal[3 * i + 1] = (v > 0x3f) ? 0x3f : v & 0xff;
- v = (((srcPal[3 * i + 2] & 0x3f) * factor) / 0x40) + addB;
- tmpPal[3 * i + 2] = (v > 0x3f) ? 0x3f : v & 0xff;
+int Screen_v2::findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors) {
+ int m = 0x7fff;
+ int r = 0x101;
+
+ for (int i = 0; i < numColors; i++) {
+ int v = paletteEntry[0] - *palette++;
+ int c = v * v;
+ v = paletteEntry[1] - *palette++;
+ c += (v * v);
+ v = paletteEntry[2] - *palette++;
+ c += (v * v);
+
+ if (c <= m) {
+ m = c;
+ r = i;
}
}
- for (int i = 0; i < lastColor; i++)
- grayOverlay[i] = findLeastDifferentColor(tmpPal + 3 * i, srcPal, lastColor);
+ return r;
}
-void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
- int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) {
+void Screen_v2::copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
+ int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2) {
+ uint8 *dstPtr = getPagePtr(_curPage);
+ uint8 *origDst = dstPtr;
+
+ const ScreenDim *dim = getScreenDim(dimState);
+ int dimX1 = dim->sx << 3;
+ int dimX2 = dim->w << 3;
+ dimX2 += dimX1;
+
+ int dimY1 = dim->sy;
+ int dimY2 = dim->h;
+ dimY2 += dimY1;
+
+ int temp = y - dimY1;
+ if (temp < 0) {
+ if ((temp += h) <= 0)
+ return;
+ else {
+ SWAP(temp, h);
+ y += temp - h;
+ src += (temp - h) * w;
+ }
+ }
- if (!(w1 || h1 || w2 || h2))
+ temp = dimY2 - y;
+ if (temp <= 0)
return;
- ScreenDim cdm = _screenDimTable[dim];
- cdm.sx <<= 3;
- cdm.w <<= 3;
+ if (temp < h)
+ h = temp;
- int na = 0, nb = 0, nc = w2;
-
- if (!calcBounds(cdm.w, cdm.h, x2, y2, w2, h2, na, nb, nc))
- return;
+ int srcOffset = 0;
+ temp = x - dimX1;
+ if (temp < 0) {
+ temp = -temp;
+ srcOffset = temp;
+ x += temp;
+ w -= temp;
+ }
- const uint8 *src = getPagePtr(srcPage) + y1 * 320;
- uint8 *dst = getPagePtr(dstPage) + (y2 + cdm.sy) * 320;
+ int srcAdd = 0;
- int u = -1;
+ temp = dimX2 - x;
+ if (temp <= 0)
+ return;
- do {
- int t = (nb * h1) / h2;
- if (t != u) {
- u = t;
- const uint8 *s = src + (x1 + t) * 320;
- uint8 *dt = (uint8*) _wsaFrameAnimBuffer;
+ if (temp < w) {
+ SWAP(w, temp);
+ temp -= w;
+ srcAdd = temp;
+ }
- t = w2 - w1;
- if (!t) {
- memcpy(dt, s, w2);
- } else if (t > 0) {
- if (w1 == 1) {
- memset(dt, *s, w2);
- } else {
- t = ((((((w2 - w1 + 1) & 0xffff) << 8) / w1) + 0x100) & 0xffff) << 8;
- int bp = 0;
- for (int i = 0; i < w1; i++) {
- int cnt = (t >> 16);
- bp += (t & 0xffff);
- if (bp > 0xffff) {
- bp -= 0xffff;
- cnt++;
- }
- memset(dt, *s++, cnt);
- dt += cnt;
- }
+ dstPtr += y * SCREEN_W + x;
+ uint8 *dst = dstPtr;
+
+ if (_curPage == 0 || _curPage == 1)
+ addDirtyRect(x, y, w, h);
+
+ clearOverlayRect(_curPage, x, y, w, h);
+
+ temp = h;
+ int curY = y;
+ while (h--) {
+ src += srcOffset;
+ ++curY;
+ int cW = w;
+
+ switch (plotFunc) {
+ case 0:
+ memcpy(dst, src, cW);
+ dst += cW; src += cW;
+ break;
+
+ case 1:
+ while (cW--) {
+ uint8 d = *src++;
+ uint8 t = unkPtr1[d];
+ if (t != 0xFF)
+ d = unkPtr2[*dst + (t << 8)];
+ *dst++ = d;
+ }
+ break;
+
+ case 4:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d)
+ *dst = d;
+ ++dst;
+ }
+ break;
+
+ case 5:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d) {
+ uint8 t = unkPtr1[d];
+ if (t != 0xFF)
+ d = unkPtr2[*dst + (t << 8)];
+ *dst = d;
}
- } else {
- if (w2 == 1) {
- *dt = *s;
+ ++dst;
+ }
+ break;
+
+ case 8:
+ case 9:
+ while (cW--) {
+ uint8 d = *src++;
+ uint8 t = _shapePages[0][dst - origDst] & 7;
+ if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
+ }
+ break;
+
+ case 12:
+ case 13:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d) {
+ uint8 t = _shapePages[0][dst - origDst] & 7;
+ if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
} else {
- t = (((((w1 - w2) & 0xffff) << 8) / w2) & 0xffff) << 8;
- int bp = 0;
- for (int i = 0; i < w2; i++) {
- *dt++ = *s++;
- bp += (t & 0xffff);
- if (bp > 0xffff) {
- bp -= 0xffff;
- s++;
- }
- s += (t >> 16);
- }
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
}
}
- }
- memcpy(dst + x2 + cdm.sx, _wsaFrameAnimBuffer + na, w2);
- dst += 320;
- } while (++nb < h2);
-}
+ break;
-void Screen_v2::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW,
- int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage) {
-
- if (!(cmpW || cmpH ))
- return;
+ default:
+ break;
+ }
- int r1, r2, r3, r4, r5, r6;
+ dst = (dstPtr += SCREEN_W);
+ src += srcAdd;
+ }
+}
- int X1 = srcX;
- int Y1 = srcY;
- int W1 = cmpW;
- int H1 = cmpH;
+const uint8 *Screen_v2::getPtrToShape(const uint8 *shpFile, int shape) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getPtrToShape(%p, %d)", (const void *)shpFile, shape);
+ uint16 shapes = READ_LE_UINT16(shpFile);
- if (!calcBounds(srcW, srcH, X1, Y1, W1, H1, r1, r2, r3))
- return;
+ if (shapes <= shape)
+ return 0;
- int X2 = dstX;
- int Y2 = dstY;
- int W2 = W1;
- int H2 = H1;
+ uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
- if (!calcBounds(dstW, dstH, X2, Y2, W2, H2, r4, r5, r6))
- return;
+ return shpFile + offset + 2;
+}
- const uint8 *src = getPagePtr(srcPage) + srcW * (Y1 + r5);
- uint8 *dst = getPagePtr(dstPage) + dstW * (Y2 + r2);
- const uint8 *cmp = getPagePtr(cmpPage);
+uint8 *Screen_v2::getPtrToShape(uint8 *shpFile, int shape) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getPtrToShape(%p, %d)", (void *)shpFile, shape);
+ uint16 shapes = READ_LE_UINT16(shpFile);
- while (H2--) {
- const uint8 *s = src + r4 + X1;
- uint8 *d = dst + r1 + X2;
+ if (shapes <= shape)
+ return 0;
- for (int i = 0; i < W2; i++) {
- int ix = (*s++ << 8) + *d;
- *d++ = cmp[ix];
- }
+ uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
- src += W1;
- dst += W2;
- }
+ return shpFile + offset + 2;
}
-void Screen_v2::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes) {
- const uint8 *src = getPagePtr(srcPage) + srcPos;
- uint8 *dst = getPagePtr(dstPage) + dstPos;
- memcpy(dst, src, numBytes);
+int Screen_v2::getShapeScaledWidth(const uint8 *shpFile, int scale) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getShapeScaledWidth(%p, %d)", (const void*)shpFile, scale);
+ int width = READ_LE_UINT16(shpFile+3);
+ return (width * scale) >> 8;
}
+int Screen_v2::getShapeScaledHeight(const uint8 *shpFile, int scale) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getShapeScaledHeight(%p, %d)", (const void*)shpFile, scale);
+ int height = shpFile[2];
+ return (height * scale) >> 8;
+}
-void Screen_v2::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) {
- int x0 = dim->sx << 3;
- int y0 = dim->sy;
- int w0 = dim->w << 3;
- int h0 = dim->h;
-
- int x1 = dstX;
- int y1 = dstY;
- int w1 = dstW;
- int h1 = dstH;
+uint16 Screen_v2::getShapeSize(const uint8 *shp) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getShapeSize(%p)", (const void *)shp);
- int x2, y2, w2;
+ return READ_LE_UINT16(shp+6);
+}
- calcBounds(w0, h0, x1, y1, w1, h1, x2, y2, w2);
+uint8 *Screen_v2::makeShapeCopy(const uint8 *src, int index) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::makeShapeCopy(%p, %d)", (const void *)src, index);
- const uint8 *src = getPagePtr(srcPage) + (320 * srcH) + srcW;
- uint8 *dst = getPagePtr(dstPage) + 320 * (y0 + y1);
+ const uint8 *shape = getPtrToShape(src, index);
+ int size = getShapeSize(shape);
- for (int y = 0; y < h1; y++) {
- const uint8 *s = src + x2;
- uint8 *d = dst + x0 + x1;
+ uint8 *copy = new uint8[size];
+ assert(copy);
+ memcpy(copy, shape, size);
- if (flag)
- d += (h1 >> 1);
+ return copy;
+}
- for (int x = 0; x < w1; x++) {
- if (*s)
- *d = *s;
- s++;
- d++;
- }
- dst += 320;
- src += 320;
- }
+int Screen_v2::getLayer(int x, int y) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getLayer(%d, %d)", x, y);
+ if (x < 0)
+ x = 0;
+ else if (x >= 320)
+ x = 319;
+ if (y < 0)
+ y = 0;
+ else if (y >= 144)
+ y = 143;
+
+ uint8 pixel = *(getCPagePtr(5) + y * 320 + x);
+ pixel &= 0x7F;
+ pixel >>= 3;
+
+ if (pixel < 1)
+ pixel = 1;
+ else if (pixel > 15)
+ pixel = 15;
+ return pixel;
}
-bool Screen_v2::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) {
- x2 = 0;
- y2 = 0;
- w2 = w1;
-
- int t = x1 + w1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= x1) {
- x2 = w1 - t;
- w1 = t;
- x1 = 0;
- }
- t = w0 - x1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= w1) {
- w1 = t;
- }
- w2 -= w1;
- t = h1 + y1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= y1) {
- y2 = h1 - t;
- h1 = t;
- y1 = 0;
- }
- t = h0 - y1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= h1) {
- h1 = t;
- }
- }
- }
- }
- }
+int Screen_v2::getRectSize(int w, int h) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::getRectSize(%d, %d)", w, h);
+ if (w > 320 || h > 200)
+ return 0;
+ return w*h;
+}
- return (w1 == -1) ? false : true;
+void Screen_v2::setTextColorMap(const uint8 *cmap) {
+ debugC(9, kDebugLevelScreen, "Screen_v2::setTextColorMap(%p)", (const void *)cmap);
+ setTextColor(cmap, 0, 15);
}
} // end of namespace Kyra
diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h
index 665f71ace4..5679dadf39 100644
--- a/engines/kyra/screen_v2.h
+++ b/engines/kyra/screen_v2.h
@@ -11,7 +11,7 @@
* 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
+ * 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
@@ -27,36 +27,46 @@
#define KYRA_SCREEN_V2_H
#include "kyra/screen.h"
+#include "kyra/kyra_v2.h"
namespace Kyra {
-class KyraEngine_v2;
-
-class Screen_v2 : public ScreenEx {
-friend class Debugger_v2;
+class Screen_v2 : public Screen {
public:
- Screen_v2(KyraEngine_v2 *vm, OSystem *system);
- virtual ~Screen_v2();
-
- virtual void setScreenDim(int dim);
- virtual const ScreenDim *getScreenDim(int dim);
-
- // sequence player
- void generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag);
- bool calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2);
- void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim);
- void cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW, int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage);
- void copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes);
- void copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *d, bool flag = false);
-private:
- KyraEngine_v2 *_vm;
-
- static const ScreenDim _screenDimTable[];
- static const int _screenDimTableCount;
-
- uint8 *_wsaFrameAnimBuffer;
+ Screen_v2(KyraEngine *vm, OSystem *system) : Screen(vm, system) {}
+
+ // screen page handling
+ void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
+ int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2);
+
+ // palette handling
+ uint8 *generateOverlay(const uint8 *palette, uint8 *buffer, int color, uint16 factor);
+ void applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay);
+ int findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors);
+
+ // shape handling
+ uint8 *getPtrToShape(uint8 *shpFile, int shape);
+ const uint8 *getPtrToShape(const uint8 *shpFile, int shape);
+
+ int getShapeScaledWidth(const uint8 *shpFile, int scale);
+ int getShapeScaledHeight(const uint8 *shpFile, int scale);
+
+ uint16 getShapeSize(const uint8 *shp);
+
+ uint8 *makeShapeCopy(const uint8 *src, int index);
+
+ // rect handling
+ int getRectSize(int w, int h);
+
+ // text display
+ void setTextColorMap(const uint8 *cmap);
+
+ // layer handling
+ virtual int getLayer(int x, int y);
+protected:
};
-} // End of namespace Kyra
+} // end of namespace Kyra
+
+#endif
-#endif
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index 8db71a7b5e..e9dc34e581 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -33,8 +33,8 @@
#include "kyra/script.h"
namespace Kyra {
-ScriptHelper::ScriptHelper(KyraEngine *vm) : _vm(vm) {
-#define COMMAND(x) { &ScriptHelper::x, #x }
+EMCInterpreter::EMCInterpreter(KyraEngine *vm) : _vm(vm) {
+#define COMMAND(x) { &EMCInterpreter::x, #x }
static CommandEntry commandProcs[] = {
// 0x00
COMMAND(cmd_jmpTo),
@@ -65,14 +65,14 @@ ScriptHelper::ScriptHelper(KyraEngine *vm) : _vm(vm) {
#undef COMMAND
}
-bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, const Common::Array<const Opcode*> *opcodes) {
+bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Common::Array<const Opcode*> *opcodes) {
ScriptFileParser file(filename, _vm->resource());
if (!file) {
error("Couldn't open script file '%s'", filename);
return false;
}
- memset(scriptData, 0, sizeof(ScriptData));
+ memset(scriptData, 0, sizeof(EMCData));
uint32 formBlockSize = file.getFORMBlockSize();
if (formBlockSize == (uint32)-1) {
@@ -85,7 +85,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
scriptData->text = new byte[chunkSize];
if (!file.loadIFFBlock(TEXT_CHUNK, scriptData->text, chunkSize)) {
- unloadScript(scriptData);
+ unload(scriptData);
error("Couldn't load TEXT chunk from file: '%s'", filename);
return false;
}
@@ -93,7 +93,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
chunkSize = file.getIFFBlockSize(ORDR_CHUNK);
if (chunkSize == (uint32)-1) {
- unloadScript(scriptData);
+ unload(scriptData);
error("No ORDR chunk found in file: '%s'", filename);
return false;
}
@@ -102,7 +102,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
scriptData->ordr = new uint16[chunkSize];
if (!file.loadIFFBlock(ORDR_CHUNK, scriptData->ordr, chunkSize << 1)) {
- unloadScript(scriptData);
+ unload(scriptData);
error("Couldn't load ORDR chunk from file: '%s'", filename);
return false;
}
@@ -112,7 +112,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
chunkSize = file.getIFFBlockSize(DATA_CHUNK);
if (chunkSize == (uint32)-1) {
- unloadScript(scriptData);
+ unload(scriptData);
error("No DATA chunk found in file: '%s'", filename);
return false;
}
@@ -121,7 +121,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
scriptData->data = new uint16[chunkSize];
if (!file.loadIFFBlock(DATA_CHUNK, scriptData->data, chunkSize << 1)) {
- unloadScript(scriptData);
+ unload(scriptData);
error("Couldn't load DATA chunk from file: '%s'", filename);
return false;
}
@@ -135,7 +135,7 @@ bool ScriptHelper::loadScript(const char *filename, ScriptData *scriptData, cons
return true;
}
-void ScriptHelper::unloadScript(ScriptData *data) {
+void EMCInterpreter::unload(EMCData *data) {
if (!data)
return;
@@ -147,7 +147,7 @@ void ScriptHelper::unloadScript(ScriptData *data) {
data->ordr = data->data = 0;
}
-void ScriptHelper::initScript(ScriptState *scriptStat, const ScriptData *data) {
+void EMCInterpreter::init(EMCState *scriptStat, const EMCData *data) {
scriptStat->dataPtr = data;
scriptStat->ip = 0;
scriptStat->stack[60] = 0;
@@ -155,7 +155,7 @@ void ScriptHelper::initScript(ScriptState *scriptStat, const ScriptData *data) {
scriptStat->sp = 60;
}
-bool ScriptHelper::startScript(ScriptState *script, int function) {
+bool EMCInterpreter::start(EMCState *script, int function) {
if (!script->dataPtr)
return false;
@@ -175,13 +175,13 @@ bool ScriptHelper::startScript(ScriptState *script, int function) {
return true;
}
-bool ScriptHelper::validScript(ScriptState *script) {
+bool EMCInterpreter::isValid(EMCState *script) {
if (!script->ip || !script->dataPtr || _vm->quit())
return false;
return true;
}
-bool ScriptHelper::runScript(ScriptState *script) {
+bool EMCInterpreter::run(EMCState *script) {
_parameter = 0;
if (!script->ip)
@@ -207,7 +207,7 @@ bool ScriptHelper::runScript(ScriptState *script) {
if (opcode > 18) {
error("Script unknown command: %d", opcode);
} else {
- debugC(5, kDebugLevelScript, "[0x%.08X] ScriptHelper::%s([%d/%u])", instOffset, _commands[opcode].desc, _parameter, (uint)_parameter);
+ debugC(5, kDebugLevelScript, "[0x%.08X] EMCInterpreter::%s([%d/%u])", instOffset, _commands[opcode].desc, _parameter, (uint)_parameter);
(this->*(_commands[opcode].proc))(script);
}
@@ -295,15 +295,15 @@ bool ScriptFileParser::loadIFFBlock(const uint32 chunkName, void *loadTo, uint32
#pragma mark - Command implementations
#pragma mark -
-void ScriptHelper::cmd_jmpTo(ScriptState* script) {
+void EMCInterpreter::cmd_jmpTo(EMCState* script) {
script->ip = script->dataPtr->data + _parameter;
}
-void ScriptHelper::cmd_setRetValue(ScriptState* script) {
+void EMCInterpreter::cmd_setRetValue(EMCState* script) {
script->retValue = _parameter;
}
-void ScriptHelper::cmd_pushRetOrPos(ScriptState* script) {
+void EMCInterpreter::cmd_pushRetOrPos(EMCState* script) {
switch (_parameter) {
case 0:
script->stack[--script->sp] = script->retValue;
@@ -321,23 +321,23 @@ void ScriptHelper::cmd_pushRetOrPos(ScriptState* script) {
}
}
-void ScriptHelper::cmd_push(ScriptState* script) {
+void EMCInterpreter::cmd_push(EMCState* script) {
script->stack[--script->sp] = _parameter;
}
-void ScriptHelper::cmd_pushReg(ScriptState* script) {
+void EMCInterpreter::cmd_pushReg(EMCState* script) {
script->stack[--script->sp] = script->regs[_parameter];
}
-void ScriptHelper::cmd_pushBPNeg(ScriptState* script) {
+void EMCInterpreter::cmd_pushBPNeg(EMCState* script) {
script->stack[--script->sp] = script->stack[(-(int32)(_parameter + 2)) + script->bp];
}
-void ScriptHelper::cmd_pushBPAdd(ScriptState* script) {
+void EMCInterpreter::cmd_pushBPAdd(EMCState* script) {
script->stack[--script->sp] = script->stack[(_parameter - 1) + script->bp];
}
-void ScriptHelper::cmd_popRetOrPos(ScriptState* script) {
+void EMCInterpreter::cmd_popRetOrPos(EMCState* script) {
switch (_parameter) {
case 0:
script->retValue = script->stack[script->sp++];
@@ -358,27 +358,27 @@ void ScriptHelper::cmd_popRetOrPos(ScriptState* script) {
}
}
-void ScriptHelper::cmd_popReg(ScriptState* script) {
+void EMCInterpreter::cmd_popReg(EMCState* script) {
script->regs[_parameter] = script->stack[script->sp++];
}
-void ScriptHelper::cmd_popBPNeg(ScriptState* script) {
+void EMCInterpreter::cmd_popBPNeg(EMCState* script) {
script->stack[(-(int32)(_parameter + 2)) + script->bp] = script->stack[script->sp++];
}
-void ScriptHelper::cmd_popBPAdd(ScriptState* script) {
+void EMCInterpreter::cmd_popBPAdd(EMCState* script) {
script->stack[(_parameter - 1) + script->bp] = script->stack[script->sp++];
}
-void ScriptHelper::cmd_addSP(ScriptState* script) {
+void EMCInterpreter::cmd_addSP(EMCState* script) {
script->sp += _parameter;
}
-void ScriptHelper::cmd_subSP(ScriptState* script) {
+void EMCInterpreter::cmd_subSP(EMCState* script) {
script->sp -= _parameter;
}
-void ScriptHelper::cmd_execOpcode(ScriptState* script) {
+void EMCInterpreter::cmd_execOpcode(EMCState* script) {
uint8 opcode = _parameter;
assert(script->dataPtr->opcodes);
@@ -392,14 +392,14 @@ void ScriptHelper::cmd_execOpcode(ScriptState* script) {
}
}
-void ScriptHelper::cmd_ifNotJmp(ScriptState* script) {
+void EMCInterpreter::cmd_ifNotJmp(EMCState* script) {
if (!script->stack[script->sp++]) {
_parameter &= 0x7FFF;
script->ip = script->dataPtr->data + _parameter;
}
}
-void ScriptHelper::cmd_negate(ScriptState* script) {
+void EMCInterpreter::cmd_negate(EMCState* script) {
int16 value = script->stack[script->sp];
switch (_parameter) {
case 0:
@@ -424,7 +424,7 @@ void ScriptHelper::cmd_negate(ScriptState* script) {
}
}
-void ScriptHelper::cmd_eval(ScriptState* script) {
+void EMCInterpreter::cmd_eval(EMCState* script) {
int16 ret = 0;
bool error = false;
@@ -540,7 +540,7 @@ void ScriptHelper::cmd_eval(ScriptState* script) {
script->stack[--script->sp] = ret;
}
-void ScriptHelper::cmd_setRetAndJmp(ScriptState* script) {
+void EMCInterpreter::cmd_setRetAndJmp(EMCState* script) {
if (script->sp >= 60) {
script->ip = 0;
} else {
diff --git a/engines/kyra/script.h b/engines/kyra/script.h
index bc92aebc5e..df86ec79c3 100644
--- a/engines/kyra/script.h
+++ b/engines/kyra/script.h
@@ -31,10 +31,10 @@
namespace Kyra {
-struct ScriptState;
-typedef Common::Functor1<ScriptState*, int> Opcode;
+struct EMCState;
+typedef Common::Functor1<EMCState*, int> Opcode;
-struct ScriptData {
+struct EMCData {
byte *text;
uint16 *data;
uint16 *ordr;
@@ -43,9 +43,9 @@ struct ScriptData {
const Common::Array<const Opcode*> *opcodes;
};
-struct ScriptState {
+struct EMCState {
uint16 *ip;
- const ScriptData *dataPtr;
+ const EMCData *dataPtr;
int16 retValue;
uint16 bp;
uint16 sp;
@@ -87,24 +87,24 @@ private:
uint32 _endOffset;
};
-class ScriptHelper {
+class EMCInterpreter {
public:
- ScriptHelper(KyraEngine *vm);
+ EMCInterpreter(KyraEngine *vm);
- bool loadScript(const char *filename, ScriptData *data, const Common::Array<const Opcode*> *opcodes);
- void unloadScript(ScriptData *data);
+ bool load(const char *filename, EMCData *data, const Common::Array<const Opcode*> *opcodes);
+ void unload(EMCData *data);
- void initScript(ScriptState *scriptState, const ScriptData *data);
- bool startScript(ScriptState *script, int function);
+ void init(EMCState *scriptState, const EMCData *data);
+ bool start(EMCState *script, int function);
- bool validScript(ScriptState *script);
+ bool isValid(EMCState *script);
- bool runScript(ScriptState *script);
+ bool run(EMCState *script);
protected:
KyraEngine *_vm;
int16 _parameter;
- typedef void (ScriptHelper::*CommandProc)(ScriptState*);
+ typedef void (EMCInterpreter::*CommandProc)(EMCState*);
struct CommandEntry {
CommandProc proc;
const char *desc;
@@ -112,24 +112,24 @@ protected:
const CommandEntry *_commands;
private:
- void cmd_jmpTo(ScriptState*);
- void cmd_setRetValue(ScriptState*);
- void cmd_pushRetOrPos(ScriptState*);
- void cmd_push(ScriptState*);
- void cmd_pushReg(ScriptState*);
- void cmd_pushBPNeg(ScriptState*);
- void cmd_pushBPAdd(ScriptState*);
- void cmd_popRetOrPos(ScriptState*);
- void cmd_popReg(ScriptState*);
- void cmd_popBPNeg(ScriptState*);
- void cmd_popBPAdd(ScriptState*);
- void cmd_addSP(ScriptState*);
- void cmd_subSP(ScriptState*);
- void cmd_execOpcode(ScriptState*);
- void cmd_ifNotJmp(ScriptState*);
- void cmd_negate(ScriptState*);
- void cmd_eval(ScriptState*);
- void cmd_setRetAndJmp(ScriptState*);
+ void cmd_jmpTo(EMCState*);
+ void cmd_setRetValue(EMCState*);
+ void cmd_pushRetOrPos(EMCState*);
+ void cmd_push(EMCState*);
+ void cmd_pushReg(EMCState*);
+ void cmd_pushBPNeg(EMCState*);
+ void cmd_pushBPAdd(EMCState*);
+ void cmd_popRetOrPos(EMCState*);
+ void cmd_popReg(EMCState*);
+ void cmd_popBPNeg(EMCState*);
+ void cmd_popBPAdd(EMCState*);
+ void cmd_addSP(EMCState*);
+ void cmd_subSP(EMCState*);
+ void cmd_execOpcode(EMCState*);
+ void cmd_ifNotJmp(EMCState*);
+ void cmd_negate(EMCState*);
+ void cmd_eval(EMCState*);
+ void cmd_setRetAndJmp(EMCState*);
};
} // end of namespace Kyra
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
new file mode 100644
index 0000000000..ff28e08960
--- /dev/null
+++ b/engines/kyra/script_hof.cpp
@@ -0,0 +1,1735 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_hof.h"
+#include "kyra/text_hof.h"
+#include "kyra/wsamovie.h"
+#include "kyra/sound.h"
+#include "kyra/timer.h"
+#include "kyra/script_tim.h"
+#include "kyra/resource.h"
+
+#include "common/endian.h"
+
+namespace Kyra {
+
+int KyraEngine_HoF::o2_setCharacterFacingRefresh(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
+ int animFrame = stackPos(2);
+ if (animFrame >= 0)
+ _mainCharacter.animFrame = animFrame;
+ _mainCharacter.facing = stackPos(1);
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setCharacterPos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
+ int x = stackPos(1);
+ int y = stackPos(2);
+
+ if (x != -1 && y != -1) {
+ x &= ~3;
+ y &= ~1;
+ }
+
+ restorePage3();
+ _mainCharacter.x2 = _mainCharacter.x1 = x;
+ _mainCharacter.y2 = _mainCharacter.y1 = y;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_defineObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineObject(%p) (%d, '%s', %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ TalkObject *object = &_talkObjectList[stackPos(0)];
+ strcpy(object->filename, stackPosString(1));
+ object->scriptId = stackPos(2);
+ object->x = stackPos(3);
+ object->y = stackPos(4);
+ object->color = stackPos(5);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_refreshCharacter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_refreshCharacter(%p) (-, %d, %d, %d)", (const void *)script, stackPos(1), stackPos(2), stackPos(3));
+ int unk = stackPos(1);
+ int facing = stackPos(2);
+ int refresh = stackPos(3);
+ if (facing >= 0)
+ _mainCharacter.facing = facing;
+ if (unk >= 0 && unk != 32)
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ if (refresh)
+ refreshAnimObjectsIfNeed();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setSceneComment(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneComment(%p) ('%s')", (const void *)script, stackPosString(0));
+ _sceneCommentString = stackPosString(0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setCharacterAnimFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterAnimFrame(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
+ int animFrame = stackPos(1);
+ int updateAnim = stackPos(2);
+
+ _mainCharacter.animFrame = animFrame;
+ if (updateAnim)
+ updateCharacterAnim(0);
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_customCharacterChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ playVoice(_vocHigh, stackPos(4));
+ _text->printCustomCharacterText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), 0, 2);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_soundFadeOut(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_soundFadeOut(%p) ()", (const void *)script);
+ _sound->beginFadeOut();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_showChapterMessage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showChapterMessage(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ showChapterMessage(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_restoreTalkTextMessageBkgd(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreTalkTextMessageBkgd(%p) ()", (const void *)script);
+ _text->restoreTalkTextMessageBkgd(2, 0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_wsaClose(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wsaClose(%p) (%d)", (const void *)script, stackPos(0));
+ assert(stackPos(0) >= 0 && stackPos(0) < ARRAYSIZE(_wsaSlots));
+ _wsaSlots[stackPos(0)]->close();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_meanWhileScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_meanWhileScene(%p) (%d)", (const void *)script, stackPos(0));
+ static const uint8 jpSubtitle[] = { 0x88, 0xEA, 0x95, 0xFB, 0x81, 0x45, 0x81, 0x45, 0x81, 0x45 };
+ const char *cpsfile = stackPosString(0);
+ const char *palfile = stackPosString(1);
+
+ _screen->loadBitmap(cpsfile, 3, 3, 0);
+ memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);
+ _screen->loadPalette(palfile, _screen->getPalette(2));
+ _screen->fillRect(0, 0, 319, 199, 207);
+ _screen->setScreenPalette(_screen->getPalette(2));
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ if (!scumm_stricmp(cpsfile, "_MEANWIL.CPS") && _flags.lang == Common::JA_JPN) {
+ Screen::FontId o = _screen->setFont(Screen::FID_6_FNT);
+ _screen->printText((const char*)jpSubtitle, 140, 176, 255, 132);
+ _screen->setFont(o);
+ }
+ _screen->updateScreen();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_backUpScreen(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_backUpScreen(%p) (%d)", (const void *)script, stackPos(0));
+ _screen->copyRegionToBuffer(stackPos(0), 0, 0, 320, 144, _screenBuffer);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_restoreScreen(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreScreen(%p) (%d)", (const void *)script, stackPos(0));
+ _screen->copyBlockToPage(stackPos(0), 0, 0, 320, 144, _screenBuffer);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaFrame(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8));
+ int frame = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ int waitTime = stackPos(3);
+ int slot = stackPos(4);
+ int copyParam = stackPos(5);
+ int doUpdate = stackPos(6);
+ int dstPage = stackPos(7);
+ int backUp = stackPos(8);
+
+ _screen->hideMouse();
+ uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ _wsaSlots[slot]->setX(x);
+ _wsaSlots[slot]->setY(y);
+ _wsaSlots[slot]->setDrawPage(dstPage);
+ _wsaSlots[slot]->displayFrame(frame, copyParam | 0xC000, 0, 0);
+ _screen->updateScreen();
+
+ if (backUp)
+ memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
+
+ while (_system->getMillis() < endTime) {
+ if (doUpdate)
+ update();
+
+ if (endTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(%p) (%d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
+ int startFrame = stackPos(0);
+ int endFrame = stackPos(1);
+ int x = stackPos(2);
+ int y = stackPos(3);
+ int waitTime = stackPos(4);
+ int slot = stackPos(5);
+ int maxTimes = stackPos(6);
+ int copyFlags = stackPos(7);
+
+ if (maxTimes > 1)
+ maxTimes = 1;
+
+ _wsaSlots[slot]->setX(x);
+ _wsaSlots[slot]->setY(y);
+ _wsaSlots[slot]->setDrawPage(0);
+
+ _screen->hideMouse();
+ int curTime = 0;
+ while (curTime < maxTimes) {
+ if (startFrame < endFrame) {
+ for (int i = startFrame; i <= endFrame; ++i) {
+ uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
+
+ if (!skipFlag()) {
+ _screen->updateScreen();
+
+ do {
+ update();
+
+ if (endTime - _system->getMillis() >= 10)
+ delay(10);
+ } while (_system->getMillis() < endTime);
+ }
+ }
+ } else {
+ for (int i = startFrame; i >= endFrame; --i) {
+ uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
+
+ if (!skipFlag()) {
+ _screen->updateScreen();
+
+ do {
+ update();
+
+ if (endTime - _system->getMillis() >= 10 && !skipFlag())
+ delay(10);
+ } while (_system->getMillis() < endTime && !skipFlag());
+ }
+ }
+ }
+
+ ++curTime;
+ }
+ resetSkipFlag();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_wsaOpen(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wsaOpen(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ assert(stackPos(1) >= 0 && stackPos(1) < ARRAYSIZE(_wsaSlots));
+ _wsaSlots[stackPos(1)]->open(stackPosString(0), 1, 0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
+
+ uint16 frameDelay = stackPos(2) * _tickLength;
+ uint16 currentFrame = stackPos(3);
+ uint16 lastFrame = stackPos(4);
+ uint16 index = stackPos(5);
+ uint16 copyParam = stackPos(6) | 0xc000;
+
+ _wsaSlots[index]->setX(stackPos(0));
+ _wsaSlots[index]->setY(stackPos(1));
+ _wsaSlots[index]->setDrawPage(0);
+
+ _screen->hideMouse();
+
+ while (currentFrame <= lastFrame) {
+ uint32 endTime = _system->getMillis() + frameDelay;
+ _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
+ if (!skipFlag()) {
+ _screen->updateScreen();
+ delayUntil(endTime);
+ }
+ }
+
+ resetSkipFlag();
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequence(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+
+ const int frameDelay = stackPos(2) * _tickLength;
+ const int index = stackPos(3);
+ const bool doUpdate = (stackPos(4) != 0);
+ const uint16 copyParam = stackPos(5) | 0xc000;
+
+ _wsaSlots[index]->setX(stackPos(0));
+ _wsaSlots[index]->setY(stackPos(1));
+ _wsaSlots[index]->setDrawPage(0);
+
+ _screen->hideMouse();
+
+ int currentFrame = 0;
+ const int lastFrame = _wsaSlots[index]->frames();
+
+ while (currentFrame <= lastFrame) {
+ uint32 endTime = _system->getMillis() + frameDelay;
+ _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
+ if (!skipFlag()) {
+ if (doUpdate)
+ update();
+ _screen->updateScreen();
+ delayUntil(endTime);
+ }
+ }
+
+ resetSkipFlag();
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_addItemToInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addItemToInventory(%p) (%d, -, %d)", (const void *)script, stackPos(0), stackPos(2));
+ int slot = findFreeVisibleInventorySlot();
+ if (slot != -1) {
+ _mainCharacter.inventory[slot] = stackPos(0);
+ if (stackPos(2))
+ redrawInventory(0);
+ }
+ return slot;
+}
+
+int KyraEngine_HoF::o2_drawShape(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+
+ uint8 *shp = getShapePtr(stackPos(0) + 64);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ uint8 dsFlag = stackPos(3) & 0xff;
+ uint8 modeFlag = stackPos(4) & 0xff;
+
+ if (modeFlag) {
+ _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0);
+ } else {
+ _screen->hideMouse();
+ restorePage3();
+ _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0);
+ memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
+ _screen->drawShape(0, shp, x, y, 2, dsFlag ? 1 : 0);
+
+ flagAnimObjsForRefresh();
+ flagAnimObjsSpecialRefresh();
+ refreshAnimObjectsIfNeed();
+ _screen->showMouse();
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_addItemToCurScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ const int16 id = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+
+ int freeItem = findFreeItem();
+ x = MAX(14, x);
+ x = MIN(304, x);
+ y = MAX(14, y);
+ y = MIN(136, y);
+ if (freeItem >= 0) {
+ _itemList[freeItem].id = id;
+ _itemList[freeItem].x = x;
+ _itemList[freeItem].y = y;
+ _itemList[freeItem].sceneId = _mainCharacter.sceneId;
+ addItemToAnimList(freeItem);
+ refreshAnimObjectsIfNeed();
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::o2_loadSoundFile(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadSoundFile(%p) (%d)", (const void *)script, stackPos(0));
+ if (_sound->hasSoundFile(stackPos(0)))
+ snd_playTheme(stackPos(0), -1);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_removeSlotFromInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeSlotFromInventory(%p) (%d)", (const void *)script, stackPos(0));
+ removeSlotFromInventory(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_removeItemFromInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeItemFromInventory(%p) (%d)", (const void *)script, stackPos(0));
+ uint16 item = stackPos(0);
+ int slot = -1;
+ while ((slot = getInventoryItemSlot(item)) != -1)
+ removeSlotFromInventory(slot);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_countItemInInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemInInventory(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ uint16 item = stackPos(1);
+ int count = 0;
+
+ for (int i = 0; i < 20; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ ++count;
+ }
+
+ if ((stackPos(0) == 0) && _itemInHand == int16(item))
+ ++count;
+
+ return count;
+}
+
+int KyraEngine_HoF::o2_countItemsInScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemsInScene(%p) (%d)", (const void *)script, stackPos(0));
+ int count = 0;
+ for (int i = 0; i < 30; ++i) {
+ if (_itemList[i].sceneId == stackPos(0) && _itemList[i].id != 0xFFFF)
+ ++count;
+ }
+ return count;
+}
+
+int KyraEngine_HoF::o2_wipeDownMouseItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
+ _screen->hideMouse();
+ const int x = stackPos(1) - 8;
+ const int y = stackPos(2) - 15;
+
+ if (_itemInHand >= 0) {
+ backUpGfxRect32x32(x, y);
+ uint8 *shape = getShapePtr(_itemInHand+64);
+ for (int curY = y, height = 16; height > 0; height -= 2, curY += 2) {
+ restoreGfxRect32x32(x, y);
+ _screen->setNewShapeHeight(shape, height);
+ uint32 waitTime = _system->getMillis() + _tickLength;
+ _screen->drawShape(0, shape, x, curY, 0, 0);
+ _screen->updateScreen();
+ delayUntil(waitTime);
+ }
+ restoreGfxRect32x32(x, y);
+ _screen->resetShapeHeight(shape);
+ }
+
+ _screen->showMouse();
+ removeHandItem();
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getElapsedSecs(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getElapsedSecs(%p) ()", (const void *)script);
+ return _system->getMillis() / 1000;
+}
+
+int KyraEngine_HoF::o2_getTimerDelay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getTimerDelay(%p) (%d)", (const void *)script, stackPos(0));
+ return _timer->getDelay(stackPos(0));
+}
+
+int KyraEngine_HoF::o2_delaySecs(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_delaySecs(%p) (%d)", (const void *)script, stackPos(0));
+ delay(stackPos(0) * 1000, true);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setTimerDelay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setTimerDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _timer->setDelay(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setScaleTableItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setScaleTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setScaleTableItem(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setDrawLayerTableItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setDrawLayerTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setDrawLayerTableEntry(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setCharPalEntry(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharPalEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setCharPalEntry(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_loadZShapes(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0));
+ loadCharacterShapes(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_drawSceneShape(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
+ stackPos(2), stackPos(3));
+
+ int shape = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ int flag = (stackPos(3) != 0) ? 1 : 0;
+
+ _screen->hideMouse();
+ restorePage3();
+
+ _screen->drawShape(2, _sceneShapeTable[shape], x, y, 2, flag);
+
+ memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
+
+ _screen->drawShape(0, _sceneShapeTable[shape], x, y, 2, flag);
+
+ flagAnimObjsSpecialRefresh();
+ flagAnimObjsForRefresh();
+ refreshAnimObjectsIfNeed();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_drawSceneShapeOnPage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShapeOnPage(%p) (%d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ int shape = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ int flag = stackPos(3);
+ int drawPage = stackPos(4);
+
+ _screen->drawShape(drawPage, _sceneShapeTable[shape], x, y, 2, flag ? 1 : 0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_disableAnimObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_disableAnimObject(%p) (%d)", (const void *)script, stackPos(0));
+ _animObjects[stackPos(0)+1].enabled = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_enableAnimObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enableAnimObject(%p) (%d)", (const void *)script, stackPos(0));
+ _animObjects[stackPos(0)+1].enabled = true;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_loadPalette384(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadPalette384(%p) ('%s')", (const void *)script, stackPosString(0));
+ memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
+ _res->loadFileToBuf(stackPosString(0), _screen->getPalette(1), 384);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setPalette384(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setPalette384(%p) ()", (const void *)script);
+ memcpy(_screen->getPalette(0), _screen->getPalette(1), 384);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_restoreBackBuffer(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreBackBuffer(%p) (%d)", (const void *)script, stackPos(0));
+ int disable = stackPos(0);
+ int oldState = 0;
+
+ if (disable) {
+ oldState = _animObjects[0].enabled;
+ _animObjects[0].enabled = 0;
+ }
+
+ restorePage3();
+
+ if (disable)
+ _animObjects[0].enabled = (oldState != 0);
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_backUpInventoryGfx(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_backUpInventoryGfx(%p) ()", (const void *)script);
+ _screen->copyRegionToBuffer(1, 0, 144, 320, 56, _screenBuffer);
+ _inventorySaved = true;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_disableSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_disableSceneAnim(%p) (%d)", (const void *)script, stackPos(0));
+ _sceneAnims[stackPos(0)].flags &= ~1;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_enableSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enableSceneAnim(%p) (%d)", (const void *)script, stackPos(0));
+ _sceneAnims[stackPos(0)].flags |= 1;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_restoreInventoryGfx(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreInventoryGfx(%p) ()", (const void *)script);
+ _screen->copyBlockToPage(1, 0, 144, 320, 56, _screenBuffer);
+ _inventorySaved = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setSceneAnimPos2(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneAnimPos2(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ _sceneAnims[stackPos(0)].x2 = stackPos(1);
+ _sceneAnims[stackPos(0)].y2 = stackPos(2);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_fadeScenePal(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ fadeScenePal(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_enterNewScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0),
+ stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+
+ int skipNpcScript = stackPos(3);
+ enterNewScene(stackPos(0), stackPos(1), stackPos(2), skipNpcScript, stackPos(4));
+
+ if (!skipNpcScript)
+ runSceneScript4(0);
+
+ _unk5 = 1;
+
+ if (_mainCharX == -1 || _mainCharY == -1) {
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_switchScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_switchScene(%p) (%d)", (const void *)script, stackPos(0));
+ setGameFlag(0x1EF);
+ _mainCharX = _mainCharacter.x1;
+ _mainCharY = _mainCharacter.y1;
+ _noScriptEnter = false;
+ enterNewScene(stackPos(0), _mainCharacter.facing, 0, 0, 0);
+ _noScriptEnter = true;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setPathfinderFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0));
+ _pathfinderFlag = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getSceneExitToFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getSceneExitToFacing(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int scene = stackPos(0);
+ const int facing = stackPos(1);
+
+ if (facing == 0)
+ return (int16)_sceneList[scene].exit1;
+ else if (facing == 2)
+ return (int16)_sceneList[scene].exit2;
+ else if (facing == 4)
+ return (int16)_sceneList[scene].exit3;
+ else if (facing == 6)
+ return (int16)_sceneList[scene].exit4;
+ return -1;
+}
+
+int KyraEngine_HoF::o2_setLayerFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0));
+ int layer = stackPos(0);
+ if (layer >= 1 && layer <= 16)
+ _layerFlagTable[layer] = 1;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setZanthiaPos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setZanthiaPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _mainCharX = stackPos(0);
+ _mainCharY = stackPos(1);
+
+ if (_mainCharX == -1 && _mainCharY == -1)
+ _mainCharacter.animFrame = 32;
+ else
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_loadMusicTrack(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadMusicTrack(%p) (%d)", (const void *)script, stackPos(0));
+ snd_loadSoundFile(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_playSoundEffect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
+ snd_playSoundEffect(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setSceneAnimPos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ _sceneAnims[stackPos(0)].x = stackPos(1);
+ _sceneAnims[stackPos(0)].y = stackPos(2);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_blockInRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_blockOutRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setCauldronState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCauldronState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setCauldronState(stackPos(0), stackPos(1) != 0);
+ clearCauldronTable();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_showItemString(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showItemString(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int item = stackPos(0);
+
+ int string = 0;
+ if (stackPos(1) == 1) {
+ if (_lang == 1)
+ string = getItemCommandStringPickUp(item);
+ else
+ string = 7;
+ } else {
+ if (_lang == 1)
+ string = getItemCommandStringInv(item);
+ else
+ string = 8;
+ }
+
+ updateCommandLineEx(item+54, string, 0xD6);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_isAnySoundPlaying(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isAnySoundPlaying(%p) ()", (const void *)script);
+ return _sound->voiceIsPlaying();
+}
+
+int KyraEngine_HoF::o2_setDrawNoShapeFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setDrawNoShapeFlag(%p) (%d)", (const void *)script, stackPos(0));
+ _drawNoShapeFlag = (stackPos(0) != 0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setRunFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setRunFlag(%p) (%d)", (const void *)script, stackPos(0));
+ // this is usually just _runFlag, but since this is just used when the game should play the credits
+ // we handle it a bit different :-)
+ _showOutro = true;
+ _runFlag = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_showLetter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showLetter(%p) (%d)", (const void *)script, stackPos(0));
+ const int letter = stackPos(0);
+ char filename[16];
+
+ _screen->hideMouse();
+
+ showMessage(0, 0xCF);
+ displayInvWsaLastFrame();
+ backUpPage0();
+
+ memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
+
+ _screen->clearPage(3);
+ _screen->loadBitmap("_NOTE.CPS", 3, 3, 0);
+
+ sprintf(filename, "_NTEPAL%.1d.COL", letter+1);
+ _res->loadFileToBuf(filename, _screen->getPalette(0), 768);
+
+ _screen->fadeToBlack(0x14);
+
+ sprintf(filename, "LETTER%.1d.", letter);
+ strcat(filename, _languageExtension[_lang]);
+
+ uint8 *letterBuffer = _res->fileData(filename, 0);
+ if (letterBuffer) {
+ bookDecodeText(letterBuffer);
+ bookPrintText(2, letterBuffer, 0xC, 0xA, 0x20);
+ }
+
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->fadePalette(_screen->getPalette(0), 0x14);
+ _screen->setMouseCursor(0, 0, getShapePtr(0));
+ setMousePos(280, 160);
+
+ _screen->showMouse();
+
+ bool running = true;
+ while (running) {
+ int inputFlag = checkInput(0);
+ removeInputTop();
+
+ if (inputFlag == 198 || inputFlag == 199)
+ running = false;
+
+ _screen->updateScreen();
+ _system->delayMillis(10);
+ }
+
+ _screen->hideMouse();
+ _screen->fadeToBlack(0x14);
+ restorePage0();
+ memcpy(_screen->getPalette(0), _screen->getPalette(2), 768);
+ _screen->fadePalette(_screen->getPalette(0), 0x14);
+ setHandItem(_itemInHand);
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_fillRect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ _screen->fillRect(stackPos(1), stackPos(2), stackPos(1)+stackPos(3), stackPos(2)+stackPos(4), stackPos(5), stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_encodeShape(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_encodeShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
+ stackPos(2), stackPos(3), stackPos(4));
+ _sceneShapeTable[stackPos(0)] = _screen->encodeShape(stackPos(1), stackPos(2), stackPos(3), stackPos(4), 2);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_defineSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8),
+ stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
+ int animId = stackPos(0);
+ SceneAnim &anim = _sceneAnims[animId];
+ anim.flags = stackPos(1);
+ anim.x = stackPos(2);
+ anim.y = stackPos(3);
+ anim.x2 = stackPos(4);
+ anim.y2 = stackPos(5);
+ anim.width = stackPos(6);
+ anim.height = stackPos(7);
+ anim.specialSize = stackPos(9);
+ anim.shapeIndex = stackPos(11);
+ if (stackPosString(12) != 0)
+ strcpy(anim.filename, stackPosString(12));
+
+ if (anim.flags & 0x40) {
+ if (!_sceneAnimMovie[animId]->open(anim.filename, 1, 0))
+ error("couldn't load '%s'", anim.filename);
+
+ if (_sceneAnimMovie[animId]->xAdd() || _sceneAnimMovie[animId]->yAdd())
+ anim.wsaFlag = 1;
+ else
+ anim.wsaFlag = 0;
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_updateSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ updateSceneAnim(stackPos(0), stackPos(1));
+
+ // HACK: Some animations are really too fast because of missing delay times.
+ // Notice that the delay time is purely subjective set here, it could look
+ // slower or maybe faster in the original, but at least this looks OK for
+ // Raziel^.
+ //
+ // We know currently of some different animations where this happens.
+ // - Where Marco is dangling from the flesh-eating plant (see bug #1923638 "HoF: Marco missing animation frames").
+ // - After giving the ticket to the captain. He would move very fast (barely noticeable) onto the ship
+ // without this delay.
+ // - The scene after giving the sandwitch to the guards in the city. (see bug #1926838 "HoF: Animation plays too fast")
+ // This scene script calls o2_delay though, but since this updates the scene animation scripts again there is no delay
+ // for the animation.
+ if ((stackPos(0) == 2 && _mainCharacter.sceneId == 3) || (stackPos(0) == 3 && _mainCharacter.sceneId == 33) ||
+ ((stackPos(0) == 1 || stackPos(0) == 2) && _mainCharacter.sceneId == 19))
+ _sceneSpecialScriptsTimer[_lastProcessedSceneScript] = _system->getMillis() + _tickLength * 6;
+
+ _specialSceneScriptRunFlag = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_addToSceneAnimPosAndUpdate(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addToSceneAnimPosAndUpdate(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ const int anim = stackPos(0);
+ _sceneAnims[anim].x2 += stackPos(1);
+ _sceneAnims[anim].y2 += stackPos(2);
+ if (_sceneAnims[anim].flags & 2) {
+ _sceneAnims[anim].x += stackPos(1);
+ _sceneAnims[anim].y += stackPos(2);
+ }
+ updateSceneAnim(anim, stackPos(3));
+ _specialSceneScriptRunFlag = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_useItemOnMainChar(EMCState *script) {
+ EMCState tmpScript;
+ _emc->init(&tmpScript, &_npcScriptData);
+ _emc->start(&tmpScript, 0);
+ tmpScript.regs[4] = _itemInHand;
+ tmpScript.regs[0] = _mainCharacter.sceneId;
+
+ int oldVocH = _vocHigh;
+ _vocHigh = 0x5a;
+
+ while(_emc->isValid(&tmpScript))
+ _emc->run(&tmpScript);
+
+ _vocHigh = oldVocH;
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_startDialogue(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_startDialogue(%p) (%d)", (const void *)script, stackPos(0));
+ startDialogue(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_addCauldronStateTableEntry(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addCauldronStateTableEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ return addToCauldronStateTable(stackPos(0), stackPos(1)) ? 1 : 0;
+}
+
+int KyraEngine_HoF::o2_setCountDown(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCountDown(%p) (%d)", (const void *)script, stackPos(0));
+ _scriptCountDown = _system->getMillis() + stackPos(0) * _tickLength;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getCountDown(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCountDown(%p)", (const void *)script);
+ uint32 time = _system->getMillis();
+ return (time > _scriptCountDown) ? 0 : (_scriptCountDown - time) / _tickLength;
+}
+
+int KyraEngine_HoF::o2_pressColorKey(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0));
+ for (int i = 6; i; i--)
+ _inputColorCode[i] = _inputColorCode[i - 1];
+ _inputColorCode[0] = stackPos(0) & 0xff;
+ for (int i = 0; i < 7; i++) {
+ if (_presetColorCode[i] != _inputColorCode[6 - i])
+ return _dbgPass;
+ }
+ return 1;
+}
+
+int KyraEngine_HoF::o2_objectChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ if (_flags.isTalkie)
+ warning("Unexpected call: o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ else
+ objectChat(stackPosString(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_changeChapter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_changeChapter(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int chapter = stackPos(0);
+ const int scene = stackPos(1);
+
+ resetItemList();
+
+ _newChapterFile = chapter;
+ runStartScript(chapter, 0);
+
+ _mainCharacter.dlgIndex = 0;
+ memset(_newSceneDlgState, 0, 32);
+
+ static const int zShapeList[] = { 1, 2, 2, 2, 4 };
+ assert(chapter > 1 && chapter <= ARRAYSIZE(zShapeList));
+ loadCharacterShapes(zShapeList[chapter-1]);
+
+ enterNewScene(scene, (chapter == 2) ? 2 : 0, 0, 0, 0);
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getColorCodeFlag1(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag1(%p) ()", (const void *)script);
+ return _colorCodeFlag1;
+}
+
+int KyraEngine_HoF::o2_setColorCodeFlag1(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag1(%p) (%d)", (const void *)script, stackPos(0));
+ _colorCodeFlag1 = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getColorCodeFlag2(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag2(%p) ()", (const void *)script);
+ return _colorCodeFlag2;
+}
+
+int KyraEngine_HoF::o2_setColorCodeFlag2(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag2(%p) (%d)", (const void *)script, stackPos(0));
+ _colorCodeFlag2 = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getColorCodeValue(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeValue(%p) (%d)", (const void *)script, stackPos(0));
+ return _presetColorCode[stackPos(0)];
+}
+
+int KyraEngine_HoF::o2_setColorCodeValue(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _presetColorCode[stackPos(0)] = stackPos(1) & 0xff;
+ return stackPos(1) & 0xff;
+}
+
+int KyraEngine_HoF::o2_countItemInstances(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemInstances(%p) (%d)", (const void *)script, stackPos(0));
+ uint16 item = stackPos(0);
+
+ int count = 0;
+ for (int i = 0; i < 20; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ ++count;
+ }
+
+ if (_itemInHand == int16(item))
+ ++count;
+
+ for (int i = 0; i < 30; ++i) {
+ if (_itemList[i].id == item)
+ ++count;
+ }
+
+ if (_hiddenItems[0] == item && _newChapterFile == 1)
+ ++count;
+ if (_hiddenItems[1] == item && _newChapterFile == 1)
+ ++count;
+ if (_hiddenItems[2] == item && _newChapterFile == 2)
+ ++count;
+ if (_hiddenItems[3] == item && _newChapterFile == 2)
+ ++count;
+ if (_hiddenItems[4] == item && _newChapterFile == 1)
+ ++count;
+
+ return count;
+}
+
+int KyraEngine_HoF::o2_removeItemFromScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeItemFromScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int scene = stackPos(0);
+ const uint16 item = stackPos(1);
+ for (int i = 0; i < 30; ++i) {
+ if (_itemList[i].sceneId == scene && _itemList[i].id == item)
+ _itemList[i].id = 0xFFFF;
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::o2_initObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_initObject(%p) (%d)", (const void *)script, stackPos(0));
+ initTalkObject(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_npcChat(EMCState *script) {
+ if (_flags.isTalkie) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_npcChat(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), _vocHigh, stackPos(2));
+ npcChatSequence(stackPosString(0), stackPos(1), _vocHigh, stackPos(2));
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_npcChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ npcChatSequence(stackPosString(0), stackPos(1));
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::o2_deinitObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_deinitObject(%p) (%d)", (const void *)script, stackPos(0));
+ deinitTalkObject(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_playTimSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playTimSequence(%p) ('%s')", (const void *)script, stackPosString(0));
+ playTim(stackPosString(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_makeBookOrCauldronAppear(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_makeBookOrCauldronAppear(%p) (%d)", (const void *)script, stackPos(0));
+ seq_makeBookOrCauldronAppear(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_resetInputColorCode(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_resetInputColorCode(%p)", (const void *)script);
+ memset(_inputColorCode, 255, 7);
+ return 0;
+}
+
+int KyraEngine_HoF::o2_mushroomEffect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_mushroomEffect(%p)", (const void *)script);
+ memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);
+
+ for (int i = 1; i < 768; i += 3)
+ _screen->_currentPalette[i] = 0;
+ snd_playSoundEffect(106);
+ _screen->fadePalette(_screen->_currentPalette, 90, &_updateFunctor);
+ memcpy(_screen->_currentPalette, _screen->getPalette(2), 768);
+
+ for (int i = 0; i < 768; i += 3) {
+ _screen->_currentPalette[i] = _screen->_currentPalette[i + 1] = 0;
+ _screen->_currentPalette[i + 2] += (((int8)_screen->_currentPalette[i + 2]) >> 1);
+ if (_screen->_currentPalette[i + 2] > 63)
+ _screen->_currentPalette[i + 2] = 63;
+ }
+ snd_playSoundEffect(106);
+ _screen->fadePalette(_screen->_currentPalette, 90, &_updateFunctor);
+
+ memcpy(_screen->_currentPalette, _screen->getPalette(2), 768);
+ _screen->fadePalette(_screen->_currentPalette, 30, &_updateFunctor);
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_customChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customChat(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
+ strcpy((char*)_unkBuf500Bytes, stackPosString(0));
+ _chatText = (char*)_unkBuf500Bytes;
+ _chatObject = stackPos(1);
+
+ _chatVocHigh = _chatVocLow = -1;
+ objectChatInit(_chatText, _chatObject, _vocHigh, stackPos(2));
+ playVoice(_vocHigh, stackPos(2));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_customChatFinish(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customChatFinish(%p) ()", (const void *)script);
+ _text->restoreScreen();
+ _chatText = 0;
+ _chatObject = -1;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_setupSceneAnimation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setupSceneAnimation(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
+ const int index = stackPos(0);
+ const uint16 flags = stackPos(1);
+
+ restorePage3();
+
+ SceneAnim &anim = _sceneAnims[index];
+ anim.flags = flags;
+ anim.x = stackPos(2);
+ anim.y = stackPos(3);
+ anim.x2 = stackPos(4);
+ anim.y2 = stackPos(5);
+ anim.width = stackPos(6);
+ anim.height = stackPos(7);
+ anim.specialSize = stackPos(9);
+ anim.shapeIndex = stackPos(11);
+ if (stackPosString(12))
+ strcpy(anim.filename, stackPosString(12));
+
+ if (flags & 0x40) {
+ _sceneAnimMovie[index]->open(stackPosString(12), 0, 0);
+ if (_sceneAnimMovie[index]->xAdd() || _sceneAnimMovie[index]->yAdd())
+ anim.wsaFlag = 1;
+ else
+ anim.wsaFlag = 0;
+ }
+
+ AnimObj *obj = &_animObjects[1+index];
+ obj->enabled = 1;
+ obj->needRefresh = 1;
+ obj->specialRefresh = 1;
+ obj->animFlags = anim.flags & 8;
+
+ if (anim.flags & 2)
+ obj->flags = 0x800;
+ else
+ obj->flags = 0;
+
+ if (anim.flags & 4)
+ obj->flags |= 1;
+
+ obj->xPos1 = anim.x;
+ obj->yPos1 = anim.y;
+
+ if ((anim.flags & 0x20) && anim.shapeIndex >= 0)
+ obj->shapePtr = _sceneShapeTable[anim.shapeIndex];
+ else
+ obj->shapePtr = 0;
+
+ if (anim.flags & 0x40) {
+ obj->shapeIndex3 = anim.shapeIndex;
+ obj->animNum = index;
+ } else {
+ obj->shapeIndex3 = 0xFFFF;
+ obj->animNum = 0xFFFF;
+ }
+
+ obj->shapeIndex2 = 0xFFFF;
+ obj->xPos2 = obj->xPos3 = anim.x2;
+ obj->yPos2 = obj->yPos3 = anim.y2;
+ obj->width = anim.width;
+ obj->height = anim.height;
+ obj->width2 = obj->height2 = anim.specialSize;
+
+ _animList = addToAnimListSorted(_animList, obj);
+ obj->needRefresh = 1;
+ obj->specialRefresh = 1;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_stopSceneAnimation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_stopSceneAnimation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int index = stackPos(0);
+ AnimObj &obj = _animObjects[1+index];
+ restorePage3();
+ obj.shapeIndex3 = 0xFFFF;
+ obj.animNum = 0xFFFF;
+ obj.needRefresh = 1;
+ obj.specialRefresh = 1;
+ if (stackPos(1))
+ refreshAnimObjectsIfNeed();
+ obj.enabled = 0;
+ _animList = deleteAnimListEntry(_animList, &_animObjects[1+index]);
+
+ if (_sceneAnimMovie[index]->opened())
+ _sceneAnimMovie[index]->close();
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_processPaletteIndex(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_processPaletteIndex(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ uint8 *palette = _screen->getPalette(0);
+ const int index = stackPos(0);
+ const bool updatePalette = (stackPos(4) != 0);
+ const int delayTime = stackPos(5);
+ palette[index*3+0] = (stackPos(1) * 0x3F) / 100;
+ palette[index*3+1] = (stackPos(2) * 0x3F) / 100;
+ palette[index*3+2] = (stackPos(3) * 0x3F) / 100;
+ if (updatePalette) {
+ if (delayTime > 0)
+ _screen->fadePalette(palette, delayTime, &_updateFunctor);
+ else
+ _screen->setScreenPalette(palette);
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::o2_updateTwoSceneAnims(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ updateSceneAnim(stackPos(0), stackPos(1));
+ updateSceneAnim(stackPos(2), stackPos(3));
+ _specialSceneScriptRunFlag = false;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getRainbowRoomData(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getRainbowRoomData(%p) (%d)", (const void *)script, stackPos(0));
+ return _rainbowRoomData[stackPos(0)];
+}
+
+int KyraEngine_HoF::o2_drawSceneShapeEx(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShapeEx(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ const int itemShape = stackPos(0) + 64;
+ const int x = stackPos(1);
+ const int y = stackPos(2);
+ const bool skipFronUpdate = (stackPos(3) != 0);
+
+ _screen->drawShape(2, _sceneShapeTable[6], x, y, 2, 0);
+ _screen->drawShape(2, getShapePtr(itemShape), x+2, y+2, 2, 0);
+
+ if (!skipFronUpdate) {
+ _screen->copyRegion(x, y, x, y, 0x15, 0x14, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getBoolFromStack(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getBoolFromStack(%p) ()", (const void *)script);
+ return stackPos(0) ? 1 : 0;
+}
+
+int KyraEngine_HoF::o2_getSfxDriver(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getSfxDriver(%p) ()", (const void *)script);
+ if (_sound->getSfxType() == Sound::kAdlib)
+ return 1;
+ else if (_sound->getSfxType() == Sound::kMidiMT32)
+ return 6;
+ else if (_sound->getSfxType() == Sound::kMidiGM)
+ return 7;
+ // TODO: find nice default value
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getVocSupport(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getVocSupport(%p) ()", (const void *)script);
+ // we always support VOC file playback
+ return 1;
+}
+
+int KyraEngine_HoF::o2_getMusicDriver(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getMusicDriver(%p) ()", (const void *)script);
+ if (_sound->getMusicType() == Sound::kAdlib)
+ return 1;
+ else if (_sound->getMusicType() == Sound::kMidiMT32)
+ return 6;
+ else if (_sound->getMusicType() == Sound::kMidiGM)
+ return 7;
+ // TODO: find nice default value
+ return 0;
+}
+
+int KyraEngine_HoF::o2_zanthiaChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_zanthiaChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ objectChat(stackPosString(0), 0, _vocHigh, stackPos(1));
+ return 0;
+}
+
+int KyraEngine_HoF::o2_isVoiceEnabled(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isVoiceEnabled(%p) ()", (const void *)script);
+ return speechEnabled() ? 1 : 0;
+}
+
+int KyraEngine_HoF::o2_isVoicePlaying(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isVoicePlaying(%p) ()", (const void *)script);
+ return (snd_voiceIsPlaying() && !skipFlag()) ? 1 : 0;
+}
+
+int KyraEngine_HoF::o2_stopVoicePlaying(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_stopVoicePlaying(%p) ()", (const void *)script);
+ snd_stopVoice();
+ return 0;
+}
+
+int KyraEngine_HoF::o2_getGameLanguage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getGameLanguage(%p) ()", (const void *)script);
+ return _lang;
+}
+
+int KyraEngine_HoF::o2_demoFinale(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_demoFinale(%p) ()", (const void *)script);
+ if (!_flags.isDemo)
+ return 0;
+
+ int tmpSize;
+ const char *const *strings = _staticres->loadStrings(k2IngameTlkDemoStrings, tmpSize);
+ assert(strings);
+
+ _screen->clearPage(0);
+ _screen->loadPalette("THANKS.COL", _screen->_currentPalette);
+ _screen->loadBitmap("THANKS.CPS", 3, 3, 0);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+
+ _screen->_curPage = 0;
+ _screen->setFont(Screen::FID_6_FNT);
+ int y = _lang == 1 ? 70 : 65;
+ for (int i = 0; i < 6; i++)
+ _text->printText(strings[i], _text->getCenterStringX(strings[i], 1, 319), y + i * 10, 255, 207, 0);
+
+ _screen->setScreenPalette(_screen->_currentPalette);
+ _screen->updateScreen();
+
+ _eventList.clear();
+ while (!skipFlag())
+ delay(10);
+
+ _sound->beginFadeOut();
+ _screen->fadeToBlack();
+
+ _runFlag = 0;
+ return 0;
+}
+
+int KyraEngine_HoF::o2_dummy(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_dummy(%p) ()", (const void *)script);
+ return 0;
+}
+
+#pragma mark -
+
+int KyraEngine_HoF::o2a_setCharacterFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2a_setCharacterFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _animNewFrame = stackPos(0);
+ _animDelayTime = stackPos(1);
+ _animNeedUpdate = true;
+ return 0;
+}
+
+#pragma mark -
+
+int KyraEngine_HoF::t2_initChat(const TIM *tim, const uint16 *param) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_initChat(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
+ _chatText = (const char*)tim->text + READ_LE_UINT16(tim->text + (param[0] << 1));
+ _chatObject = param[1];
+
+ if (_flags.lang == Common::JA_JPN) {
+ for (int i = 0; i < _ingameTimJpStrSize; i += 2) {
+ if (!scumm_stricmp(_chatText, _ingameTimJpStr[i]))
+ _chatText = _ingameTimJpStr[i + 1];
+ }
+ }
+
+ objectChatInit(_chatText, _chatObject);
+ return 0;
+}
+
+int KyraEngine_HoF::t2_updateSceneAnim(const TIM *tim, const uint16 *param) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_updateSceneAnim(%p, %p) (%d, %d)", (const void*)tim, (const void*)param, param[0], param[1]);
+ updateSceneAnim(param[1], param[0]);
+ return 0;
+}
+
+int KyraEngine_HoF::t2_resetChat(const TIM *tim, const uint16 *param) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_resetChat(%p, %p) ()", (const void*)tim, (const void*)param);
+ _text->restoreScreen();
+ _chatText = 0;
+ _chatObject = -1;
+ return 0;
+}
+
+int KyraEngine_HoF::t2_playSoundEffect(const TIM *tim, const uint16 *param) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_playSoundEffect(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
+ snd_playSoundEffect(*param);
+ return 0;
+}
+
+#pragma mark -
+
+typedef Common::Functor1Mem<EMCState*, int, KyraEngine_HoF> OpcodeV2;
+#define SetOpcodeTable(x) table = &x;
+#define Opcode(x) table->push_back(new OpcodeV2(this, &KyraEngine_HoF::x))
+#define OpcodeUnImpl() table->push_back(new OpcodeV2(this, 0))
+
+typedef Common::Functor2Mem<const TIM*, const uint16*, int, KyraEngine_HoF> TIMOpcodeV2;
+#define OpcodeTim(x) _timOpcodes.push_back(new TIMOpcodeV2(this, &KyraEngine_HoF::x))
+#define OpcodeTimUnImpl() _timOpcodes.push_back(TIMOpcodeV2(this, 0))
+
+void KyraEngine_HoF::setupOpcodeTable() {
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_opcodes);
+ // 0x00
+ Opcode(o2_setCharacterFacingRefresh);
+ Opcode(o2_setCharacterPos);
+ Opcode(o2_defineObject);
+ Opcode(o2_refreshCharacter);
+ // 0x04
+ Opcode(o2_getCharacterX);
+ Opcode(o2_getCharacterY);
+ Opcode(o2_getCharacterFacing);
+ Opcode(o2_getCharacterScene);
+ // 0x08
+ Opcode(o2_setSceneComment);
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ Opcode(o2_setCharacterAnimFrame);
+ // 0x0c
+ Opcode(o2_setCharacterFacingOverwrite);
+ Opcode(o2_trySceneChange);
+ Opcode(o2_moveCharacter);
+ Opcode(o2_customCharacterChat);
+ // 0x10
+ Opcode(o2_soundFadeOut);
+ Opcode(o2_showChapterMessage);
+ Opcode(o2_restoreTalkTextMessageBkgd);
+ OpcodeUnImpl();
+ // 0x14
+ Opcode(o2_wsaClose);
+ Opcode(o2_backUpScreen);
+ Opcode(o2_restoreScreen);
+ Opcode(o2_displayWsaFrame);
+ // 0x18
+ Opcode(o2_displayWsaSequentialFramesLooping);
+ Opcode(o2_wsaOpen);
+ Opcode(o2_displayWsaSequentialFrames);
+ Opcode(o2_displayWsaSequence);
+ // 0x1c
+ Opcode(o2_addItemToInventory);
+ Opcode(o2_drawShape);
+ Opcode(o2_addItemToCurScene);
+ Opcode(o2_dummy); // the original used this opcode to limit the mouse range temporary,
+ // since that is of no use and not really important we just use a dummy here
+ // 0x20
+ Opcode(o2_checkForItem);
+ Opcode(o2_loadSoundFile);
+ Opcode(o2_removeSlotFromInventory);
+ Opcode(o2_defineItem);
+ // 0x24
+ Opcode(o2_removeItemFromInventory);
+ Opcode(o2_countItemInInventory);
+ Opcode(o2_countItemsInScene);
+ Opcode(o2_queryGameFlag);
+ // 0x28
+ Opcode(o2_resetGameFlag);
+ Opcode(o2_setGameFlag);
+ Opcode(o2_setHandItem);
+ Opcode(o2_removeHandItem);
+ // 0x2c
+ Opcode(o2_handItemSet);
+ Opcode(o2_hideMouse);
+ Opcode(o2_addSpecialExit);
+ Opcode(o2_setMousePos);
+ // 0x30
+ Opcode(o2_showMouse);
+ OpcodeUnImpl();
+ Opcode(o2_wipeDownMouseItem);
+ Opcode(o2_getElapsedSecs);
+ // 0x34
+ Opcode(o2_getTimerDelay);
+ Opcode(o2_playSoundEffect);
+ Opcode(o2_delaySecs);
+ Opcode(o2_delay);
+ // 0x38
+ Opcode(o2_dummy);
+ Opcode(o2_setTimerDelay);
+ Opcode(o2_setScaleTableItem);
+ Opcode(o2_setDrawLayerTableItem);
+ // 0x3c
+ Opcode(o2_setCharPalEntry);
+ Opcode(o2_loadZShapes);
+ Opcode(o2_drawSceneShape);
+ Opcode(o2_drawSceneShapeOnPage);
+ // 0x40
+ Opcode(o2_disableAnimObject);
+ Opcode(o2_enableAnimObject);
+ Opcode(o2_dummy);
+ Opcode(o2_loadPalette384);
+ // 0x44
+ Opcode(o2_setPalette384);
+ Opcode(o2_restoreBackBuffer);
+ Opcode(o2_backUpInventoryGfx);
+ Opcode(o2_disableSceneAnim);
+ // 0x48
+ Opcode(o2_enableSceneAnim);
+ Opcode(o2_restoreInventoryGfx);
+ Opcode(o2_setSceneAnimPos2);
+ Opcode(o2_update);
+ // 0x4c
+ OpcodeUnImpl();
+ Opcode(o2_fadeScenePal);
+ Opcode(o2_dummy);
+ Opcode(o2_dummy);
+ // 0x50
+ Opcode(o2_enterNewScene);
+ Opcode(o2_switchScene);
+ Opcode(o2_getShapeFlag1);
+ Opcode(o2_setPathfinderFlag);
+ // 0x54
+ Opcode(o2_getSceneExitToFacing);
+ Opcode(o2_setLayerFlag);
+ Opcode(o2_setZanthiaPos);
+ Opcode(o2_loadMusicTrack);
+ // 0x58
+ Opcode(o2_playWanderScoreViaMap);
+ Opcode(o2_playSoundEffect);
+ Opcode(o2_setSceneAnimPos);
+ Opcode(o2_blockInRegion);
+ // 0x5c
+ Opcode(o2_blockOutRegion);
+ OpcodeUnImpl();
+ Opcode(o2_setCauldronState);
+ Opcode(o2_showItemString);
+ // 0x60
+ Opcode(o2_getRand);
+ Opcode(o2_isAnySoundPlaying);
+ Opcode(o2_setDeathHandler);
+ Opcode(o2_setDrawNoShapeFlag);
+ // 0x64
+ Opcode(o2_setRunFlag);
+ Opcode(o2_showLetter);
+ OpcodeUnImpl();
+ Opcode(o2_fillRect);
+ // 0x68
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ Opcode(o2_waitForConfirmationClick);
+ // 0x6c
+ Opcode(o2_encodeShape);
+ Opcode(o2_defineRoomEntrance);
+ Opcode(o2_runAnimationScript);
+ Opcode(o2_setSpecialSceneScriptRunTime);
+ // 0x70
+ Opcode(o2_defineSceneAnim);
+ Opcode(o2_updateSceneAnim);
+ Opcode(o2_updateSceneAnim);
+ Opcode(o2_addToSceneAnimPosAndUpdate);
+ // 0x74
+ Opcode(o2_useItemOnMainChar);
+ Opcode(o2_startDialogue);
+ Opcode(o2_randomSceneChat);
+ Opcode(o2_setDlgIndex);
+ // 0x78
+ Opcode(o2_getDlgIndex);
+ Opcode(o2_defineScene);
+ Opcode(o2_addCauldronStateTableEntry);
+ Opcode(o2_setCountDown);
+ // 0x7c
+ Opcode(o2_getCountDown);
+ Opcode(o2_dummy);
+ Opcode(o2_dummy);
+ Opcode(o2_pressColorKey);
+ // 0x80
+ Opcode(o2_objectChat);
+ Opcode(o2_changeChapter);
+ Opcode(o2_getColorCodeFlag1);
+ Opcode(o2_setColorCodeFlag1);
+ // 0x84
+ Opcode(o2_getColorCodeFlag2);
+ Opcode(o2_setColorCodeFlag2);
+ Opcode(o2_getColorCodeValue);
+ Opcode(o2_setColorCodeValue);
+ // 0x88
+ Opcode(o2_countItemInstances);
+ Opcode(o2_removeItemFromScene);
+ Opcode(o2_initObject);
+ Opcode(o2_npcChat);
+ // 0x8c
+ Opcode(o2_deinitObject);
+ Opcode(o2_playTimSequence);
+ Opcode(o2_makeBookOrCauldronAppear);
+ Opcode(o2_setSpecialSceneScriptState);
+ // 0x90
+ Opcode(o2_clearSpecialSceneScriptState);
+ Opcode(o2_querySpecialSceneScriptState);
+ Opcode(o2_resetInputColorCode);
+ Opcode(o2_setHiddenItemsEntry);
+ // 0x94
+ Opcode(o2_getHiddenItemsEntry);
+ Opcode(o2_mushroomEffect);
+ Opcode(o2_wsaClose);
+ Opcode(o2_meanWhileScene);
+ // 0x98
+ Opcode(o2_customChat);
+ Opcode(o2_customChatFinish);
+ Opcode(o2_setupSceneAnimation);
+ Opcode(o2_stopSceneAnimation);
+ // 0x9c
+ Opcode(o2_disableTimer);
+ Opcode(o2_enableTimer);
+ Opcode(o2_setTimerCountdown);
+ Opcode(o2_processPaletteIndex);
+ // 0xa0
+ Opcode(o2_updateTwoSceneAnims);
+ Opcode(o2_getRainbowRoomData);
+ Opcode(o2_drawSceneShapeEx);
+ Opcode(o2_getBoolFromStack);
+ // 0xa4
+ Opcode(o2_getSfxDriver);
+ Opcode(o2_getVocSupport);
+ Opcode(o2_getMusicDriver);
+ Opcode(o2_setVocHigh);
+ // 0xa8
+ Opcode(o2_getVocHigh);
+ Opcode(o2_zanthiaChat);
+ Opcode(o2_isVoiceEnabled);
+ Opcode(o2_isVoicePlaying);
+ // 0xac
+ Opcode(o2_stopVoicePlaying);
+ Opcode(o2_getGameLanguage);
+ Opcode(o2_demoFinale);
+ Opcode(o2_dummy);
+
+ SetOpcodeTable(_opcodesAnimation);
+
+ // 0x00
+ Opcode(o2a_setAnimationShapes);
+ Opcode(o2a_setCharacterFrame);
+ Opcode(o2_playSoundEffect);
+ Opcode(o2_fadeScenePal);
+ // 0x04
+ _flags.isTalkie ? Opcode(o2a_setResetFrame) : Opcode(o2_dummy);
+ Opcode(o2_dummy);
+
+ // ---- TIM opcodes
+
+ // 0x00
+ OpcodeTim(t2_initChat);
+ OpcodeTim(t2_updateSceneAnim);
+ OpcodeTim(t2_resetChat);
+ OpcodeTim(t2_playSoundEffect);
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
new file mode 100644
index 0000000000..8746ec83d7
--- /dev/null
+++ b/engines/kyra/script_mr.cpp
@@ -0,0 +1,1383 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_mr.h"
+#include "kyra/script.h"
+#include "kyra/screen_mr.h"
+#include "kyra/text_mr.h"
+#include "kyra/wsamovie.h"
+#include "kyra/timer.h"
+#include "kyra/resource.h"
+
+#include "common/endian.h"
+
+namespace Kyra {
+
+int KyraEngine_MR::o3_getMalcolmShapes(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getMaloclmShapes(%p) ()", (const void *)script);
+ return _characterShapeFile;
+}
+
+int KyraEngine_MR::o3_setCharacterPos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ int x = stackPos(0);
+ int y = stackPos(1);
+
+ if (x != -1 && y != -1) {
+ x &= ~3;
+ y &= ~1;
+ }
+
+ _mainCharacter.x1 = _mainCharacter.x2 = x;
+ _mainCharacter.y1 = _mainCharacter.y2 = y;
+
+ return 0;
+}
+
+int KyraEngine_MR::o3_defineObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineObject(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
+ TalkObject &obj = _talkObjectList[stackPos(0)];
+ strcpy(obj.filename, stackPosString(1));
+ obj.sceneAnim = stackPos(2);
+ obj.sceneScript = stackPos(3);
+ obj.x = stackPos(4);
+ obj.y = stackPos(5);
+ obj.color = stackPos(6);
+ obj.sceneId = stackPos(7);
+ return 0;
+}
+
+int KyraEngine_MR::o3_refreshCharacter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_refreshCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ const int frame = stackPos(0);
+ const int facing = stackPos(1);
+ const bool updateNeed = stackPos(2) != 0;
+
+ if (facing >= 0)
+ _mainCharacter.facing = facing;
+
+ if (frame >= 0 && frame != 87)
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ else
+ _mainCharacter.animFrame = 87;
+
+ updateCharacterAnim(0);
+
+ if (updateNeed)
+ refreshAnimObjectsIfNeed();
+ return 0;
+}
+
+int KyraEngine_MR::o3_getMalcolmsMood(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getMalcolmsMood(%p) ()", (const void *)script);
+ return _malcolmsMood;
+}
+
+int KyraEngine_MR::o3_getCharacterFrameFromFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterFrameFromFacing(%p) ()", (const void *)script);
+ return _characterFrameTable[_mainCharacter.facing];
+}
+
+int KyraEngine_MR::o3_setCharacterFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0));
+ _mainCharacter.facing = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_MR::o3_showSceneFileMessage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0));
+ showMessage((const char*)getTableEntry(_scenesFile, stackPos(0)), 0xFF, 0xF0);
+ return 0;
+}
+
+int KyraEngine_MR::o3_setCharacterAnimFrameFromFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterAnimFrameFromFacing(%p) ()", (const void *)script);
+ updateCharPal(0);
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+ return 0;
+}
+
+int KyraEngine_MR::o3_showBadConscience(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showBadConscience(%p) ()", (const void *)script);
+ showBadConscience();
+ return 0;
+}
+
+int KyraEngine_MR::o3_hideBadConscience(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideBadConscience(%p) ()", (const void *)script);
+ hideBadConscience();
+ return 0;
+}
+
+int KyraEngine_MR::o3_setInventorySlot(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setInventorySlot(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int slot = MAX<int16>(0, MIN<int16>(10, stackPos(0)));
+ return (_mainCharacter.inventory[slot] = stackPos(1));
+}
+
+int KyraEngine_MR::o3_getInventorySlot(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getInventorySlot(%p) (%d)", (const void *)script, stackPos(0));
+ return _mainCharacter.inventory[stackPos(0)];
+}
+
+int KyraEngine_MR::o3_addItemToInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addItemToInventory(%p) (%d)", (const void *)script, stackPos(0));
+ int slot = findFreeInventorySlot();
+ if (slot >= 0) {
+ _mainCharacter.inventory[slot] = stackPos(0);
+ if (_inventoryState) {
+ _screen->hideMouse();
+ redrawInventory(0);
+ _screen->showMouse();
+ }
+ }
+ return slot;
+}
+
+int KyraEngine_MR::o3_addItemToCurScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ const uint16 item = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ int itemSlot = findFreeItem();
+
+ if (x < 20)
+ x = 20;
+ else if (x > 299)
+ x = 299;
+
+ if (y < 18)
+ y = 18;
+ else if (y > 187)
+ y = 187;
+
+ if (itemSlot >= 0) {
+ _itemList[itemSlot].x = x;
+ _itemList[itemSlot].y = y;
+ _itemList[itemSlot].id = item;
+ _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
+ addItemToAnimList(itemSlot);
+ refreshAnimObjectsIfNeed();
+ }
+
+ return itemSlot;
+}
+
+int KyraEngine_MR::o3_objectChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_objectChat(%p) (%d)", (const void *)script, stackPos(0));
+ int id = stackPos(0);
+ const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id);
+ if (str) {
+ objectChat(str, 0, _vocHigh, id);
+ playStudioSFX(str);
+ }
+ return 0;
+}
+
+int KyraEngine_MR::o3_resetInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_resetInventory(%p) ()", (const void *)script);
+ memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
+ return 0;
+}
+
+int KyraEngine_MR::o3_removeInventoryItemInstances(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0));
+ const int item = stackPos(0);
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ _mainCharacter.inventory[i] = 0xFFFF;
+ }
+ return 0;
+}
+
+int KyraEngine_MR::o3_countInventoryItemInstances(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_countInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0));
+ const int item = stackPos(0);
+ int count = 0;
+
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ ++count;
+ }
+
+ if (_itemInHand == item)
+ ++count;
+
+ return count;
+}
+
+int KyraEngine_MR::o3_npcChatSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_npcChatSequence(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int id = stackPos(0);
+ const char *str = (const char*)getTableEntry(_sceneStrings, id);
+ if (str)
+ npcChatSequence(str, stackPos(1), _vocHigh, id);
+ return 0;
+}
+
+int KyraEngine_MR::o3_badConscienceChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_badConscienceChat(%p) (%d)", (const void *)script, stackPos(0));
+ int id = stackPos(0);
+ const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id);
+ badConscienceChat(str, _vocHigh, id);
+ return 0;
+}
+
+int KyraEngine_MR::o3_wipeDownMouseItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
+ _screen->hideMouse();
+ const int x = stackPos(1) - 12;
+ const int y = stackPos(2) - 19;
+
+ if (_itemInHand >= 0) {
+ backUpGfxRect32x32(x, y);
+ uint8 *shape = getShapePtr(_itemInHand+248);
+ for (int curY = y, height = 20; height > 0; height -= 2, curY += 2) {
+ restoreGfxRect32x32(x, y);
+ _screen->setNewShapeHeight(shape, height);
+ uint32 waitTime = _system->getMillis() + _tickLength;
+ _screen->drawShape(0, shape, x, curY, 0, 0);
+ _screen->updateScreen();
+ delayUntil(waitTime);
+ }
+ restoreGfxRect32x32(x, y);
+ _screen->resetShapeHeight(shape);
+ }
+
+ _screen->showMouse();
+ removeHandItem();
+
+ return 0;
+}
+
+int KyraEngine_MR::o3_setMalcolmsMood(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMalcolmsMood(%p) (%d)", (const void *)script, stackPos(0));
+ return (_malcolmsMood = stackPos(0));
+}
+
+int KyraEngine_MR::o3_updateScore(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ return updateScore(stackPos(0), stackPos(1)) ? 1 : 0;
+}
+
+int KyraEngine_MR::o3_makeSecondChanceSave(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_makeSecondChanceSave(%p) ()", (const void *)script);
+ saveGame(getSavegameFilename(999), "SECOND CHANCE SAVE GAME");
+ return 0;
+}
+
+int KyraEngine_MR::o3_setSceneFilename(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneFilename(%p) (%d, '%s')", (const void *)script, stackPos(0), stackPosString(1));
+ strcpy(_sceneList[stackPos(0)].filename1, stackPosString(1));
+ _sceneList[stackPos(0)].filename1[9] = 0;
+ return 0;
+}
+
+int KyraEngine_MR::o3_removeItemsFromScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeItemsFromScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ const uint16 itemId = stackPos(0);
+ const uint16 sceneId = stackPos(1);
+ const bool allItems = (stackPos(2) != 0);
+
+ int retValue = 0;
+
+ for (int i = 0; i < 50; ++i) {
+ if (_itemList[i].sceneId == sceneId && _itemList[i].id == itemId) {
+ resetItem(i);
+ retValue = 1;
+ if (!allItems)
+ return 1;
+ }
+ }
+
+ return retValue;
+}
+
+int KyraEngine_MR::o3_disguiseMalcolm(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_disguiseMalcolm(%p) (%d)", (const void *)script, stackPos(0));
+ loadCharacterShapes(stackPos(0));
+ updateDlgIndex();
+ return 0;
+}
+
+int KyraEngine_MR::o3_drawSceneShape(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_drawSceneShape(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+
+ int shape = stackPos(0);
+ int flag = (stackPos(1) != 0) ? 1 : 0;
+
+ _screen->hideMouse();
+ restorePage3();
+
+ const int x = _sceneShapeDescs[shape].drawX;
+ const int y = _sceneShapeDescs[shape].drawY;
+
+ _screen->drawShape(2, _sceneShapes[shape], x, y, 2, flag);
+
+ _screen->copyRegionToBuffer(3, 0, 0, 320, 200, _gamePlayBuffer);
+
+ _screen->drawShape(0, _sceneShapes[shape], x, y, 2, flag);
+
+ flagAnimObjsForRefresh();
+ refreshAnimObjectsIfNeed();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_MR::o3_drawSceneShapeOnPage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_drawSceneShapeOnPage(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ const int shape = stackPos(0);
+
+ int x = _sceneShapeDescs[shape].drawX;
+ int y = _sceneShapeDescs[shape].drawY;
+ _screen->drawShape(stackPos(2), _sceneShapes[shape], x, y, 2, (stackPos(1) != 0) ? 1 : 0);
+ return 0;
+}
+
+int KyraEngine_MR::o3_checkInRect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_checkInRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ const int x1 = stackPos(0);
+ const int y1 = stackPos(1);
+ const int x2 = stackPos(2);
+ const int y2 = stackPos(3);
+ int x = stackPos(4), y = stackPos(5);
+ if (_itemInHand >= 0) {
+ const int8 *desc = &_itemBuffer2[_itemInHand*2];
+ x -= 12;
+ x += desc[0];
+ y -= 19;
+ y += desc[1];
+ }
+
+ if (x >= x1 && x <= x2 && y >= y1 && y <= y2) {
+ //XXX
+ return 1;
+ } else {
+ //XXX
+ return 0;
+ }
+}
+
+int KyraEngine_MR::o3_updateConversations(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateConversations(%p) (%d)", (const void *)script, stackPos(0));
+ int dlgIndex = stackPos(0);
+ switch (_currentChapter-2) {
+ case 0:
+ dlgIndex -= 34;
+ break;
+
+ case 1:
+ dlgIndex -= 54;
+ break;
+
+ case 2:
+ dlgIndex -= 55;
+ break;
+
+ case 3:
+ dlgIndex -= 70;
+ break;
+
+ default:
+ break;
+ }
+
+ int convs[4];
+ Common::set_to(convs, convs+4, -1);
+
+ if (_currentChapter == 1) {
+ switch (_mainCharacter.dlgIndex) {
+ case 0:
+ convs[0] = 6;
+ convs[1] = 12;
+ break;
+
+ case 2:
+ convs[0] = 8;
+ convs[1] = 14;
+ break;
+
+ case 3:
+ convs[0] = 9;
+ convs[1] = 15;
+ break;
+
+ case 4:
+ convs[0] = 10;
+ convs[1] = 16;
+ break;
+
+ case 5:
+ convs[0] = 11;
+ convs[1] = 17;
+ break;
+
+ case 6:
+ convs[0] = 0;
+ convs[1] = 12;
+ break;
+
+ case 8:
+ convs[0] = 2;
+ convs[1] = 14;
+ break;
+
+ case 9:
+ convs[0] = 3;
+ convs[1] = 15;
+ break;
+
+ case 10:
+ convs[0] = 4;
+ convs[1] = 16;
+ break;
+
+ case 11:
+ convs[0] = 5;
+ convs[1] = 17;
+ break;
+
+ case 12:
+ convs[0] = 0;
+ convs[1] = 6;
+ break;
+
+ case 14:
+ convs[0] = 2;
+ convs[1] = 8;
+ break;
+
+ case 15:
+ convs[0] = 3;
+ convs[1] = 9;
+ break;
+
+ case 16:
+ convs[0] = 4;
+ convs[1] = 10;
+ break;
+
+ case 17:
+ convs[0] = 5;
+ convs[1] = 11;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_currentChapter == 2) {
+ switch (_mainCharacter.dlgIndex) {
+ case 0:
+ convs[0] = 4;
+ convs[1] = 8;
+ convs[2] = 5;
+ convs[3] = 9;
+ break;
+
+ case 1:
+ convs[0] = 4;
+ convs[1] = 8;
+ convs[2] = 0;
+ convs[3] = 5;
+ break;
+
+ case 2:
+ convs[0] = 6;
+ convs[2] = 11;
+ break;
+
+ case 3:
+ convs[0] = 7;
+ convs[2] = 12;
+ break;
+
+ case 4:
+ convs[0] = 0;
+ convs[1] = 8;
+ convs[2] = 1;
+ convs[3] = 9;
+ break;
+
+ case 5:
+ convs[0] = 0;
+ convs[1] = 8;
+ convs[2] = 4;
+ convs[3] = 1;
+ break;
+
+ case 6:
+ convs[0] = 2;
+ convs[1] = 10;
+ break;
+
+ case 7:
+ convs[0] = 3;
+ convs[1] = 11;
+ break;
+
+ case 8:
+ convs[0] = 0;
+ convs[1] = 4;
+ convs[2] = 1;
+ break;
+
+ case 9:
+ convs[0] = 0;
+ convs[1] = 4;
+ convs[2] = 0;
+ convs[4] = 1;
+ break;
+
+ case 10:
+ convs[0] = 2;
+ convs[1] = 6;
+ break;
+
+ case 11:
+ convs[0] = 3;
+ convs[1] = 7;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_currentChapter == 4) {
+ if (_malcolmsMood == 0) {
+ convs[0] = _mainCharacter.dlgIndex - 10;
+ convs[1] = _mainCharacter.dlgIndex - 5;
+ } else if (_malcolmsMood == 1) {
+ convs[0] = _mainCharacter.dlgIndex + 5;
+ convs[1] = _mainCharacter.dlgIndex + 10;
+ } else if (_malcolmsMood == 2) {
+ convs[0] = _mainCharacter.dlgIndex - 5;
+ convs[1] = _mainCharacter.dlgIndex + 5;
+ }
+ }
+
+ for (int i = 0; i < 4; ++i) {
+ if (convs[i] != -1)
+ _conversationState[dlgIndex][convs[i]] = 0;
+ }
+
+ return 1;
+}
+
+int KyraEngine_MR::o3_setSceneDim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneDim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _sceneMinX = stackPos(0);
+ _sceneMaxX = stackPos(1);
+ return 0;
+}
+
+int KyraEngine_MR::o3_setSceneAnimPosAndFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneAnimPosAndFrame(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ SceneAnim &anim = _sceneAnims[stackPos(0)];
+ const int newX2 = stackPos(1);
+ const int newY2 = stackPos(2);
+ const int newX = stackPos(3);
+ const int newY = stackPos(4);
+
+ if (newX2 >= 0)
+ anim.x2 = newX2;
+ if (newY2 >= 0)
+ anim.y2 = newY2;
+
+ if (newX >= 0)
+ anim.x = newX;
+ else
+ anim.x = anim.x2 + (anim.width >> 1);
+
+ if (newY >= 0)
+ anim.y = newY;
+ else
+ anim.y = anim.y2 + anim.height - 1;
+
+ updateSceneAnim(stackPos(0), stackPos(5));
+ _specialSceneScriptRunFlag = false;
+ return 0;
+}
+
+int KyraEngine_MR::o3_removeItemInstances(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeItemInstances(%p) (%d)", (const void *)script, stackPos(0));
+ const int16 item = stackPos(0);
+
+ int deleted = 0;
+
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == item) {
+ _mainCharacter.inventory[i] = 0xFFFF;
+ ++deleted;
+ }
+ }
+
+ if (_itemInHand == item) {
+ removeHandItem();
+ ++deleted;
+ }
+
+ for (int i = 0; i < 50; ++i) {
+ if (_itemList[i].id == item) {
+ _itemList[i].id = 0xFFFF;
+ ++deleted;
+ }
+ }
+
+ return deleted;
+}
+
+int KyraEngine_MR::o3_disableInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_disableInventory(%p) ()", (const void *)script);
+ _enableInventory = false;
+ return 0;
+}
+
+int KyraEngine_MR::o3_enableInventory(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_enableInventory(%p) ()", (const void *)script);
+ _enableInventory = true;
+ return 1;
+}
+
+int KyraEngine_MR::o3_enterNewScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0),
+ stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+
+ _screen->hideMouse();
+ enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+
+ _unk5 = 1;
+
+ if (_mainCharX == -1 || _mainCharY == -1) {
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
+ }
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_MR::o3_switchScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_switchScene(%p) (%d)", (const void *)script, stackPos(0));
+ setGameFlag(1);
+ _mainCharX = _mainCharacter.x1;
+ _mainCharY = _mainCharacter.y1;
+ _noScriptEnter = false;
+ enterNewScene(stackPos(0), _mainCharacter.facing, 0, 0, 0);
+ _noScriptEnter = true;
+ return 0;
+}
+
+int KyraEngine_MR::o3_setMalcolmPos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMalcolmPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _mainCharX = stackPos(0);
+ _mainCharY = stackPos(1);
+
+ if (_mainCharX == -1 && _mainCharY == -1)
+ _mainCharacter.animFrame = 87;
+ else
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+
+ return 0;
+}
+
+int KyraEngine_MR::o3_stopMusic(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_stopMusic(%p) ()", (const void *)script);
+ stopMusicTrack();
+ return 0;
+}
+
+int KyraEngine_MR::o3_playSoundEffect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ snd_playSoundEffect(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_MR::o3_getScore(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getScore(%p) ()", (const void *)script);
+ return _score;
+}
+
+int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_daggerWarning(%p) ()", (const void *)script);
+ int selection = 1;
+
+ _screen->hideMouse();
+ _screen->copyRegionToBuffer(1, 0, 0, 320, 200, _screenBuffer);
+ int curPageBackUp = _screen->_curPage;
+ _screen->_curPage = 2;
+
+ _screen->drawFilledBox(0, 0, 0x13F, 0xC7, 0xB4, 0xB3, 0xB6);
+ _screen->drawFilledBox(0xF, 0xAA, 0x68, 0xBA, 0xB4, 0xB3, 0xB6);
+ _screen->drawFilledBox(0x73, 0xAA, 0xCC, 0xBA, 0xB4, 0xB3, 0xB6);
+ _screen->drawFilledBox(0xD6, 0xAA, 0x12F, 0xBA, 0xB4, 0xB3, 0xB6);
+
+ int y = 15;
+ for (int i = 100; i <= 107; ++i) {
+ const char *str = (const char *)getTableEntry(_cCodeFile, i);
+ int x = _text->getCenterStringX(str, 0, 0x13F);
+ _text->printText(str, x, y, 0xFF, 0xF0, 0x00);
+ y += 10;
+ }
+ y += 15;
+ for (int i = 110; i <= 113; ++i) {
+ const char *str = (const char *)getTableEntry(_cCodeFile, i);
+ int x = _text->getCenterStringX(str, 0, 0x13F);
+ _text->printText(str, x, y, 0xFF, 0xF0, 0x00);
+ y += 10;
+ }
+
+ const char *str = 0;
+ int x = 0;
+
+ str = (const char *)getTableEntry(_cCodeFile, 120);
+ x = _text->getCenterStringX(str, 0xF, 0x68);
+ _text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+ str = (const char *)getTableEntry(_cCodeFile, 121);
+ x = _text->getCenterStringX(str, 0x73, 0xCC);
+ _text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+ str = (const char *)getTableEntry(_cCodeFile, 122);
+ x = _text->getCenterStringX(str, 0xD6, 0x12F);
+ _text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+
+ _screen->_curPage = curPageBackUp;
+ _screen->showMouse();
+
+ while (!_quitFlag) {
+ int keys = checkInput(0);
+ removeInputTop();
+
+ if (keys == 198 || keys == 199) {
+ if (_mouseX >= 15 && _mouseX <= 104 && _mouseY >= 170 && _mouseY <= 186) {
+ selection = 1;
+ break;
+ } else if (_mouseX >= 115 && _mouseX <= 204 && _mouseY >= 170 && _mouseY <= 186) {
+ selection = 2;
+ break;
+ } else if (_mouseX >= 214 && _mouseX <= 303 && _mouseY >= 170 && _mouseY <= 186) {
+ selection = 3;
+ break;
+ }
+ }
+
+ delay(10);
+ }
+
+ restorePage3();
+ _screen->copyBlockToPage(1, 0, 0, 320, 200, _screenBuffer);
+ return selection;
+}
+
+int KyraEngine_MR::o3_blockOutRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ const int x1 = stackPos(0);
+ int y1 = stackPos(1);
+ const int x2 = stackPos(2);
+ int y2 = stackPos(3);
+
+ if (y1 < _maskPageMinY)
+ y1 = _maskPageMinY;
+ if (y2 > _maskPageMaxY)
+ y2 = _maskPageMaxY;
+
+ _screen->blockOutRegion(x1, y1, x2-x1+1, y2-y1+1);
+ return 0;
+}
+
+int KyraEngine_MR::o3_showSceneStringsMessage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showSceneStringsMessage(%p) (%d)", (const void *)script, stackPos(0));
+ showMessage((const char*)getTableEntry(_sceneStrings, stackPos(0)), 0xFF, 0xF0);
+ return 0;
+}
+
+int KyraEngine_MR::o3_showGoodConscience(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showGoodConscience(%p) ()", (const void *)script);
+ showGoodConscience();
+ return 0;
+}
+
+int KyraEngine_MR::o3_goodConscienceChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_goodConscienceChat(%p) (%d)", (const void *)script, stackPos(0));
+ int id = stackPos(0);
+ const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id);
+ goodConscienceChat(str, _vocHigh, id);
+ return 0;
+}
+
+int KyraEngine_MR::o3_hideGoodConscience(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideGoodConscience(%p) ()", (const void *)script);
+ hideGoodConscience();
+ return 0;
+}
+
+int KyraEngine_MR::o3_defineSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')",
+ (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7),
+ stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
+ const int animId = stackPos(0);
+ SceneAnim &anim = _sceneAnims[animId];
+
+ musicUpdate(0);
+
+ uint16 flags = anim.flags = stackPos(1);
+ int x = anim.x = stackPos(2);
+ int y = anim.y = stackPos(3);
+ int x2 = anim.x2 = stackPos(4);
+ int y2 = anim.y2 = stackPos(5);
+ int w = anim.width = stackPos(6);
+ int h = anim.height = stackPos(7);
+ anim.specialSize = stackPos(9);
+ anim.shapeIndex = stackPos(11);
+ const char *filename = stackPosString(12);
+
+ if (filename)
+ strcpy(anim.filename, filename);
+
+ if (flags & 8) {
+ _sceneAnimMovie[animId]->open(filename, 1, 0);
+ musicUpdate(0);
+ if (_sceneAnimMovie[animId]->opened()) {
+ anim.wsaFlag = 1;
+ if (x2 == -1)
+ x2 = _sceneAnimMovie[animId]->xAdd();
+ if (y2 == -1)
+ y2 = _sceneAnimMovie[animId]->yAdd();
+ if (w == -1)
+ w = _sceneAnimMovie[animId]->width();
+ if (h == -1)
+ h = _sceneAnimMovie[animId]->height();
+ if (x == -1)
+ x = (w >> 1) + x2;
+ if (y == -1)
+ y = y2 + h - 1;
+
+ anim.x = x;
+ anim.y = y;
+ anim.x2 = x2;
+ anim.y2 = y2;
+ anim.width = w;
+ anim.height = h;
+ }
+ }
+
+ musicUpdate(0);
+
+ return 9;
+}
+
+int KyraEngine_MR::o3_updateSceneAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ updateSceneAnim(stackPos(0), stackPos(1));
+ _specialSceneScriptRunFlag = false;
+ return 0;
+}
+
+int KyraEngine_MR::o3_runActorScript(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_runActorScript(%p) ()", (const void *)script);
+ EMCData data;
+ EMCState state;
+ memset(&data, 0, sizeof(data));
+ memset(&state, 0, sizeof(state));
+
+ _res->exists("_ACTOR.EMC", true);
+ _emc->load("_ACTOR.EMC", &data, &_opcodes);
+ _emc->init(&state, &data);
+ _emc->start(&state, 0);
+
+ state.regs[4] = _itemInHand;
+ state.regs[0] = _mainCharacter.sceneId;
+
+ int vocHigh = _vocHigh;
+ _vocHigh = 200;
+ _useActorBuffer = true;
+
+ while (_emc->isValid(&state))
+ _emc->run(&state);
+
+ _useActorBuffer = false;
+ _vocHigh = vocHigh;
+ _emc->unload(&data);
+
+ if (queryGameFlag(0x218)) {
+ resetGameFlag(0x218);
+ enterNewScene(78, -1, 0, 0, 0);
+ }
+
+ return 0;
+}
+
+int KyraEngine_MR::o3_runDialog(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_runDialog(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ runDialog(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_MR::o3_setConversationState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setConversationState(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ int id = stackPos(0);
+ const int dlgIndex = stackPos(1);
+ const int value = stackPos(2);
+
+ switch (_currentChapter-2) {
+ case 0:
+ id -= 34;
+ break;
+
+ case 1:
+ id -= 54;
+ break;
+
+ case 2:
+ id -= 55;
+ break;
+
+ case 3:
+ id -= 70;
+ break;
+
+ default:
+ break;
+ }
+
+ return (_conversationState[id][dlgIndex] = value);
+}
+
+int KyraEngine_MR::o3_getConversationState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getConversationState(%p) (%d)", (const void *)script, stackPos(0));
+ int id = stackPos(0);
+ const int dlgIndex = _mainCharacter.dlgIndex;
+
+ switch (_currentChapter-2) {
+ case 0:
+ id -= 34;
+ break;
+
+ case 1:
+ id -= 54;
+ break;
+
+ case 2:
+ id -= 55;
+ break;
+
+ case 3:
+ id -= 70;
+ break;
+
+ default:
+ break;
+ }
+
+ return _conversationState[id][dlgIndex];
+}
+
+int KyraEngine_MR::o3_changeChapter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_changeChapter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ changeChapter(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ return 0;
+}
+
+int KyraEngine_MR::o3_countItemInstances(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_countItemInstances(%p) (%d)", (const void *)script, stackPos(0));
+ int count = 0;
+ const int16 item = stackPos(0);
+
+ for (int i = 0; i < 10; ++i) {
+ if (_mainCharacter.inventory[i] == item)
+ ++count;
+ }
+
+ if (_itemInHand == item)
+ ++count;
+
+ for (int i = 0; i < 50; ++i) {
+ if (_itemList[i].id == item)
+ ++count;
+ }
+
+ return count;
+}
+
+int KyraEngine_MR::o3_dialogStartScript(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dialogStartScript(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ dialogStartScript(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_MR::o3_dialogEndScript(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dialogEndScript(%p) (%d)", (const void *)script, stackPos(0));
+ dialogEndScript(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_MR::o3_customChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_customChat(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ const int id = stackPos(0);
+ const int object = stackPos(1);
+ const char *str = (const char *)getTableEntry(_sceneStrings, id);
+
+ if (!str)
+ return 0;
+
+ strcpy(_stringBuffer, str);
+ _chatText = _stringBuffer;
+ _chatObject = object;
+ _chatVocHigh = _chatVocLow = -1;
+ objectChatInit(_stringBuffer, object, _vocHigh, id);
+ playVoice(_vocHigh, id);
+ return 0;
+}
+
+int KyraEngine_MR::o3_customChatFinish(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_customChatFinish(%p) ()", (const void *)script);
+ _text->restoreScreen();
+ _chatText = 0;
+ _chatObject = -1;
+ return 0;
+}
+
+int KyraEngine_MR::o3_setupSceneAnimObject(EMCState *script) {
+ debugC(9, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setupSceneAnimObject(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9),
+ stackPos(10), stackPos(11), stackPosString(12));
+ musicUpdate(0);
+ setupSceneAnimObject(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8),
+ stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
+ return 0;
+}
+
+int KyraEngine_MR::o3_removeSceneAnimObject(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeSceneAnimObject(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ removeSceneAnimObject(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_MR::o3_dummy(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dummy(%p) ()", (const void *)script);
+ return 0;
+}
+
+#pragma mark -
+
+int KyraEngine_MR::o3a_setCharacterFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3a_setCharacterFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ static const uint8 frameTable[] = {
+ 0x58, 0xD8, 0xD8, 0x98, 0x78, 0x78, 0xB8, 0xB8
+ };
+
+ _animNewFrame = stackPos(0);
+ if (_useFrameTable)
+ _animNewFrame += frameTable[_mainCharacter.facing];
+
+ _animDelayTime = stackPos(1);
+ _animNeedUpdate = true;
+ return 0;
+}
+
+#pragma mark -
+
+int KyraEngine_MR::o3d_updateAnim(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_updateAnim(%p) (%d)", (const void *)script, stackPos(0));
+ if (_dialogSceneAnim >= 0)
+ updateSceneAnim(_dialogSceneAnim, stackPos(0));
+ return 0;
+}
+
+int KyraEngine_MR::o3d_delay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_delay(%p) (%d)", (const void *)script, stackPos(0));
+ const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength;
+ while (_system->getMillis() < endTime) {
+ if (_chatText)
+ updateWithText();
+ else
+ update();
+
+ _system->delayMillis(10);
+ }
+ return 0;
+}
+
+#pragma mark -
+
+typedef Common::Functor1Mem<EMCState*, int, KyraEngine_MR> OpcodeV3;
+#define SetOpcodeTable(x) table = &x;
+#define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_MR::x))
+#define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0))
+void KyraEngine_MR::setupOpcodeTable() {
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_opcodes);
+ // 0x00
+ Opcode(o3_getMalcolmShapes);
+ Opcode(o3_setCharacterPos);
+ Opcode(o3_defineObject);
+ Opcode(o3_refreshCharacter);
+ // 0x04
+ Opcode(o2_getCharacterX);
+ Opcode(o2_getCharacterY);
+ Opcode(o2_getCharacterFacing);
+ Opcode(o2_getCharacterScene);
+ // 0x08
+ Opcode(o3_getMalcolmsMood);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_getCharacterFrameFromFacing);
+ // 0x0c
+ Opcode(o2_setCharacterFacingOverwrite);
+ Opcode(o2_trySceneChange);
+ Opcode(o2_moveCharacter);
+ Opcode(o3_setCharacterFacing);
+ // 0x10
+ OpcodeUnImpl();
+ Opcode(o3_showSceneFileMessage);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0x14
+ Opcode(o3_setCharacterAnimFrameFromFacing);
+ Opcode(o3_showBadConscience);
+ Opcode(o3_dummy);
+ Opcode(o3_hideBadConscience);
+ // 0x18
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ Opcode(o3_setInventorySlot);
+ Opcode(o3_getInventorySlot);
+ // 0x1c
+ Opcode(o3_addItemToInventory);
+ OpcodeUnImpl();
+ Opcode(o3_addItemToCurScene);
+ Opcode(o3_objectChat);
+ // 0x20
+ Opcode(o2_checkForItem);
+ Opcode(o3_dummy);
+ Opcode(o3_resetInventory);
+ Opcode(o2_defineItem);
+ // 0x24
+ Opcode(o3_removeInventoryItemInstances);
+ Opcode(o3_countInventoryItemInstances);
+ Opcode(o3_npcChatSequence);
+ Opcode(o2_queryGameFlag);
+ // 0x28
+ Opcode(o2_resetGameFlag);
+ Opcode(o2_setGameFlag);
+ Opcode(o2_setHandItem);
+ Opcode(o2_removeHandItem);
+ // 0x2c
+ Opcode(o2_handItemSet);
+ Opcode(o2_hideMouse);
+ Opcode(o2_addSpecialExit);
+ Opcode(o2_setMousePos);
+ // 0x30
+ Opcode(o2_showMouse);
+ Opcode(o3_badConscienceChat);
+ Opcode(o3_wipeDownMouseItem);
+ Opcode(o3_dummy);
+ // 0x34
+ Opcode(o3_setMalcolmsMood);
+ Opcode(o3_playSoundEffect);
+ Opcode(o3_dummy);
+ Opcode(o2_delay);
+ // 0x38
+ Opcode(o3_updateScore);
+ Opcode(o3_makeSecondChanceSave);
+ Opcode(o3_setSceneFilename);
+ OpcodeUnImpl();
+ // 0x3c
+ Opcode(o3_removeItemsFromScene);
+ Opcode(o3_disguiseMalcolm);
+ Opcode(o3_drawSceneShape);
+ Opcode(o3_drawSceneShapeOnPage);
+ // 0x40
+ Opcode(o3_checkInRect);
+ Opcode(o3_updateConversations);
+ OpcodeUnImpl();
+ Opcode(o3_dummy);
+ // 0x44
+ Opcode(o3_dummy);
+ Opcode(o3_setSceneDim);
+ OpcodeUnImpl();
+ Opcode(o3_dummy);
+ // 0x48
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_setSceneAnimPosAndFrame);
+ Opcode(o2_update);
+ // 0x4c
+ Opcode(o3_removeItemInstances);
+ Opcode(o3_dummy);
+ Opcode(o3_disableInventory);
+ Opcode(o3_enableInventory);
+ // 0x50
+ Opcode(o3_enterNewScene);
+ Opcode(o3_switchScene);
+ Opcode(o2_getShapeFlag1);
+ Opcode(o3_dummy);
+ // 0x54
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_setMalcolmPos);
+ Opcode(o3_stopMusic);
+ // 0x58
+ Opcode(o2_playWanderScoreViaMap);
+ Opcode(o3_playSoundEffect);
+ Opcode(o3_getScore);
+ Opcode(o3_daggerWarning);
+ // 0x5c
+ Opcode(o3_blockOutRegion);
+ Opcode(o3_dummy);
+ Opcode(o3_showSceneStringsMessage);
+ OpcodeUnImpl();
+ // 0x60
+ Opcode(o2_getRand);
+ Opcode(o3_dummy);
+ Opcode(o2_setDeathHandler);
+ Opcode(o3_showGoodConscience);
+ // 0x64
+ Opcode(o3_goodConscienceChat);
+ Opcode(o3_hideGoodConscience);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0x68
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o2_waitForConfirmationClick);
+ // 0x6c
+ Opcode(o3_dummy);
+ Opcode(o2_defineRoomEntrance);
+ Opcode(o2_runAnimationScript);
+ Opcode(o2_setSpecialSceneScriptRunTime);
+ // 0x70
+ Opcode(o3_defineSceneAnim);
+ Opcode(o3_dummy);
+ Opcode(o3_updateSceneAnim);
+ Opcode(o3_dummy);
+ // 0x74
+ Opcode(o3_runActorScript);
+ Opcode(o3_runDialog);
+ Opcode(o2_randomSceneChat);
+ Opcode(o2_setDlgIndex);
+ // 0x78
+ Opcode(o2_getDlgIndex);
+ Opcode(o2_defineScene);
+ Opcode(o3_setConversationState);
+ OpcodeUnImpl();
+ // 0x7c
+ OpcodeUnImpl();
+ Opcode(o3_getConversationState);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0x80
+ Opcode(o3_dummy);
+ Opcode(o3_changeChapter);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0x84
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0x88
+ Opcode(o3_countItemInstances);
+ Opcode(o3_dummy);
+ Opcode(o3_dialogStartScript);
+ Opcode(o3_dummy);
+ // 0x8c
+ Opcode(o3_dialogEndScript);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o2_setSpecialSceneScriptState);
+ // 0x90
+ Opcode(o2_clearSpecialSceneScriptState);
+ Opcode(o2_querySpecialSceneScriptState);
+ Opcode(o3_dummy);
+ Opcode(o2_setHiddenItemsEntry);
+ // 0x94
+ Opcode(o2_getHiddenItemsEntry);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ OpcodeUnImpl();
+ // 0x98
+ Opcode(o3_customChat);
+ Opcode(o3_customChatFinish);
+ Opcode(o3_setupSceneAnimObject);
+ Opcode(o3_removeSceneAnimObject);
+ // 0x9c
+ Opcode(o2_disableTimer);
+ Opcode(o2_enableTimer);
+ Opcode(o2_setTimerCountdown);
+ OpcodeUnImpl();
+ // 0xa0
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ Opcode(o3_dummy);
+ // 0xa4
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ Opcode(o2_setVocHigh);
+ // 0xa8
+ Opcode(o2_getVocHigh);
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ OpcodeUnImpl();
+ // 0xac
+ OpcodeUnImpl();
+ Opcode(o3_dummy);
+ OpcodeUnImpl();
+ Opcode(o3_dummy);
+
+ SetOpcodeTable(_opcodesAnimation);
+ // 0x00
+ Opcode(o2a_setAnimationShapes);
+ Opcode(o3a_setCharacterFrame);
+ Opcode(o3_playSoundEffect);
+ Opcode(o3_dummy);
+ // 0x0a
+ Opcode(o2a_setResetFrame);
+ Opcode(o2_getRand);
+ Opcode(o3_getMalcolmShapes);
+ Opcode(o3_dummy);
+
+ SetOpcodeTable(_opcodesDialog);
+ // 0x00
+ Opcode(o3d_updateAnim);
+ Opcode(o3d_delay);
+ Opcode(o2_getRand);
+ Opcode(o2_queryGameFlag);
+ // 0x04
+ Opcode(o3_dummy);
+}
+
+} // end of namespace Kyra
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index 50ad1b8b0c..a258482802 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -37,13 +37,13 @@
#include "kyra/timer.h"
namespace Kyra {
-int KyraEngine_v1::o1_magicInMouseItem(ScriptState *script) {
+int KyraEngine_v1::o1_magicInMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicInMouseItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
magicInMouseItem(stackPos(0), stackPos(1), -1);
return 0;
}
-int KyraEngine_v1::o1_characterSays(ScriptState *script) {
+int KyraEngine_v1::o1_characterSays(EMCState *script) {
_skipFlag = false;
if (_flags.isTalkie) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
@@ -74,7 +74,7 @@ int KyraEngine_v1::o1_characterSays(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_pauseTicks(ScriptState *script) {
+int KyraEngine_v1::o1_pauseTicks(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseTicks(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
if (stackPos(1)) {
warning("STUB: special o1_pauseTicks");
@@ -86,33 +86,33 @@ int KyraEngine_v1::o1_pauseTicks(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_drawSceneAnimShape(ScriptState *script) {
+int KyraEngine_v1::o1_drawSceneAnimShape(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawSceneAnimShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->drawShape(stackPos(4), _sprites->_sceneShapes[stackPos(0)], stackPos(1), stackPos(2), 0, (stackPos(3) != 0) ? 1 : 0);
return 0;
}
-int KyraEngine_v1::o1_queryGameFlag(ScriptState *script) {
+int KyraEngine_v1::o1_queryGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryGameFlag(%p) (0x%X)", (const void *)script, stackPos(0));
return queryGameFlag(stackPos(0));
}
-int KyraEngine_v1::o1_setGameFlag(ScriptState *script) {
+int KyraEngine_v1::o1_setGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setGameFlag(%p) (0x%X)", (const void *)script, stackPos(0));
return setGameFlag(stackPos(0));
}
-int KyraEngine_v1::o1_resetGameFlag(ScriptState *script) {
+int KyraEngine_v1::o1_resetGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetGameFlag(%p) (0x%X)", (const void *)script, stackPos(0));
return resetGameFlag(stackPos(0));
}
-int KyraEngine_v1::o1_runNPCScript(ScriptState *script) {
+int KyraEngine_v1::o1_runNPCScript(EMCState *script) {
warning("STUB: o1_runNPCScript");
return 0;
}
-int KyraEngine_v1::o1_setSpecialExitList(ScriptState *script) {
+int KyraEngine_v1::o1_setSpecialExitList(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialExitList(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9));
for (int i = 0; i < 10; ++i)
@@ -122,19 +122,19 @@ int KyraEngine_v1::o1_setSpecialExitList(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_blockInWalkableRegion(ScriptState *script) {
+int KyraEngine_v1::o1_blockInWalkableRegion(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockInWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
-int KyraEngine_v1::o1_blockOutWalkableRegion(ScriptState *script) {
+int KyraEngine_v1::o1_blockOutWalkableRegion(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockOutWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
-int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) {
+int KyraEngine_v1::o1_walkPlayerToPoint(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkPlayerToPoint(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int normalTimers = stackPos(2);
@@ -153,7 +153,7 @@ int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) {
}
if (reinitScript)
- _scriptInterpreter->initScript(script, script->dataPtr);
+ _emc->init(script, script->dataPtr);
if (_sceneChangeState) {
_sceneChangeState = 0;
@@ -162,7 +162,7 @@ int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_dropItemInScene(ScriptState *script) {
+int KyraEngine_v1::o1_dropItemInScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dropItemInScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int item = stackPos(0);
int xpos = stackPos(1);
@@ -187,7 +187,7 @@ int KyraEngine_v1::o1_dropItemInScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_drawAnimShapeIntoScene(ScriptState *script) {
+int KyraEngine_v1::o1_drawAnimShapeIntoScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawAnimShapeIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->hideMouse();
_animator->restoreAllObjectBackgrounds();
@@ -205,49 +205,49 @@ int KyraEngine_v1::o1_drawAnimShapeIntoScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_createMouseItem(ScriptState *script) {
+int KyraEngine_v1::o1_createMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createMouseItem(%p) (%d)", (const void *)script, stackPos(0));
createMouseItem(stackPos(0));
return 0;
}
-int KyraEngine_v1::o1_savePageToDisk(ScriptState *script) {
+int KyraEngine_v1::o1_savePageToDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_savePageToDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->savePageToDisk(stackPosString(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_sceneAnimOn(ScriptState *script) {
+int KyraEngine_v1::o1_sceneAnimOn(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOn(%p) (%d)", (const void *)script, stackPos(0));
_sprites->_anims[stackPos(0)].play = true;
return 0;
}
-int KyraEngine_v1::o1_sceneAnimOff(ScriptState *script) {
+int KyraEngine_v1::o1_sceneAnimOff(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOff(%p) (%d)", (const void *)script, stackPos(0));
_sprites->_anims[stackPos(0)].play = false;
return 0;
}
-int KyraEngine_v1::o1_getElapsedSeconds(ScriptState *script) {
+int KyraEngine_v1::o1_getElapsedSeconds(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getElapsedSeconds(%p) ()", (const void *)script);
return _system->getMillis() / 1000;
}
-int KyraEngine_v1::o1_mouseIsPointer(ScriptState *script) {
+int KyraEngine_v1::o1_mouseIsPointer(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_mouseIsPointer(%p) ()", (const void *)script);
if (_itemInHand == -1)
return 1;
return 0;
}
-int KyraEngine_v1::o1_destroyMouseItem(ScriptState *script) {
+int KyraEngine_v1::o1_destroyMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_destroyMouseItem(%p) ()", (const void *)script);
destroyMouseItem();
return 0;
}
-int KyraEngine_v1::o1_runSceneAnimUntilDone(ScriptState *script) {
+int KyraEngine_v1::o1_runSceneAnimUntilDone(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runSceneAnimUntilDone(%p) (%d)", (const void *)script, stackPos(0));
_screen->hideMouse();
_animator->restoreAllObjectBackgrounds();
@@ -265,7 +265,7 @@ int KyraEngine_v1::o1_runSceneAnimUntilDone(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_fadeSpecialPalette(ScriptState *script) {
+int KyraEngine_v1::o1_fadeSpecialPalette(EMCState *script) {
if (_flags.platform == Common::kPlatformAmiga) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeSpecialPalette(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
if (_currentCharacter->sceneId != 45) {
@@ -283,42 +283,42 @@ int KyraEngine_v1::o1_fadeSpecialPalette(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_playAdlibSound(ScriptState *script) {
+int KyraEngine_v1::o1_playAdlibSound(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibSound(%p) (%d)", (const void *)script, stackPos(0));
snd_playSoundEffect(stackPos(0));
return 0;
}
-int KyraEngine_v1::o1_playAdlibScore(ScriptState *script) {
+int KyraEngine_v1::o1_playAdlibScore(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_phaseInSameScene(ScriptState *script) {
+int KyraEngine_v1::o1_phaseInSameScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_phaseInSameScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
transcendScenes(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_setScenePhasingFlag(ScriptState *script) {
+int KyraEngine_v1::o1_setScenePhasingFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScenePhasingFlag(%p) ()", (const void *)script);
_scenePhasingFlag = 1;
return 1;
}
-int KyraEngine_v1::o1_resetScenePhasingFlag(ScriptState *script) {
+int KyraEngine_v1::o1_resetScenePhasingFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScenePhasingFlag(%p) ()", (const void *)script);
_scenePhasingFlag = 0;
return 0;
}
-int KyraEngine_v1::o1_queryScenePhasingFlag(ScriptState *script) {
+int KyraEngine_v1::o1_queryScenePhasingFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryScenePhasingFlag(%p) ()", (const void *)script);
return _scenePhasingFlag;
}
-int KyraEngine_v1::o1_sceneToDirection(ScriptState *script) {
+int KyraEngine_v1::o1_sceneToDirection(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneToDirection(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < _roomTableSize);
Room *curRoom = &_roomTable[stackPos(0)];
@@ -348,7 +348,7 @@ int KyraEngine_v1::o1_sceneToDirection(ScriptState *script) {
return returnValue;
}
-int KyraEngine_v1::o1_setBirthstoneGem(ScriptState *script) {
+int KyraEngine_v1::o1_setBirthstoneGem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBirthstoneGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
int index = stackPos(0);
if (index < 4 && index >= 0) {
@@ -358,19 +358,19 @@ int KyraEngine_v1::o1_setBirthstoneGem(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_placeItemInGenericMapScene(ScriptState *script) {
+int KyraEngine_v1::o1_placeItemInGenericMapScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInGenericMapScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
placeItemInGenericMapScene(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_setBrandonStatusBit(ScriptState *script) {
+int KyraEngine_v1::o1_setBrandonStatusBit(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
_brandonStatusBit |= stackPos(0);
return 0;
}
-int KyraEngine_v1::o1_pauseSeconds(ScriptState *script) {
+int KyraEngine_v1::o1_pauseSeconds(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseSeconds(%p) (%d)", (const void *)script, stackPos(0));
if (stackPos(0) > 0 && !_skipFlag)
delay(stackPos(0)*1000, true);
@@ -378,41 +378,41 @@ int KyraEngine_v1::o1_pauseSeconds(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_getCharactersLocation(ScriptState *script) {
+int KyraEngine_v1::o1_getCharactersLocation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersLocation(%p) (%d)", (const void *)script, stackPos(0));
return _characterList[stackPos(0)].sceneId;
}
-int KyraEngine_v1::o1_runNPCSubscript(ScriptState *script) {
+int KyraEngine_v1::o1_runNPCSubscript(EMCState *script) {
warning("STUB: o1_runNPCSubscript");
return 0;
}
-int KyraEngine_v1::o1_magicOutMouseItem(ScriptState *script) {
+int KyraEngine_v1::o1_magicOutMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicOutMouseItem(%p) (%d)", (const void *)script, stackPos(0));
magicOutMouseItem(stackPos(0), -1);
return 0;
}
-int KyraEngine_v1::o1_internalAnimOn(ScriptState *script) {
+int KyraEngine_v1::o1_internalAnimOn(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOn(%p) (%d)", (const void *)script, stackPos(0));
_animator->sprites()[stackPos(0)].active = 1;
return 0;
}
-int KyraEngine_v1::o1_forceBrandonToNormal(ScriptState *script) {
+int KyraEngine_v1::o1_forceBrandonToNormal(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_forceBrandonToNormal(%p) ()", (const void *)script);
checkAmuletAnimFlags();
return 0;
}
-int KyraEngine_v1::o1_poisonDeathNow(ScriptState *script) {
+int KyraEngine_v1::o1_poisonDeathNow(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonDeathNow(%p) ()", (const void *)script);
seq_poisonDeathNow(1);
return 0;
}
-int KyraEngine_v1::o1_setScaleMode(ScriptState *script) {
+int KyraEngine_v1::o1_setScaleMode(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleMode(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int len = stackPos(0);
int setValue1 = stackPos(1);
@@ -430,7 +430,7 @@ int KyraEngine_v1::o1_setScaleMode(ScriptState *script) {
return _scaleMode;
}
-int KyraEngine_v1::o1_openWSAFile(ScriptState *script) {
+int KyraEngine_v1::o1_openWSAFile(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_openWSAFile(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3));
const char *filename = stackPosString(0);
@@ -442,7 +442,7 @@ int KyraEngine_v1::o1_openWSAFile(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_closeWSAFile(ScriptState *script) {
+int KyraEngine_v1::o1_closeWSAFile(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_closeWSAFile(%p) (%d)", (const void *)script, stackPos(0));
int wsaIndex = stackPos(0);
@@ -452,7 +452,7 @@ int KyraEngine_v1::o1_closeWSAFile(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_runWSAFromBeginningToEnd(ScriptState *script) {
+int KyraEngine_v1::o1_runWSAFromBeginningToEnd(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFromBeginningToEnd(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->hideMouse();
@@ -493,7 +493,7 @@ int KyraEngine_v1::o1_runWSAFromBeginningToEnd(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_displayWSAFrame(ScriptState *script) {
+int KyraEngine_v1::o1_displayWSAFrame(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrame(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int frame = stackPos(0);
int xpos = stackPos(1);
@@ -520,13 +520,13 @@ int KyraEngine_v1::o1_displayWSAFrame(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_enterNewScene(ScriptState *script) {
+int KyraEngine_v1::o1_enterNewScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
return 0;
}
-int KyraEngine_v1::o1_setSpecialEnterXAndY(ScriptState *script) {
+int KyraEngine_v1::o1_setSpecialEnterXAndY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialEnterXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_brandonPosX = stackPos(0);
_brandonPosY = stackPos(1);
@@ -535,7 +535,7 @@ int KyraEngine_v1::o1_setSpecialEnterXAndY(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_runWSAFrames(ScriptState *script) {
+int KyraEngine_v1::o1_runWSAFrames(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFrames(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int xpos = stackPos(0);
int ypos = stackPos(1);
@@ -562,7 +562,7 @@ int KyraEngine_v1::o1_runWSAFrames(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) {
+int KyraEngine_v1::o1_popBrandonIntoScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popBrandonIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int changeScaleMode = stackPos(3);
int xpos = (int16)(stackPos(0) & 0xFFFC);
@@ -576,7 +576,7 @@ int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) {
int yOffset = _defaultShapeTable[0].yOffset;
int width = _defaultShapeTable[0].w << 3;
int height = _defaultShapeTable[0].h;
- AnimObject *curAnim = _animator->actors();
+ Animator_v1::AnimObject *curAnim = _animator->actors();
if (changeScaleMode) {
curAnim->x1 = _currentCharacter->x1;
@@ -611,7 +611,7 @@ int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_restoreAllObjectBackgrounds(ScriptState *script) {
+int KyraEngine_v1::o1_restoreAllObjectBackgrounds(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreAllObjectBackgrounds(%p) (%d)", (const void *)script, stackPos(0));
int disable = stackPos(0);
int activeBackup = 0;
@@ -625,20 +625,20 @@ int KyraEngine_v1::o1_restoreAllObjectBackgrounds(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_setCustomPaletteRange(ScriptState *script) {
+int KyraEngine_v1::o1_setCustomPaletteRange(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCustomPaletteRange(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
memcpy(_screen->getPalette(1) + stackPos(1)*3, _specialPalettes[stackPos(0)], stackPos(2)*3);
return 0;
}
-int KyraEngine_v1::o1_loadPageFromDisk(ScriptState *script) {
+int KyraEngine_v1::o1_loadPageFromDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
_animator->_updateScreen = true;
return 0;
}
-int KyraEngine_v1::o1_customPrintTalkString(ScriptState *script) {
+int KyraEngine_v1::o1_customPrintTalkString(EMCState *script) {
if (_flags.isTalkie) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
@@ -659,35 +659,35 @@ int KyraEngine_v1::o1_customPrintTalkString(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_restoreCustomPrintBackground(ScriptState *script) {
+int KyraEngine_v1::o1_restoreCustomPrintBackground(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreCustomPrintBackground(%p) ()", (const void *)script);
_text->restoreTalkTextMessageBkgd(2, 0);
return 0;
}
-int KyraEngine_v1::o1_hideMouse(ScriptState *script) {
+int KyraEngine_v1::o1_hideMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_hideMouse(%p) ()", (const void *)script);
_screen->hideMouse();
return 0;
}
-int KyraEngine_v1::o1_showMouse(ScriptState *script) {
+int KyraEngine_v1::o1_showMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_showMouse(%p) ()", (const void *)script);
_screen->showMouse();
return 0;
}
-int KyraEngine_v1::o1_getCharacterX(ScriptState *script) {
+int KyraEngine_v1::o1_getCharacterX(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterX(%p) (%d)", (const void *)script, stackPos(0));
return _characterList[stackPos(0)].x1;
}
-int KyraEngine_v1::o1_getCharacterY(ScriptState *script) {
+int KyraEngine_v1::o1_getCharacterY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterY(%p) (%d)", (const void *)script, stackPos(0));
return _characterList[stackPos(0)].y1;
}
-int KyraEngine_v1::o1_changeCharactersFacing(ScriptState *script) {
+int KyraEngine_v1::o1_changeCharactersFacing(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int character = stackPos(0);
int facing = stackPos(1);
@@ -705,7 +705,7 @@ int KyraEngine_v1::o1_changeCharactersFacing(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_copyWSARegion(ScriptState *script) {
+int KyraEngine_v1::o1_copyWSARegion(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_copyWSARegion(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int xpos = stackPos(0);
int ypos = stackPos(1);
@@ -718,7 +718,7 @@ int KyraEngine_v1::o1_copyWSARegion(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_printText(ScriptState *script) {
+int KyraEngine_v1::o1_printText(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_printText(%p) ('%s', %d, %d, 0x%X, 0x%X)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
if (_flags.lang == Common::JA_JPN && stackPos(3) == 7)
_screen->printText(stackPosString(0), stackPos(1), stackPos(2), 0, 0x80);
@@ -728,18 +728,18 @@ int KyraEngine_v1::o1_printText(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_random(ScriptState *script) {
+int KyraEngine_v1::o1_random(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_random(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < stackPos(1));
return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
}
-int KyraEngine_v1::o1_loadSoundFile(ScriptState *script) {
+int KyraEngine_v1::o1_loadSoundFile(EMCState *script) {
warning("STUB: o1_loadSoundFile");
return 0;
}
-int KyraEngine_v1::o1_displayWSAFrameOnHidPage(ScriptState *script) {
+int KyraEngine_v1::o1_displayWSAFrameOnHidPage(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrameOnHidPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int frame = stackPos(0);
int xpos = stackPos(1);
@@ -768,7 +768,7 @@ int KyraEngine_v1::o1_displayWSAFrameOnHidPage(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_displayWSASequentialFrames(ScriptState *script) {
+int KyraEngine_v1::o1_displayWSASequentialFrames(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSASequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
int startFrame = stackPos(0);
int endFrame = stackPos(1);
@@ -844,7 +844,7 @@ int KyraEngine_v1::o1_displayWSASequentialFrames(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_drawCharacterStanding(ScriptState *script) {
+int KyraEngine_v1::o1_drawCharacterStanding(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawCharacterStanding(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int character = stackPos(0);
int animFrame = stackPos(1);
@@ -859,13 +859,13 @@ int KyraEngine_v1::o1_drawCharacterStanding(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_internalAnimOff(ScriptState *script) {
+int KyraEngine_v1::o1_internalAnimOff(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOff(%p) (%d)", (const void *)script, stackPos(0));
_animator->sprites()[stackPos(0)].active = 0;
return 0;
}
-int KyraEngine_v1::o1_changeCharactersXAndY(ScriptState *script) {
+int KyraEngine_v1::o1_changeCharactersXAndY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersXAndY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
Character *ch = &_characterList[stackPos(0)];
int16 x = stackPos(1);
@@ -881,25 +881,25 @@ int KyraEngine_v1::o1_changeCharactersXAndY(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_clearSceneAnimatorBeacon(ScriptState *script) {
+int KyraEngine_v1::o1_clearSceneAnimatorBeacon(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_clearSceneAnimatorBeacon(%p) ()", (const void *)script);
_sprites->_sceneAnimatorBeaconFlag = 0;
return 0;
}
-int KyraEngine_v1::o1_querySceneAnimatorBeacon(ScriptState *script) {
+int KyraEngine_v1::o1_querySceneAnimatorBeacon(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_querySceneAnimatorBeacon(%p) ()", (const void *)script);
return _sprites->_sceneAnimatorBeaconFlag;
}
-int KyraEngine_v1::o1_refreshSceneAnimator(ScriptState *script) {
+int KyraEngine_v1::o1_refreshSceneAnimator(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_refreshSceneAnimator(%p) ()", (const void *)script);
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
return 0;
}
-int KyraEngine_v1::o1_placeItemInOffScene(ScriptState *script) {
+int KyraEngine_v1::o1_placeItemInOffScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInOffScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int item = stackPos(0);
int xpos = stackPos(1);
@@ -918,7 +918,7 @@ int KyraEngine_v1::o1_placeItemInOffScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_wipeDownMouseItem(ScriptState *script) {
+int KyraEngine_v1::o1_wipeDownMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_wipeDownMouseItem(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
_screen->hideMouse();
wipeDownMouseItem(stackPos(1), stackPos(2));
@@ -927,7 +927,7 @@ int KyraEngine_v1::o1_wipeDownMouseItem(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_placeCharacterInOtherScene(ScriptState *script) {
+int KyraEngine_v1::o1_placeCharacterInOtherScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeCharacterInOtherScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int id = stackPos(0);
int sceneId = stackPos(1);
@@ -944,18 +944,18 @@ int KyraEngine_v1::o1_placeCharacterInOtherScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_getKey(ScriptState *script) {
+int KyraEngine_v1::o1_getKey(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getKey(%p) ()", (const void *)script);
waitForEvent();
return 0;
}
-int KyraEngine_v1::o1_specificItemInInventory(ScriptState *script) {
+int KyraEngine_v1::o1_specificItemInInventory(EMCState *script) {
warning("STUB: o1_specificItemInInventory");
return 0;
}
-int KyraEngine_v1::o1_popMobileNPCIntoScene(ScriptState *script) {
+int KyraEngine_v1::o1_popMobileNPCIntoScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popMobileNPCIntoScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE));
int character = stackPos(0);
int sceneId = stackPos(1);
@@ -976,25 +976,25 @@ int KyraEngine_v1::o1_popMobileNPCIntoScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_mobileCharacterInScene(ScriptState *script) {
+int KyraEngine_v1::o1_mobileCharacterInScene(EMCState *script) {
warning("STUB: o1_mobileCharacterInScene");
return 0;
}
-int KyraEngine_v1::o1_hideMobileCharacter(ScriptState *script) {
+int KyraEngine_v1::o1_hideMobileCharacter(EMCState *script) {
warning("STUB: o1_hideMobileCharacter");
return 0;
}
-int KyraEngine_v1::o1_unhideMobileCharacter(ScriptState *script) {
+int KyraEngine_v1::o1_unhideMobileCharacter(EMCState *script) {
warning("STUB: o1_unhideMobileCharacter");
return 0;
}
-int KyraEngine_v1::o1_setCharactersLocation(ScriptState *script) {
+int KyraEngine_v1::o1_setCharactersLocation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersLocation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
Character *ch = &_characterList[stackPos(0)];
- AnimObject *animObj = &_animator->actors()[stackPos(0)];
+ Animator_v1::AnimObject *animObj = &_animator->actors()[stackPos(0)];
int newScene = stackPos(1);
if (_currentCharacter->sceneId == ch->sceneId) {
if (_currentCharacter->sceneId != newScene)
@@ -1008,7 +1008,7 @@ int KyraEngine_v1::o1_setCharactersLocation(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_walkCharacterToPoint(ScriptState *script) {
+int KyraEngine_v1::o1_walkCharacterToPoint(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkCharacterToPoint(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int character = stackPos(0);
int toX = stackPos(1);
@@ -1090,7 +1090,7 @@ int KyraEngine_v1::o1_walkCharacterToPoint(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(ScriptState *script) {
+int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventDisplayBrynnsNote(%p) ()", (const void *)script);
_screen->hideMouse();
_screen->savePageToDisk("HIDPAGE.TMP", 2);
@@ -1112,7 +1112,7 @@ int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(ScriptState *script) {
+int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventRemoveBrynnsNote(%p) ()", (const void *)script);
_screen->hideMouse();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
@@ -1123,13 +1123,13 @@ int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_setLogicPage(ScriptState *script) {
+int KyraEngine_v1::o1_setLogicPage(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setLogicPage(%p) (%d)", (const void *)script, stackPos(0));
_screen->_curPage = stackPos(0);
return stackPos(0);
}
-int KyraEngine_v1::o1_fatPrint(ScriptState *script) {
+int KyraEngine_v1::o1_fatPrint(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fatPrint(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
// Workaround for bug #1582672 ("KYRA1: Text crippled and drawn wrong")
@@ -1142,13 +1142,13 @@ int KyraEngine_v1::o1_fatPrint(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_preserveAllObjectBackgrounds(ScriptState *script) {
+int KyraEngine_v1::o1_preserveAllObjectBackgrounds(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_preserveAllObjectBackgrounds(%p) ()", (const void *)script);
_animator->preserveAllBackgrounds();
return 0;
}
-int KyraEngine_v1::o1_updateSceneAnimations(ScriptState *script) {
+int KyraEngine_v1::o1_updateSceneAnimations(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_updateSceneAnimations(%p) (%d)", (const void *)script, stackPos(0));
int times = stackPos(0);
while (times--) {
@@ -1158,23 +1158,23 @@ int KyraEngine_v1::o1_updateSceneAnimations(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_sceneAnimationActive(ScriptState *script) {
+int KyraEngine_v1::o1_sceneAnimationActive(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimationActive(%p) (%d)", (const void *)script, stackPos(0));
return _sprites->_anims[stackPos(0)].play;
}
-int KyraEngine_v1::o1_setCharactersMovementDelay(ScriptState *script) {
+int KyraEngine_v1::o1_setCharactersMovementDelay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersMovementDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_timer->setDelay(stackPos(0)+5, stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_getCharactersFacing(ScriptState *script) {
+int KyraEngine_v1::o1_getCharactersFacing(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersFacing(%p) (%d)", (const void *)script, stackPos(0));
return _characterList[stackPos(0)].facing;
}
-int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(ScriptState *script) {
+int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(%p) (%d)", (const void *)script, stackPos(0));
_screen->copyBackgroundBlock(stackPos(0), 2, 0);
_screen->copyBackgroundBlock2(stackPos(0));
@@ -1188,13 +1188,13 @@ int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_dispelMagicAnimation(ScriptState *script) {
+int KyraEngine_v1::o1_dispelMagicAnimation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dispelMagicAnimation(%p) ()", (const void *)script);
seq_dispelMagicAnimation();
return 0;
}
-int KyraEngine_v1::o1_findBrightestFireberry(ScriptState *script) {
+int KyraEngine_v1::o1_findBrightestFireberry(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_findBrightestFireberry(%p) ()", (const void *)script);
if (_currentCharacter->sceneId >= 187 && _currentCharacter->sceneId <= 198)
return 29;
@@ -1238,7 +1238,7 @@ int KyraEngine_v1::o1_findBrightestFireberry(ScriptState *script) {
return brightestFireberry;
}
-int KyraEngine_v1::o1_setFireberryGlowPalette(ScriptState *script) {
+int KyraEngine_v1::o1_setFireberryGlowPalette(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFireberryGlowPalette(%p) (%d)", (const void *)script, stackPos(0));
int palIndex = 0;
switch (stackPos(0)) {
@@ -1275,19 +1275,19 @@ int KyraEngine_v1::o1_setFireberryGlowPalette(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_setDeathHandlerFlag(ScriptState *script) {
+int KyraEngine_v1::o1_setDeathHandlerFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0));
_deathHandler = stackPos(0);
return 0;
}
-int KyraEngine_v1::o1_drinkPotionAnimation(ScriptState *script) {
+int KyraEngine_v1::o1_drinkPotionAnimation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drinkPotionAnimation(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2));
return 0;
}
-int KyraEngine_v1::o1_makeAmuletAppear(ScriptState *script) {
+int KyraEngine_v1::o1_makeAmuletAppear(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_makeAmuletAppear(%p) ()", (const void *)script);
WSAMovieV1 amulet(this);
amulet.open("AMULET.WSA", 1, 0);
@@ -1328,7 +1328,7 @@ int KyraEngine_v1::o1_makeAmuletAppear(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_drawItemShapeIntoScene(ScriptState *script) {
+int KyraEngine_v1::o1_drawItemShapeIntoScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawItemShapeIntoScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int item = stackPos(0);
int x = stackPos(1);
@@ -1355,13 +1355,13 @@ int KyraEngine_v1::o1_drawItemShapeIntoScene(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_setCharactersCurrentFrame(ScriptState *script) {
+int KyraEngine_v1::o1_setCharactersCurrentFrame(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_characterList[stackPos(0)].currentAnimFrame = stackPos(1);
return 0;
}
-int KyraEngine_v1::o1_waitForConfirmationMouseClick(ScriptState *script) {
+int KyraEngine_v1::o1_waitForConfirmationMouseClick(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_waitForConfirmationMouseClick(%p) ()", (const void *)script);
// if (mouseEnabled) {
while (!_mousePressFlag) {
@@ -1386,39 +1386,39 @@ int KyraEngine_v1::o1_waitForConfirmationMouseClick(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_pageFlip(ScriptState *script) {
+int KyraEngine_v1::o1_pageFlip(EMCState *script) {
warning("STUB: o1_pageFlip");
return 0;
}
-int KyraEngine_v1::o1_setSceneFile(ScriptState *script) {
+int KyraEngine_v1::o1_setSceneFile(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneFile(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
setSceneFile(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_getItemInMarbleVase(ScriptState *script) {
+int KyraEngine_v1::o1_getItemInMarbleVase(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getItemInMarbleVase(%p) ()", (const void *)script);
return _marbleVaseItem;
}
-int KyraEngine_v1::o1_setItemInMarbleVase(ScriptState *script) {
+int KyraEngine_v1::o1_setItemInMarbleVase(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setItemInMarbleVase(%p) (%d)", (const void *)script, stackPos(0));
_marbleVaseItem = stackPos(0);
return 0;
}
-int KyraEngine_v1::o1_addItemToInventory(ScriptState *script) {
+int KyraEngine_v1::o1_addItemToInventory(EMCState *script) {
warning("STUB: o1_addItemToInventory");
return 0;
}
-int KyraEngine_v1::o1_intPrint(ScriptState *script) {
+int KyraEngine_v1::o1_intPrint(EMCState *script) {
warning("STUB: o1_intPrint");
return 0;
}
-int KyraEngine_v1::o1_shakeScreen(ScriptState *script) {
+int KyraEngine_v1::o1_shakeScreen(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
int waitTicks = stackPos(1);
int times = stackPos(0);
@@ -1431,57 +1431,57 @@ int KyraEngine_v1::o1_shakeScreen(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_createAmuletJewel(ScriptState *script) {
+int KyraEngine_v1::o1_createAmuletJewel(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createAmuletJewel(%p) (%d)", (const void *)script, stackPos(0));
seq_createAmuletJewel(stackPos(0), 0, 0, 0);
return 0;
}
-int KyraEngine_v1::o1_setSceneAnimCurrXY(ScriptState *script) {
+int KyraEngine_v1::o1_setSceneAnimCurrXY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneAnimCurrXY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
_sprites->_anims[stackPos(0)].x = stackPos(1);
_sprites->_anims[stackPos(0)].y = stackPos(2);
return 0;
}
-int KyraEngine_v1::o1_poisonBrandonAndRemaps(ScriptState *script) {
+int KyraEngine_v1::o1_poisonBrandonAndRemaps(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonBrandonAndRemaps(%p) ()", (const void *)script);
setBrandonPoisonFlags(1);
return 0;
}
-int KyraEngine_v1::o1_fillFlaskWithWater(ScriptState *script) {
+int KyraEngine_v1::o1_fillFlaskWithWater(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillFlaskWithWater(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
seq_fillFlaskWithWater(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_getCharactersMovementDelay(ScriptState *script) {
+int KyraEngine_v1::o1_getCharactersMovementDelay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersMovementDelay(%p) (%d)", (const void *)script, stackPos(0));
return _timer->getDelay(stackPos(0)+5);
}
-int KyraEngine_v1::o1_getBirthstoneGem(ScriptState *script) {
+int KyraEngine_v1::o1_getBirthstoneGem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getBirthstoneGem(%p) (%d)", (const void *)script, stackPos(0));
if (stackPos(0) < 4)
return _birthstoneGemTable[stackPos(0)];
return 0;
}
-int KyraEngine_v1::o1_queryBrandonStatusBit(ScriptState *script) {
+int KyraEngine_v1::o1_queryBrandonStatusBit(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
if (_brandonStatusBit & stackPos(0))
return 1;
return 0;
}
-int KyraEngine_v1::o1_playFluteAnimation(ScriptState *script) {
+int KyraEngine_v1::o1_playFluteAnimation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playFluteAnimation(%p) ()", (const void *)script);
seq_playFluteAnimation();
return 0;
}
-int KyraEngine_v1::o1_playWinterScrollSequence(ScriptState *script) {
+int KyraEngine_v1::o1_playWinterScrollSequence(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playWinterScrollSequence(%p) (%d)", (const void *)script, stackPos(0));
if (!stackPos(0))
seq_winterScroll2();
@@ -1490,40 +1490,40 @@ int KyraEngine_v1::o1_playWinterScrollSequence(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_getIdolGem(ScriptState *script) {
+int KyraEngine_v1::o1_getIdolGem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getIdolGem(%p) (%d)", (const void *)script, stackPos(0));
return _idolGemsTable[stackPos(0)];
}
-int KyraEngine_v1::o1_setIdolGem(ScriptState *script) {
+int KyraEngine_v1::o1_setIdolGem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setIdolGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_idolGemsTable[stackPos(0)] = stackPos(1);
return 0;
}
-int KyraEngine_v1::o1_totalItemsInScene(ScriptState *script) {
+int KyraEngine_v1::o1_totalItemsInScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_totalItemsInScene(%p) (%d)", (const void *)script, stackPos(0));
return countItemsInScene(stackPos(0));
}
-int KyraEngine_v1::o1_restoreBrandonsMovementDelay(ScriptState *script) {
+int KyraEngine_v1::o1_restoreBrandonsMovementDelay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreBrandonsMovementDelay(%p) ()", (const void *)script);
setWalkspeed(_configWalkspeed);
return 0;
}
-int KyraEngine_v1::o1_setMousePos(ScriptState *script) {
+int KyraEngine_v1::o1_setMousePos(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_system->warpMouse(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_getMouseState(ScriptState *script) {
+int KyraEngine_v1::o1_getMouseState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getMouseState(%p) ()", (const void *)script);
return _mouseState;
}
-int KyraEngine_v1::o1_setEntranceMouseCursorTrack(ScriptState *script) {
+int KyraEngine_v1::o1_setEntranceMouseCursorTrack(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setEntranceMouseCursorTrack(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_entranceMouseCursorTracks[0] = stackPos(0);
_entranceMouseCursorTracks[1] = stackPos(1);
@@ -1533,19 +1533,19 @@ int KyraEngine_v1::o1_setEntranceMouseCursorTrack(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_itemAppearsOnGround(ScriptState *script) {
+int KyraEngine_v1::o1_itemAppearsOnGround(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemAppearsOnGround(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
processItemDrop(_currentCharacter->sceneId, stackPos(0), stackPos(1), stackPos(2), 2, 0);
return 0;
}
-int KyraEngine_v1::o1_setNoDrawShapesFlag(ScriptState *script) {
+int KyraEngine_v1::o1_setNoDrawShapesFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoDrawShapesFlag(%p) (%d)", (const void *)script, stackPos(0));
_animator->_noDrawShapesFlag = stackPos(0);
return 0;
}
-int KyraEngine_v1::o1_fadeEntirePalette(ScriptState *script) {
+int KyraEngine_v1::o1_fadeEntirePalette(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeEntirePalette(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
int cmd = stackPos(0);
uint8 *fadePal = 0;
@@ -1585,7 +1585,7 @@ int KyraEngine_v1::o1_fadeEntirePalette(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_itemOnGroundHere(ScriptState *script) {
+int KyraEngine_v1::o1_itemOnGroundHere(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemOnGroundHere(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < _roomTableSize);
Room *curRoom = &_roomTable[stackPos(0)];
@@ -1596,18 +1596,18 @@ int KyraEngine_v1::o1_itemOnGroundHere(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_queryCauldronState(ScriptState *script) {
+int KyraEngine_v1::o1_queryCauldronState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCauldronState(%p) ()", (const void *)script);
return _cauldronState;
}
-int KyraEngine_v1::o1_setCauldronState(ScriptState *script) {
+int KyraEngine_v1::o1_setCauldronState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCauldronState(%p) (%d)", (const void *)script, stackPos(0));
_cauldronState = stackPos(0);
return _cauldronState;
}
-int KyraEngine_v1::o1_queryCrystalState(ScriptState *script) {
+int KyraEngine_v1::o1_queryCrystalState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCrystalState(%p) (%d)", (const void *)script, stackPos(0));
if (!stackPos(0))
return _crystalState[0];
@@ -1616,7 +1616,7 @@ int KyraEngine_v1::o1_queryCrystalState(ScriptState *script) {
return -1;
}
-int KyraEngine_v1::o1_setCrystalState(ScriptState *script) {
+int KyraEngine_v1::o1_setCrystalState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCrystalState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
if (!stackPos(0))
_crystalState[0] = stackPos(1);
@@ -1625,12 +1625,12 @@ int KyraEngine_v1::o1_setCrystalState(ScriptState *script) {
return stackPos(1);
}
-int KyraEngine_v1::o1_setPaletteRange(ScriptState *script) {
+int KyraEngine_v1::o1_setPaletteRange(EMCState *script) {
warning("STUB: o1_setPaletteRange");
return 0;
}
-int KyraEngine_v1::o1_shrinkBrandonDown(ScriptState *script) {
+int KyraEngine_v1::o1_shrinkBrandonDown(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shrinkBrandonDown(%p) (%d)", (const void *)script, stackPos(0));
int delayTime = stackPos(0);
checkAmuletAnimFlags();
@@ -1656,7 +1656,7 @@ int KyraEngine_v1::o1_shrinkBrandonDown(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_growBrandonUp(ScriptState *script) {
+int KyraEngine_v1::o1_growBrandonUp(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_growBrandonUp(%p) ()", (const void *)script);
int scaleValue = _scaleTable[_currentCharacter->y1];
int scale = 0;
@@ -1677,33 +1677,33 @@ int KyraEngine_v1::o1_growBrandonUp(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_setBrandonScaleXAndY(ScriptState *script) {
+int KyraEngine_v1::o1_setBrandonScaleXAndY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonScaleXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_animator->_brandonScaleX = stackPos(0);
_animator->_brandonScaleY = stackPos(1);
return 0;
}
-int KyraEngine_v1::o1_resetScaleMode(ScriptState *script) {
+int KyraEngine_v1::o1_resetScaleMode(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScaleMode(%p) ()", (const void *)script);
_scaleMode = 0;
return 0;
}
-int KyraEngine_v1::o1_getScaleDepthTableValue(ScriptState *script) {
+int KyraEngine_v1::o1_getScaleDepthTableValue(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getScaleDepthTableValue(%p) (%d)", (const void *)script, stackPos(0));
assert(stackPos(0) < ARRAYSIZE(_scaleTable));
return _scaleTable[stackPos(0)];
}
-int KyraEngine_v1::o1_setScaleDepthTableValue(ScriptState *script) {
+int KyraEngine_v1::o1_setScaleDepthTableValue(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleDepthTableValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < ARRAYSIZE(_scaleTable));
_scaleTable[stackPos(0)] = stackPos(1);
return stackPos(1);
}
-int KyraEngine_v1::o1_message(ScriptState *script) {
+int KyraEngine_v1::o1_message(EMCState *script) {
if (_flags.isTalkie) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_message(%p) (%d, '%s', %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2));
drawSentenceCommand(stackPosString(1), stackPos(2));
@@ -1715,65 +1715,65 @@ int KyraEngine_v1::o1_message(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_checkClickOnNPC(ScriptState *script) {
+int KyraEngine_v1::o1_checkClickOnNPC(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_checkClickOnNPC(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
return checkForNPCScriptRun(stackPos(0), stackPos(1));
}
-int KyraEngine_v1::o1_getFoyerItem(ScriptState *script) {
+int KyraEngine_v1::o1_getFoyerItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getFoyerItem(%p) (%d)", (const void *)script, stackPos(0));
assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
return _foyerItemTable[stackPos(0)];
}
-int KyraEngine_v1::o1_setFoyerItem(ScriptState *script) {
+int KyraEngine_v1::o1_setFoyerItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFoyerItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
_foyerItemTable[stackPos(0)] = stackPos(1);
return stackPos(1);
}
-int KyraEngine_v1::o1_setNoItemDropRegion(ScriptState *script) {
+int KyraEngine_v1::o1_setNoItemDropRegion(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoItemDropRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
addToNoDropRects(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
return 0;
}
-int KyraEngine_v1::o1_walkMalcolmOn(ScriptState *script) {
+int KyraEngine_v1::o1_walkMalcolmOn(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkMalcolmOn(%p) ()", (const void *)script);
if (!_malcolmFlag)
_malcolmFlag = 1;
return 0;
}
-int KyraEngine_v1::o1_passiveProtection(ScriptState *script) {
+int KyraEngine_v1::o1_passiveProtection(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_passiveProtection(%p) ()", (const void *)script);
return 1;
}
-int KyraEngine_v1::o1_setPlayingLoop(ScriptState *script) {
+int KyraEngine_v1::o1_setPlayingLoop(EMCState *script) {
warning("STUB: o1_setPlayingLoop");
return 0;
}
-int KyraEngine_v1::o1_brandonToStoneSequence(ScriptState *script) {
+int KyraEngine_v1::o1_brandonToStoneSequence(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonToStoneSequence(%p) ()", (const void *)script);
seq_brandonToStone();
return 0;
}
-int KyraEngine_v1::o1_brandonHealingSequence(ScriptState *script) {
+int KyraEngine_v1::o1_brandonHealingSequence(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonHealingSequence(%p) ()", (const void *)script);
seq_brandonHealing();
return 0;
}
-int KyraEngine_v1::o1_protectCommandLine(ScriptState *script) {
+int KyraEngine_v1::o1_protectCommandLine(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_protectCommandLine(%p) (%d)", (const void *)script, stackPos(0));
return stackPos(0);
}
-int KyraEngine_v1::o1_pauseMusicSeconds(ScriptState *script) {
+int KyraEngine_v1::o1_pauseMusicSeconds(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseMusicSeconds(%p) ()", (const void *)script);
// if music disabled
// return
@@ -1781,18 +1781,18 @@ int KyraEngine_v1::o1_pauseMusicSeconds(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_resetMaskRegion(ScriptState *script) {
+int KyraEngine_v1::o1_resetMaskRegion(EMCState *script) {
warning("STUB: o1_resetMaskRegion");
return 0;
}
-int KyraEngine_v1::o1_setPaletteChangeFlag(ScriptState *script) {
+int KyraEngine_v1::o1_setPaletteChangeFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setPaletteChangeFlag(%p) (%d)", (const void *)script, stackPos(0));
_paletteChanged = stackPos(0);
return _paletteChanged;
}
-int KyraEngine_v1::o1_fillRect(ScriptState *script) {
+int KyraEngine_v1::o1_fillRect(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillRect(%p) (%d, %d, %d, %d, %d, 0x%X)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int videoPageBackup = _screen->_curPage;
_screen->_curPage = stackPos(0);
@@ -1801,26 +1801,26 @@ int KyraEngine_v1::o1_fillRect(ScriptState *script) {
return 0;
}
-int KyraEngine_v1::o1_vocUnload(ScriptState *script) {
+int KyraEngine_v1::o1_vocUnload(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocUnload(%p) ()", (const void *)script);
// this should unload all voc files (not needed)
return 0;
}
-int KyraEngine_v1::o1_vocLoad(ScriptState *script) {
+int KyraEngine_v1::o1_vocLoad(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocLoad(%p) (%d)", (const void *)script, stackPos(0));
// this should load the specified voc file (not needed)
return 0;
}
-int KyraEngine_v1::o1_dummy(ScriptState *script) {
+int KyraEngine_v1::o1_dummy(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dummy(%p) ()", (const void *)script);
return 0;
}
#pragma mark -
-typedef Common::Functor1Mem<ScriptState*, int, KyraEngine_v1> OpcodeV1;
+typedef Common::Functor1Mem<EMCState*, int, KyraEngine_v1> OpcodeV1;
#define SetOpcodeTable(x) table = &x;
#define Opcode(x) table->push_back(new OpcodeV1(this, &KyraEngine_v1::x))
void KyraEngine_v1::setupOpcodeTable() {
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index e0b863a60d..fcfb34561f 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -24,116 +24,41 @@
*/
#include "kyra/kyra_v2.h"
-#include "kyra/text_v2.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
+#include "kyra/screen_v2.h"
#include "kyra/timer.h"
-#include "kyra/script_tim.h"
#include "common/endian.h"
namespace Kyra {
-int KyraEngine_v2::o2_setCharacterFacingRefresh(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
- int animFrame = stackPos(2);
- if (animFrame >= 0)
- _mainCharacter.animFrame = animFrame;
- _mainCharacter.facing = stackPos(1);
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
- return 0;
-}
-
-int KyraEngine_v2::o2_setCharacterPos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
- int x = stackPos(1);
- int y = stackPos(2);
-
- if (x != -1 && y != -1) {
- x &= ~3;
- y &= ~1;
- }
-
- restorePage3();
- _mainCharacter.x2 = _mainCharacter.x1 = x;
- _mainCharacter.y2 = _mainCharacter.y1 = y;
- return 0;
-}
-
-int KyraEngine_v2::o2_defineObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineObject(%p) (%d, '%s', %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- TalkObject *object = &_talkObjectList[stackPos(0)];
- strcpy(object->filename, stackPosString(1));
- object->scriptId = stackPos(2);
- object->x = stackPos(3);
- object->y = stackPos(4);
- object->color = stackPos(5);
- return 0;
-}
-
-int KyraEngine_v2::o2_refreshCharacter(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_refreshCharacter(%p) (-, %d, %d, %d)", (const void *)script, stackPos(1), stackPos(2), stackPos(3));
- int unk = stackPos(1);
- int facing = stackPos(2);
- int refresh = stackPos(3);
- if (facing >= 0)
- _mainCharacter.facing = facing;
- if (unk >= 0 && unk != 32)
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- if (refresh)
- refreshAnimObjectsIfNeed();
- return 0;
-}
-
-int KyraEngine_v2::o2_getCharacterX(ScriptState *script) {
+int KyraEngine_v2::o2_getCharacterX(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterX(%p) ()", (const void *)script);
return _mainCharacter.x1;
}
-int KyraEngine_v2::o2_getCharacterY(ScriptState *script) {
+int KyraEngine_v2::o2_getCharacterY(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterY(%p) ()", (const void *)script);
return _mainCharacter.y1;
}
-int KyraEngine_v2::o2_getCharacterFacing(ScriptState *script) {
+int KyraEngine_v2::o2_getCharacterFacing(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterFacing(%p) ()", (const void *)script);
return _mainCharacter.facing;
}
-int KyraEngine_v2::o2_getCharacterScene(ScriptState *script) {
+int KyraEngine_v2::o2_getCharacterScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterScene(%p) ()", (const void *)script);
return _mainCharacter.sceneId;
}
-int KyraEngine_v2::o2_setSceneComment(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneComment(%p) ('%s')", (const void *)script, stackPosString(0));
- _sceneCommentString = stackPosString(0);
- return 0;
-}
-
-int KyraEngine_v2::o2_setCharacterAnimFrame(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterAnimFrame(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
- int animFrame = stackPos(1);
- int updateAnim = stackPos(2);
-
- _mainCharacter.animFrame = animFrame;
- if (updateAnim)
- updateCharacterAnim(0);
-
- return 0;
-}
-
-int KyraEngine_v2::o2_setCharacterFacing(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0));
+int KyraEngine_v2::o2_setCharacterFacingOverwrite(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacingOverwrite(%p) (%d)", (const void *)script, stackPos(0));
_mainCharacter.facing = stackPos(0);
- _overwriteSceneFacing = 1;
+ _overwriteSceneFacing = true;
return 0;
}
-int KyraEngine_v2::o2_trySceneChange(ScriptState *script) {
+int KyraEngine_v2::o2_trySceneChange(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script,
stackPos(0), stackPos(1), stackPos(2), stackPos(3));
@@ -142,7 +67,7 @@ int KyraEngine_v2::o2_trySceneChange(ScriptState *script) {
_unkHandleSceneChangeFlag = 0;
if (success) {
- _scriptInterpreter->initScript(script, script->dataPtr);
+ _emc->init(script, script->dataPtr);
_unk4 = 0;
_unk3 = -1;
_unk5 = 1;
@@ -152,325 +77,18 @@ int KyraEngine_v2::o2_trySceneChange(ScriptState *script) {
}
}
-int KyraEngine_v2::o2_moveCharacter(ScriptState *script) {
+int KyraEngine_v2::o2_moveCharacter(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
moveCharacter(stackPos(0), stackPos(1), stackPos(2));
return 0;
}
-int KyraEngine_v2::o2_customCharacterChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- playVoice(_vocHigh, stackPos(4));
- _text->printCustomCharacterText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), 0, 2);
- return 0;
-}
-
-int KyraEngine_v2::o2_soundFadeOut(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_soundFadeOut(%p) ()", (const void *)script);
- _sound->beginFadeOut();
- return 0;
-}
-
-int KyraEngine_v2::o2_showChapterMessage(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showChapterMessage(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- showChapterMessage(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_restoreTalkTextMessageBkgd(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreTalkTextMessageBkgd(%p) ()", (const void *)script);
- _text->restoreTalkTextMessageBkgd(2, 0);
- return 0;
-}
-
-int KyraEngine_v2::o2_wsaClose(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wsaClose(%p) (%d)", (const void *)script, stackPos(0));
- assert(stackPos(0) >= 0 && stackPos(0) < ARRAYSIZE(_wsaSlots));
- _wsaSlots[stackPos(0)]->close();
- return 0;
-}
-
-int KyraEngine_v2::o2_meanWhileScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_meanWhileScene(%p) (%d)", (const void *)script, stackPos(0));
- static const uint8 jpSubtitle[] = { 0x88, 0xEA, 0x95, 0xFB, 0x81, 0x45, 0x81, 0x45, 0x81, 0x45 };
- const char *cpsfile = stackPosString(0);
- const char *palfile = stackPosString(1);
-
- _screen->loadBitmap(cpsfile, 3, 3, 0);
- memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);
- _screen->loadPalette(palfile, _screen->getPalette(2));
- _screen->fillRect(0, 0, 319, 199, 207);
- _screen->setScreenPalette(_screen->getPalette(2));
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- if (!scumm_stricmp(cpsfile, "_MEANWIL.CPS") && _flags.lang == Common::JA_JPN) {
- Screen::FontId o = _screen->setFont(Screen::FID_6_FNT);
- _screen->printText((const char*)jpSubtitle, 140, 176, 255, 132);
- _screen->setFont(o);
- }
- _screen->updateScreen();
- return 0;
-}
-
-int KyraEngine_v2::o2_backUpScreen(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_backUpScreen(%p) (%d)", (const void *)script, stackPos(0));
- _screen->copyRegionToBuffer(stackPos(0), 0, 0, 320, 144, _screenBuffer);
- return 0;
-}
-
-int KyraEngine_v2::o2_restoreScreen(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreScreen(%p) (%d)", (const void *)script, stackPos(0));
- _screen->copyBlockToPage(stackPos(0), 0, 0, 320, 144, _screenBuffer);
- return 0;
-}
-
-int KyraEngine_v2::o2_displayWsaFrame(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaFrame(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8));
- int frame = stackPos(0);
- int x = stackPos(1);
- int y = stackPos(2);
- int waitTime = stackPos(3);
- int slot = stackPos(4);
- int copyParam = stackPos(5);
- int doUpdate = stackPos(6);
- int dstPage = stackPos(7);
- int backUp = stackPos(8);
-
- _screen->hideMouse();
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
- _wsaSlots[slot]->setX(x);
- _wsaSlots[slot]->setY(y);
- _wsaSlots[slot]->setDrawPage(dstPage);
- _wsaSlots[slot]->displayFrame(frame, copyParam | 0xC000, 0, 0);
- _screen->updateScreen();
-
- if (backUp)
- memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
-
- while (_system->getMillis() < endTime) {
- if (doUpdate)
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- }
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequentialFramesLooping(%p) (%d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
- int startFrame = stackPos(0);
- int endFrame = stackPos(1);
- int x = stackPos(2);
- int y = stackPos(3);
- int waitTime = stackPos(4);
- int slot = stackPos(5);
- int maxTimes = stackPos(6);
- int copyFlags = stackPos(7);
-
- if (maxTimes > 1)
- maxTimes = 1;
-
- _wsaSlots[slot]->setX(x);
- _wsaSlots[slot]->setY(y);
- _wsaSlots[slot]->setDrawPage(0);
-
- _screen->hideMouse();
- int curTime = 0;
- while (curTime < maxTimes) {
- if (startFrame < endFrame) {
- for (int i = startFrame; i <= endFrame; ++i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
- _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
-
- if (!skipFlag()) {
- _screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- } while (_system->getMillis() < endTime);
- }
- }
- } else {
- for (int i = startFrame; i >= endFrame; --i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
- _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
-
- if (!skipFlag()) {
- _screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10 && !skipFlag())
- delay(10);
- } while (_system->getMillis() < endTime && !skipFlag());
- }
- }
- }
-
- ++curTime;
- }
- resetSkipFlag();
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v2::o2_wsaOpen(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wsaOpen(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- assert(stackPos(1) >= 0 && stackPos(1) < ARRAYSIZE(_wsaSlots));
- _wsaSlots[stackPos(1)]->open(stackPosString(0), 1, 0);
- return 0;
-}
-
-int KyraEngine_v2::o2_displayWsaSequentialFrames(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
-
- uint16 frameDelay = stackPos(2) * _tickLength;
- uint16 currentFrame = stackPos(3);
- uint16 lastFrame = stackPos(4);
- uint16 index = stackPos(5);
- uint16 copyParam = stackPos(6) | 0xc000;
-
- _wsaSlots[index]->setX(stackPos(0));
- _wsaSlots[index]->setY(stackPos(1));
- _wsaSlots[index]->setDrawPage(0);
-
- _screen->hideMouse();
-
- while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
- _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
- if (!skipFlag()) {
- _screen->updateScreen();
- delayUntil(endTime);
- }
- }
-
- resetSkipFlag();
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v2::o2_displayWsaSequence(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequence(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
-
- const int frameDelay = stackPos(2) * _tickLength;
- const int index = stackPos(3);
- const bool doUpdate = (stackPos(4) != 0);
- const uint16 copyParam = stackPos(5) | 0xc000;
-
- _wsaSlots[index]->setX(stackPos(0));
- _wsaSlots[index]->setY(stackPos(1));
- _wsaSlots[index]->setDrawPage(0);
-
- _screen->hideMouse();
-
- int currentFrame = 0;
- const int lastFrame = _wsaSlots[index]->frames();
-
- while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
- _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
- if (!skipFlag()) {
- if (doUpdate)
- update();
- _screen->updateScreen();
- delayUntil(endTime);
- }
- }
-
- resetSkipFlag();
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v2::o2_addItemToInventory(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addItemToInventory(%p) (%d, -, %d)", (const void *)script, stackPos(0), stackPos(2));
- int slot = findFreeVisibleInventorySlot();
- if (slot != -1) {
- _mainCharacter.inventory[slot] = stackPos(0);
- if (stackPos(2))
- redrawInventory(0);
- }
- return slot;
-}
-
-int KyraEngine_v2::o2_drawShape(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
-
- uint8 *shp = getShapePtr(stackPos(0) + 64);
- int x = stackPos(1);
- int y = stackPos(2);
- uint8 dsFlag = stackPos(3) & 0xff;
- uint8 modeFlag = stackPos(4) & 0xff;
-
- if (modeFlag) {
- _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0);
- } else {
- _screen->hideMouse();
- restorePage3();
- _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0);
- memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
- _screen->drawShape(0, shp, x, y, 2, dsFlag ? 1 : 0);
-
- flagAnimObjsForRefresh();
- flagAnimObjsUnk8();
- refreshAnimObjectsIfNeed();
- _screen->showMouse();
- }
-
- return 0;
-}
-
-int KyraEngine_v2::o2_addItemToCurScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- const int16 id = stackPos(0);
- int x = stackPos(1);
- int y = stackPos(2);
-
- int freeItem = findFreeItem();
- x = MAX(14, x);
- x = MIN(304, x);
- y = MAX(14, y);
- y = MIN(136, y);
- if (freeItem >= 0) {
- _itemList[freeItem].id = id;
- _itemList[freeItem].x = x;
- _itemList[freeItem].y = y;
- _itemList[freeItem].sceneId = _mainCharacter.sceneId;
- addItemToAnimList(freeItem);
- refreshAnimObjectsIfNeed();
- }
- return 0;
-}
-
-int KyraEngine_v2::o2_checkForItem(ScriptState *script) {
+int KyraEngine_v2::o2_checkForItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
return findItem(stackPos(0), stackPos(1)) == -1 ? 0 : 1;
}
-int KyraEngine_v2::o2_loadSoundFile(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadSoundFile(%p) (%d)", (const void *)script, stackPos(0));
- if (_sound->hasSoundFile(stackPos(0)))
- snd_playTheme(stackPos(0), -1);
- return 0;
-}
-
-int KyraEngine_v2::o2_removeItemSlotFromInventory(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemSlotFromInventory(%p) (%d)", (const void *)script, stackPos(0));
- removeItemFromInventory(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_defineItem(ScriptState *script) {
+int KyraEngine_v2::o2_defineItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineItem(%p) (%d, %d, %d, %d)", (const void *)script,
stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int freeItem = findFreeItem();
@@ -485,80 +103,45 @@ int KyraEngine_v2::o2_defineItem(ScriptState *script) {
return freeItem;
}
-int KyraEngine_v2::o2_removeItemFromInventory(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemFromInventory(%p) (%d)", (const void *)script, stackPos(0));
- uint16 item = stackPos(0);
- int slot = -1;
- while ((slot = getInventoryItemSlot(item)) != -1)
- removeItemFromInventory(slot);
- return 0;
-}
-
-int KyraEngine_v2::o2_countItemInInventory(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemInInventory(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- uint16 item = stackPos(1);
- int count = 0;
-
- for (int i = 0; i < 20; ++i) {
- if (_mainCharacter.inventory[i] == item)
- ++count;
- }
-
- if ((stackPos(0) == 0) && _itemInHand == int16(item))
- ++count;
-
- return count;
-}
-
-int KyraEngine_v2::o2_countItemsInScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemsInScene(%p) (%d)", (const void *)script, stackPos(0));
- int count = 0;
- for (int i = 0; i < 30; ++i) {
- if (_itemList[i].sceneId == stackPos(0) && _itemList[i].id != 0xFFFF)
- ++count;
- }
- return count;
-}
-
-int KyraEngine_v2::o2_queryGameFlag(ScriptState *script) {
+int KyraEngine_v2::o2_queryGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
return queryGameFlag(stackPos(0));
}
-int KyraEngine_v2::o2_resetGameFlag(ScriptState *script) {
+int KyraEngine_v2::o2_resetGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
return resetGameFlag(stackPos(0));
}
-int KyraEngine_v2::o2_setGameFlag(ScriptState *script) {
+int KyraEngine_v2::o2_setGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
return setGameFlag(stackPos(0));
}
-int KyraEngine_v2::o2_setHandItem(ScriptState *script) {
+int KyraEngine_v2::o2_setHandItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
setHandItem(stackPos(0));
return 0;
}
-int KyraEngine_v2::o2_removeHandItem(ScriptState *script) {
+int KyraEngine_v2::o2_removeHandItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeHandItem(%p) ()", (const void *)script);
removeHandItem();
return 0;
}
-int KyraEngine_v2::o2_handItemSet(ScriptState *script) {
+int KyraEngine_v2::o2_handItemSet(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_handItemSet(%p) ()", (const void *)script);
return _handItemSet;
}
-int KyraEngine_v2::o2_hideMouse(ScriptState *script) {
+int KyraEngine_v2::o2_hideMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_hideMouse(%p) ()", (const void *)script);
- _screen->hideMouse();
+ screen()->hideMouse();
return 0;
}
-int KyraEngine_v2::o2_addSpecialExit(ScriptState *script) {
+int KyraEngine_v2::o2_addSpecialExit(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
if (_specialExitCount < 5) {
@@ -572,62 +155,19 @@ int KyraEngine_v2::o2_addSpecialExit(ScriptState *script) {
return 0;
}
-int KyraEngine_v2::o2_setMousePos(ScriptState *script) {
+int KyraEngine_v2::o2_setMousePos(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
setMousePos(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v2::o2_showMouse(ScriptState *script) {
+int KyraEngine_v2::o2_showMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showMouse(%p) ()", (const void *)script);
- _screen->showMouse();
+ screen()->showMouse();
return 0;
}
-int KyraEngine_v2::o2_wipeDownMouseItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
- _screen->hideMouse();
- const int x = stackPos(1) - 8;
- const int y = stackPos(2) - 15;
-
- if (_itemInHand >= 0) {
- backUpGfxRect32x32(x, y);
- uint8 *shape = getShapePtr(_itemInHand+64);
- for (int curY = y, height = 16; height > 0; height -= 2, curY += 2) {
- restoreGfxRect32x32(x, y);
- _screen->setNewShapeHeight(shape, height);
- uint32 waitTime = _system->getMillis() + _tickLength;
- _screen->drawShape(0, shape, x, curY, 0, 0);
- _screen->updateScreen();
- delayUntil(waitTime);
- }
- restoreGfxRect32x32(x, y);
- _screen->resetShapeHeight(shape);
- }
-
- _screen->showMouse();
- removeHandItem();
-
- return 0;
-}
-
-int KyraEngine_v2::o2_getElapsedSecs(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getElapsedSecs(%p) ()", (const void *)script);
- return _system->getMillis() / 1000;
-}
-
-int KyraEngine_v2::o2_getTimerDelay(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getTimerDelay(%p) (%d)", (const void *)script, stackPos(0));
- return _timer->getDelay(stackPos(0));
-}
-
-int KyraEngine_v2::o2_delaySecs(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delaySecs(%p) (%d)", (const void *)script, stackPos(0));
- delay(stackPos(0) * 1000, true);
- return 0;
-}
-
-int KyraEngine_v2::o2_delay(ScriptState *script) {
+int KyraEngine_v2::o2_delay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
if (stackPos(1)) {
uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
@@ -650,414 +190,41 @@ int KyraEngine_v2::o2_delay(ScriptState *script) {
return 0;
}
-int KyraEngine_v2::o2_setTimerDelay(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setTimerDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _timer->setDelay(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_setScaleTableItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setScaleTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setScaleTableItem(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_setDrawLayerTableItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDrawLayerTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setDrawLayerTableEntry(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_setCharPalEntry(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharPalEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setCharPalEntry(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_loadZShapes(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0));
- loadZShapes(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_drawSceneShape(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
- stackPos(2), stackPos(3));
-
- int shape = stackPos(0);
- int x = stackPos(1);
- int y = stackPos(2);
- int flag = (stackPos(3) != 0) ? 1 : 0;
-
- _screen->hideMouse();
- restorePage3();
-
- _screen->drawShape(2, _sceneShapeTable[shape], x, y, 2, flag);
-
- memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
-
- _screen->drawShape(0, _sceneShapeTable[shape], x, y, 2, flag);
-
- flagAnimObjsUnk8();
- flagAnimObjsForRefresh();
- refreshAnimObjectsIfNeed();
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v2::o2_drawSceneShapeOnPage(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShapeOnPage(%p) (%d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- int shape = stackPos(0);
- int x = stackPos(1);
- int y = stackPos(2);
- int flag = stackPos(3);
- int drawPage = stackPos(4);
-
- _screen->drawShape(drawPage, _sceneShapeTable[shape], x, y, 2, flag ? 1 : 0);
- return 0;
-}
-
-int KyraEngine_v2::o2_disableAnimObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableAnimObject(%p) (%d)", (const void *)script, stackPos(0));
- _animObjects[stackPos(0)+1].enabled = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_enableAnimObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableAnimObject(%p) (%d)", (const void *)script, stackPos(0));
- _animObjects[stackPos(0)+1].enabled = true;
- return 0;
-}
-
-int KyraEngine_v2::o2_loadPalette384(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadPalette384(%p) ('%s')", (const void *)script, stackPosString(0));
- memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
- _res->loadFileToBuf(stackPosString(0), _screen->getPalette(1), 384);
- return 0;
-}
-
-int KyraEngine_v2::o2_setPalette384(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPalette384(%p) ()", (const void *)script);
- memcpy(_screen->getPalette(0), _screen->getPalette(1), 384);
- _screen->setScreenPalette(_screen->getPalette(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_restoreBackBuffer(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreBackBuffer(%p) (%d)", (const void *)script, stackPos(0));
- int disable = stackPos(0);
- int oldState = 0;
-
- if (disable) {
- oldState = _animObjects[0].enabled;
- _animObjects[0].enabled = 0;
- }
-
- restorePage3();
-
- if (disable)
- _animObjects[0].enabled = oldState;
-
- return 0;
-}
-
-int KyraEngine_v2::o2_backUpInventoryGfx(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_backUpInventoryGfx(%p) ()", (const void *)script);
- _screen->copyRegionToBuffer(1, 0, 144, 320, 56, _screenBuffer);
- _inventorySaved = true;
- return 0;
-}
-
-int KyraEngine_v2::o2_disableSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableSceneAnim(%p) (%d)", (const void *)script, stackPos(0));
- _sceneAnims[stackPos(0)].flags &= ~1;
- return 0;
-}
-
-int KyraEngine_v2::o2_enableSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableSceneAnim(%p) (%d)", (const void *)script, stackPos(0));
- _sceneAnims[stackPos(0)].flags |= 1;
- return 0;
-}
-
-int KyraEngine_v2::o2_restoreInventoryGfx(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreInventoryGfx(%p) ()", (const void *)script);
- _screen->copyBlockToPage(1, 0, 144, 320, 56, _screenBuffer);
- _inventorySaved = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_setSceneAnimPos2(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos2(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- _sceneAnims[stackPos(0)].x2 = stackPos(1);
- _sceneAnims[stackPos(0)].y2 = stackPos(2);
- return 0;
-}
-
-int KyraEngine_v2::o2_update(ScriptState *script) {
+int KyraEngine_v2::o2_update(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_update(%p) (%d)", (const void *)script, stackPos(0));
-
- int times = stackPos(0);
- while (times--) {
+ for (int times = stackPos(0); times != 0; --times) {
if (_chatText)
updateWithText();
else
update();
}
-
- return 0;
-}
-
-int KyraEngine_v2::o2_fadeScenePal(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- fadeScenePal(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_enterNewSceneEx(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enterNewSceneEx(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0),
- stackPos(1), stackPos(2), stackPos(3), stackPos(4));
-
- int skipNpcScript = stackPos(3);
- enterNewScene(stackPos(0), stackPos(1), stackPos(2), skipNpcScript, stackPos(4));
-
- if (!skipNpcScript)
- runSceneScript4(0);
-
- _unk5 = 1;
-
- if (_mainCharX == -1 || _mainCharY == -1) {
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- }
-
return 0;
}
-int KyraEngine_v2::o2_switchScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_switchScene(%p) (%d)", (const void *)script, stackPos(0));
- setGameFlag(0x1EF);
- _mainCharX = _mainCharacter.x1;
- _mainCharY = _mainCharacter.y1;
- _noScriptEnter = 0;
- enterNewScene(stackPos(0), _mainCharacter.facing, 0, 0, 0);
- _noScriptEnter = 1;
- return 0;
-}
-
-int KyraEngine_v2::o2_getShapeFlag1(ScriptState *script) {
+int KyraEngine_v2::o2_getShapeFlag1(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getShapeFlag1(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- return _screen->getShapeFlag1(stackPos(0), stackPos(1));
-}
-
-int KyraEngine_v2::o2_setPathfinderFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0));
- _pathfinderFlag = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v2::o2_getSceneExitToFacing(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getSceneExitToFacing(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const int scene = stackPos(0);
- const int facing = stackPos(1);
-
- if (facing == 0)
- return (int16)_sceneList[scene].exit1;
- else if (facing == 2)
- return (int16)_sceneList[scene].exit2;
- else if (facing == 4)
- return (int16)_sceneList[scene].exit3;
- else if (facing == 6)
- return (int16)_sceneList[scene].exit4;
- return -1;
-}
-
-int KyraEngine_v2::o2_setLayerFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0));
- int layer = stackPos(0);
- if (layer >= 1 && layer <= 16)
- _layerFlagTable[layer] = 1;
- return 0;
+ return screen()->getShapeFlag1(stackPos(0), stackPos(1));
}
-int KyraEngine_v2::o2_setZanthiaPos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setZanthiaPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _mainCharX = stackPos(0);
- _mainCharY = stackPos(1);
-
- if (_mainCharX == -1 && _mainCharY == -1)
- _mainCharacter.animFrame = 32;
- else
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
-
- return 0;
-}
-
-int KyraEngine_v2::o2_loadMusicTrack(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadMusicTrack(%p) (%d)", (const void *)script, stackPos(0));
- snd_loadSoundFile(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_playWanderScoreViaMap(ScriptState *script) {
+int KyraEngine_v2::o2_playWanderScoreViaMap(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v2::o2_playSoundEffect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
- snd_playSoundEffect(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_setSceneAnimPos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- _sceneAnims[stackPos(0)].x = stackPos(1);
- _sceneAnims[stackPos(0)].y = stackPos(2);
- return 0;
-}
-
-int KyraEngine_v2::o2_blockInRegion(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
-int KyraEngine_v2::o2_blockOutRegion(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
-int KyraEngine_v2::o2_setCauldronState(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCauldronState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setCauldronState(stackPos(0), stackPos(1) != 0);
- clearCauldronTable();
- return 0;
-}
-
-int KyraEngine_v2::o2_showItemString(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showItemString(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const int item = stackPos(0);
-
- int string = 0;
- if (stackPos(1) == 1) {
- if (_lang == 1)
- string = getItemCommandStringPickUp(item);
- else
- string = 7;
- } else {
- if (_lang == 1)
- string = getItemCommandStringInv(item);
- else
- string = 8;
- }
-
- updateCommandLineEx(item+54, string, 0xD6);
- return 0;
-}
-
-int KyraEngine_v2::o2_getRand(ScriptState *script) {
+int KyraEngine_v2::o2_getRand(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < stackPos(1));
return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
}
-int KyraEngine_v2::o2_isAnySoundPlaying(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isAnySoundPlaying(%p) ()", (const void *)script);
- return _sound->voiceIsPlaying();
-}
-
-int KyraEngine_v2::o2_setDeathHandlerFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0));
+int KyraEngine_v2::o2_setDeathHandler(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
_deathHandler = stackPos(0);
return 0;
}
-int KyraEngine_v2::o2_setDrawNoShapeFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDrawNoShapeFlag(%p) (%d)", (const void *)script, stackPos(0));
- _drawNoShapeFlag = (stackPos(0) != 0);
- return 0;
-}
-
-int KyraEngine_v2::o2_setRunFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setRunFlag(%p) (%d)", (const void *)script, stackPos(0));
- // this is usually just _runFlag, but since this is just used when the game should play the credits
- // we handle it a bit different :-)
- _showCredits = true;
- _runFlag = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_showLetter(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showLetter(%p) (%d)", (const void *)script, stackPos(0));
- const int letter = stackPos(0);
- char filename[16];
-
- _screen->hideMouse();
-
- showMessage(0, 0xCF);
- displayInvWsaLastFrame();
- backUpPage0();
-
- memcpy(_screen->getPalette(2), _screen->getPalette(0), 768);
-
- _screen->clearPage(3);
- _screen->loadBitmap("_NOTE.CPS", 3, 3, 0);
-
- sprintf(filename, "_NTEPAL%.1d.COL", letter+1);
- _res->loadFileToBuf(filename, _screen->getPalette(0), 768);
-
- _screen->fadeToBlack(0x14);
-
- sprintf(filename, "LETTER%.1d.", letter);
- strcat(filename, _languageExtension[_lang]);
-
- uint8 *letterBuffer = _res->fileData(filename, 0);
- if (letterBuffer) {
- bookDecodeText(letterBuffer);
- bookPrintText(2, letterBuffer, 0xC, 0xA, 0x20);
- }
-
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->fadePalette(_screen->getPalette(0), 0x14);
- _screen->setMouseCursor(0, 0, getShapePtr(0));
- setMousePos(280, 160);
-
- _screen->showMouse();
-
- bool running = true;
- while (running) {
- int inputFlag = checkInput(0);
- removeInputTop();
-
- if (inputFlag == 198 || inputFlag == 199)
- running = false;
-
- _screen->updateScreen();
- _system->delayMillis(10);
- }
-
- _screen->hideMouse();
- _screen->fadeToBlack(0x14);
- restorePage0();
- memcpy(_screen->getPalette(0), _screen->getPalette(2), 768);
- _screen->fadePalette(_screen->getPalette(0), 0x14);
- setHandItem(_itemInHand);
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v2::o2_fillRect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- _screen->fillRect(stackPos(1), stackPos(2), stackPos(1)+stackPos(3), stackPos(2)+stackPos(4), stackPos(5), stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_waitForConfirmationClick(ScriptState *script) {
+int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
resetSkipFlag();
uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
@@ -1081,14 +248,25 @@ int KyraEngine_v2::o2_waitForConfirmationClick(ScriptState *script) {
return 1;
}
-int KyraEngine_v2::o2_encodeShape(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_encodeShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
- stackPos(2), stackPos(3), stackPos(4));
- _sceneShapeTable[stackPos(0)] = _screen->encodeShape(stackPos(1), stackPos(2), stackPos(3), stackPos(4), 2);
+int KyraEngine_v2::o2_randomSceneChat(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_randomSceneChat(%p)", (const void *)script);
+ randomSceneChat();
+ return 0;
+}
+
+int KyraEngine_v2::o2_setDlgIndex(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDlgIndex(%p) (%d)", (const void *)script, stackPos(0));
+ setDlgIndex(stackPos(0));
return 0;
}
-int KyraEngine_v2::o2_defineRoomEntrance(ScriptState *script) {
+int KyraEngine_v2::o2_getDlgIndex(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getDlgIndex(%p) ()", (const void *)script);
+ return _mainCharacter.dlgIndex;
+}
+
+
+int KyraEngine_v2::o2_defineRoomEntrance(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
switch (stackPos(0)) {
case 0:
@@ -1117,1018 +295,120 @@ int KyraEngine_v2::o2_defineRoomEntrance(ScriptState *script) {
return 0;
}
-int KyraEngine_v2::o2_runTemporaryScript(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1),
+int KyraEngine_v2::o2_runAnimationScript(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_runAnimationScript(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1),
stackPos(2), stackPos(3));
- runTemporaryScript(stackPosString(0), stackPos(3), stackPos(2) ? 1 : 0, stackPos(1), stackPos(2));
+ runAnimationScript(stackPosString(0), stackPos(3), stackPos(2) ? 1 : 0, stackPos(1), stackPos(2));
return 0;
}
-int KyraEngine_v2::o2_setSpecialSceneScriptRunTime(ScriptState *script) {
+int KyraEngine_v2::o2_setSpecialSceneScriptRunTime(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) >= 0 && stackPos(0) < 10);
_sceneSpecialScriptsTimer[stackPos(0)] = _system->getMillis() + stackPos(1) * _tickLength;
return 0;
}
-int KyraEngine_v2::o2_defineSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8),
- stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
- int animId = stackPos(0);
- SceneAnim &anim = _sceneAnims[animId];
- anim.flags = stackPos(1);
- anim.x = stackPos(2);
- anim.y = stackPos(3);
- anim.x2 = stackPos(4);
- anim.y2 = stackPos(5);
- anim.width = stackPos(6);
- anim.height = stackPos(7);
- anim.unkE = stackPos(8);
- anim.specialSize = stackPos(9);
- anim.unk12 = stackPos(10);
- anim.shapeIndex = stackPos(11);
- if (stackPosString(12) != 0)
- strcpy(anim.filename, stackPosString(12));
-
- if (anim.flags & 0x40) {
- if (!_sceneAnimMovie[animId]->open(anim.filename, 1, 0))
- error("couldn't load '%s'", anim.filename);
-
- if (_sceneAnimMovie[animId]->xAdd() || _sceneAnimMovie[animId]->yAdd())
- anim.wsaFlag = 1;
- else
- anim.wsaFlag = 0;
- }
-
- return 0;
-}
-
-int KyraEngine_v2::o2_updateSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- updateSceneAnim(stackPos(0), stackPos(1));
-
- // HACK: Some animations are really too fast because of missing delay times.
- // Notice that the delay time is purely subjective set here, it could look
- // slower or maybe faster in the original, but at least this looks OK for
- // Raziel^.
- //
- // We know currently of some different animations where this happens.
- // - Where Marco is dangling from the flesh-eating plant (see bug #1923638 "HoF: Marco missing animation frames").
- // - After giving the ticket to the captain. He would move very fast (barely noticeable) onto the ship
- // without this delay.
- // - The scene after giving the sandwitch to the guards in the city. (see bug #1926838 "HoF: Animation plays too fast")
- // This scene script calls o2_delay though, but since this updates the scene animation scripts again there is no delay
- // for the animation.
- if ((stackPos(0) == 2 && _mainCharacter.sceneId == 3) || (stackPos(0) == 3 && _mainCharacter.sceneId == 33) ||
- ((stackPos(0) == 1 || stackPos(0) == 2) && _mainCharacter.sceneId == 19))
- _sceneSpecialScriptsTimer[_lastProcessedSceneScript] = _system->getMillis() + _tickLength * 6;
-
- _specialSceneScriptRunFlag = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_addToSceneAnimPosAndUpdate(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addToSceneAnimPosAndUpdate(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- const int anim = stackPos(0);
- _sceneAnims[anim].x2 += stackPos(1);
- _sceneAnims[anim].y2 += stackPos(2);
- if (_sceneAnims[anim].flags & 2) {
- _sceneAnims[anim].x += stackPos(1);
- _sceneAnims[anim].y += stackPos(2);
- }
- updateSceneAnim(anim, stackPos(3));
- _specialSceneScriptRunFlag = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_useItemOnMainChar(ScriptState *script) {
- ScriptState tmpScript;
- _scriptInterpreter->initScript(&tmpScript, &_npcScriptData);
- _scriptInterpreter->startScript(&tmpScript, 0);
- tmpScript.regs[4] = _itemInHand;
- tmpScript.regs[0] = _mainCharacter.sceneId;
-
- int oldVocH = _vocHigh;
- _vocHigh = 0x5a;
-
- while(_scriptInterpreter->validScript(&tmpScript))
- _scriptInterpreter->runScript(&tmpScript);
-
- _vocHigh = oldVocH;
-
- return 0;
-}
-
-int KyraEngine_v2::o2_startDialogue(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_startDialogue(%p) (%d)", (const void *)script, stackPos(0));
- startDialogue(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_zanthRandomChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_zanthRandomChat(%p)", (const void *)script);
- zanthRandomIdleChat();
- return 0;
-}
-
-int KyraEngine_v2::o2_setupDialogue(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setupDialogue(%p) (%d)", (const void *)script, stackPos(0));
- setNewDlgIndex(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_getDlgIndex(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setNewDlgIndex(%p) (%d)", (const void *)script, stackPos(0));
- return _mainCharacter.dlgIndex;
-}
-
-int KyraEngine_v2::o2_defineRoom(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineRoom(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
- SceneDesc *scene = &_sceneList[stackPos(0)];
- strcpy(scene->filename, stackPosString(1));
- scene->exit1 = stackPos(2);
- scene->exit2 = stackPos(3);
- scene->exit3 = stackPos(4);
- scene->exit4 = stackPos(5);
- scene->flags = stackPos(6);
- scene->sound = stackPos(7);
-
- if (_mainCharacter.sceneId == stackPos(0)) {
- _sceneExit1 = scene->exit1;
- _sceneExit2 = scene->exit2;
- _sceneExit3 = scene->exit3;
- _sceneExit4 = scene->exit4;
- }
-
- return 0;
-}
-
-int KyraEngine_v2::o2_addCauldronStateTableEntry(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addCauldronStateTableEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- return addToCauldronStateTable(stackPos(0), stackPos(1)) ? 1 : 0;
-}
-
-int KyraEngine_v2::o2_setCountDown(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCountDown(%p) (%d)", (const void *)script, stackPos(0));
- _scriptCountDown = _system->getMillis() + stackPos(0) * _tickLength;
- return 0;
-}
-
-int KyraEngine_v2::o2_getCountDown(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCountDown(%p)", (const void *)script);
- uint32 time = _system->getMillis();
- return (time > _scriptCountDown) ? 0 : (_scriptCountDown - time) / _tickLength;
-}
-
-int KyraEngine_v2::o2_pressColorKey(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0));
- for (int i = 6; i; i--)
- _inputColorCode[i] = _inputColorCode[i - 1];
- _inputColorCode[0] = stackPos(0) & 0xff;
- for (int i = 0; i < 7; i++) {
- if (_presetColorCode[i] != _inputColorCode[6 - i])
- return _dbgPass;
- }
- return 1;
-}
-
-int KyraEngine_v2::o2_objectChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- if (_flags.isTalkie)
- warning("Unexpected call: o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- else
- objectChat(stackPosString(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_chapterChange(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_chapterChange(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const int chapter = stackPos(0);
- const int scene = stackPos(1);
-
- resetItemList();
-
- _newChapterFile = chapter;
- runStartScript(chapter, 0);
-
- _mainCharacter.dlgIndex = 0;
- memset(_newSceneDlgState, 0, 32);
-
- static const int zShapeList[] = { 1, 2, 2, 2, 4 };
- assert(chapter > 1 && chapter <= ARRAYSIZE(zShapeList));
- loadZShapes(zShapeList[chapter-1]);
-
- enterNewScene(scene, (chapter == 2) ? 2 : 0, 0, 0, 0);
-
- return 0;
-}
-
-int KyraEngine_v2::o2_getColorCodeFlag1(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag1(%p) ()", (const void *)script);
- return _colorCodeFlag1;
-}
-
-int KyraEngine_v2::o2_setColorCodeFlag1(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag1(%p) (%d)", (const void *)script, stackPos(0));
- _colorCodeFlag1 = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v2::o2_getColorCodeFlag2(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag2(%p) ()", (const void *)script);
- return _colorCodeFlag2;
-}
-
-int KyraEngine_v2::o2_setColorCodeFlag2(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag2(%p) (%d)", (const void *)script, stackPos(0));
- _colorCodeFlag2 = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v2::o2_getColorCodeValue(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeValue(%p) (%d)", (const void *)script, stackPos(0));
- return _presetColorCode[stackPos(0)];
-}
-
-int KyraEngine_v2::o2_setColorCodeValue(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _presetColorCode[stackPos(0)] = stackPos(1) & 0xff;
- return stackPos(1) & 0xff;
-}
-
-int KyraEngine_v2::o2_countItemInstances(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemInstances(%p) (%d)", (const void *)script, stackPos(0));
- uint16 item = stackPos(0);
-
- int count = 0;
- for (int i = 0; i < 20; ++i) {
- if (_mainCharacter.inventory[i] == item)
- ++count;
- }
-
- if (_itemInHand == int16(item))
- ++count;
-
- for (int i = 0; i < 30; ++i) {
- if (_itemList[i].id == item)
- ++count;
- }
-
- if (_hiddenItems[0] == item && _newChapterFile == 1)
- ++count;
- if (_hiddenItems[1] == item && _newChapterFile == 1)
- ++count;
- if (_hiddenItems[2] == item && _newChapterFile == 2)
- ++count;
- if (_hiddenItems[3] == item && _newChapterFile == 2)
- ++count;
- if (_hiddenItems[4] == item && _newChapterFile == 1)
- ++count;
-
- return count;
-}
-
-int KyraEngine_v2::o2_removeItemFromScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemFromScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+int KyraEngine_v2::o2_defineScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineScene(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)",
+ (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
const int scene = stackPos(0);
- const uint16 item = stackPos(1);
- for (int i = 0; i < 30; ++i) {
- if (_itemList[i].sceneId == scene && _itemList[i].id == item)
- _itemList[i].id = 0xFFFF;
- }
- return 0;
-}
+ strcpy(_sceneList[scene].filename1, stackPosString(1));
+ strcpy(_sceneList[scene].filename2, stackPosString(1));
-int KyraEngine_v2::o2_initObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_initObject(%p) (%d)", (const void *)script, stackPos(0));
- initTalkObject(stackPos(0));
- return 0;
-}
+ _sceneList[scene].exit1 = stackPos(2);
+ _sceneList[scene].exit2 = stackPos(3);
+ _sceneList[scene].exit3 = stackPos(4);
+ _sceneList[scene].exit4 = stackPos(5);
+ _sceneList[scene].flags = stackPos(6);
+ _sceneList[scene].sound = stackPos(7);
-int KyraEngine_v2::o2_npcChat(ScriptState *script) {
- if (_flags.isTalkie) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_npcChat(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), _vocHigh, stackPos(2));
- npcChatSequence(stackPosString(0), stackPos(1), _vocHigh, stackPos(2));
- } else {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_npcChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- npcChatSequence(stackPosString(0), stackPos(1));
+ if (_mainCharacter.sceneId == scene) {
+ _sceneExit1 = _sceneList[scene].exit1;
+ _sceneExit2 = _sceneList[scene].exit2;
+ _sceneExit3 = _sceneList[scene].exit3;
+ _sceneExit4 = _sceneList[scene].exit4;
}
- return 0;
-}
-
-int KyraEngine_v2::o2_deinitObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_deinitObject(%p) (%d)", (const void *)script, stackPos(0));
- deinitTalkObject(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_playTimSequence(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playTimSequence(%p) ('%s')", (const void *)script, stackPosString(0));
- playTim(stackPosString(0));
- return 0;
-}
-int KyraEngine_v2::o2_makeBookOrCauldronAppear(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_makeBookOrCauldronAppear(%p) (%d)", (const void *)script, stackPos(0));
- seq_makeBookOrCauldronAppear(stackPos(0));
return 0;
}
-int KyraEngine_v2::o2_setSpecialSceneScriptState(ScriptState *script) {
+int KyraEngine_v2::o2_setSpecialSceneScriptState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
_specialSceneScriptState[stackPos(0)] = 1;
return 1;
}
-int KyraEngine_v2::o2_clearSpecialSceneScriptState(ScriptState *script) {
+int KyraEngine_v2::o2_clearSpecialSceneScriptState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
_specialSceneScriptState[stackPos(0)] = 0;
return 0;
}
-int KyraEngine_v2::o2_querySpecialSceneScriptState(ScriptState *script) {
+int KyraEngine_v2::o2_querySpecialSceneScriptState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
return _specialSceneScriptState[stackPos(0)];
}
-int KyraEngine_v2::o2_resetInputColorCode(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetInputColorCode(%p)", (const void *)script);
- memset(_inputColorCode, 255, 7);
- return 0;
-}
-
-int KyraEngine_v2::o2_setHiddenItemsEntry(ScriptState *script) {
+int KyraEngine_v2::o2_setHiddenItemsEntry(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
return (_hiddenItems[stackPos(0)] = stackPos(1));
}
-int KyraEngine_v2::o2_getHiddenItemsEntry(ScriptState *script) {
+int KyraEngine_v2::o2_getHiddenItemsEntry(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0));
- return _hiddenItems[stackPos(0)];
-}
-
-int KyraEngine_v2::o2_mushroomEffect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_mushroomEffect(%p)", (const void *)script);
- memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);
-
- for (int i = 1; i < 768; i += 3)
- _screen->_currentPalette[i] = 0;
- snd_playSoundEffect(106);
- _screen->fadePalette(_screen->_currentPalette, 90, &_updateFunctor);
- memcpy(_screen->_currentPalette, _screen->getPalette(2), 768);
-
- for (int i = 0; i < 768; i += 3) {
- _screen->_currentPalette[i] = _screen->_currentPalette[i + 1] = 0;
- _screen->_currentPalette[i + 2] += (((int8)_screen->_currentPalette[i + 2]) >> 1);
- if (_screen->_currentPalette[i + 2] > 63)
- _screen->_currentPalette[i + 2] = 63;
- }
- snd_playSoundEffect(106);
- _screen->fadePalette(_screen->_currentPalette, 90, &_updateFunctor);
-
- memcpy(_screen->_currentPalette, _screen->getPalette(2), 768);
- _screen->fadePalette(_screen->_currentPalette, 30, &_updateFunctor);
-
- return 0;
-}
-
-int KyraEngine_v2::o2_customChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customChat(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
- strcpy((char*)_unkBuf500Bytes, stackPosString(0));
- _chatText = (char*)_unkBuf500Bytes;
- _chatObject = stackPos(1);
-
- _chatVocHigh = _chatVocLow = -1;
- objectChatInit(_chatText, _chatObject, _vocHigh, stackPos(2));
- playVoice(_vocHigh, stackPos(2));
- return 0;
-}
-
-int KyraEngine_v2::o2_customChatFinish(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customChatFinish(%p) ()", (const void *)script);
- _text->restoreScreen();
- _chatText = 0;
- _chatObject = -1;
- return 0;
+ return (int16)_hiddenItems[stackPos(0)];
}
-int KyraEngine_v2::o2_setupSceneAnimation(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setupSceneAnimation(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
- const int index = stackPos(0);
- const uint16 flags = stackPos(1);
-
- restorePage3();
-
- SceneAnim &anim = _sceneAnims[index];
- anim.flags = flags;
- anim.x = stackPos(2);
- anim.y = stackPos(3);
- anim.x2 = stackPos(4);
- anim.y2 = stackPos(5);
- anim.width = stackPos(6);
- anim.height = stackPos(7);
- anim.unkE = stackPos(8);
- anim.specialSize = stackPos(9);
- anim.unk12 = stackPos(10);
- anim.shapeIndex = stackPos(11);
- if (stackPosString(12))
- strcpy(anim.filename, stackPosString(12));
-
- if (flags & 0x40) {
- _sceneAnimMovie[index]->open(stackPosString(12), 0, 0);
- if (_sceneAnimMovie[index]->xAdd() || _sceneAnimMovie[index]->yAdd())
- anim.wsaFlag = 1;
- else
- anim.wsaFlag = 0;
- }
-
- AnimObj *obj = &_animObjects[1+index];
- obj->enabled = 1;
- obj->needRefresh = 1;
- obj->unk8 = 1;
- obj->animFlags = anim.flags & 8;
-
- if (anim.flags & 2)
- obj->flags = 0x800;
- else
- obj->flags = 0;
-
- if (anim.flags & 4)
- obj->flags |= 1;
-
- obj->xPos1 = anim.x;
- obj->yPos1 = anim.y;
-
- if ((anim.flags & 0x20) && anim.shapeIndex >= 0)
- obj->shapePtr = _sceneShapeTable[anim.shapeIndex];
- else
- obj->shapePtr = 0;
-
- if (anim.flags & 0x40) {
- obj->shapeIndex3 = anim.shapeIndex;
- obj->animNum = index;
- } else {
- obj->shapeIndex3 = 0xFFFF;
- obj->animNum = 0xFFFF;
- }
-
- obj->shapeIndex2 = 0xFFFF;
- obj->xPos2 = obj->xPos3 = anim.x2;
- obj->yPos2 = obj->yPos3 = anim.y2;
- obj->width = anim.width;
- obj->height = anim.height;
- obj->width2 = obj->height2 = anim.specialSize;
-
- _animList = addToAnimListSorted(_animList, obj);
- obj->needRefresh = 1;
- obj->unk8 = 1;
- return 0;
-}
-
-int KyraEngine_v2::o2_stopSceneAnimation(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_stopSceneAnimation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const int index = stackPos(0);
- AnimObj &obj = _animObjects[1+index];
- restorePage3();
- obj.shapeIndex3 = 0xFFFF;
- obj.animNum = 0xFFFF;
- obj.needRefresh = 1;
- obj.unk8 = 1;
- if (stackPos(1))
- refreshAnimObjectsIfNeed();
- obj.enabled = 0;
- _animList = deleteAnimListEntry(_animList, &_animObjects[1+index]);
-
- if (_sceneAnimMovie[index]->opened())
- _sceneAnimMovie[index]->close();
-
- return 0;
-}
-
-int KyraEngine_v2::o2_disableTimer(ScriptState *script) {
+int KyraEngine_v2::o2_disableTimer(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableTimer(%p) (%d)", (const void *)script, stackPos(0));
_timer->disable(stackPos(0));
return 0;
}
-int KyraEngine_v2::o2_enableTimer(ScriptState *script) {
+int KyraEngine_v2::o2_enableTimer(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableTimer(%p) (%d)", (const void *)script, stackPos(0));
_timer->enable(stackPos(0));
return 0;
}
-int KyraEngine_v2::o2_setTimerCountdown(ScriptState *script) {
+int KyraEngine_v2::o2_setTimerCountdown(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setTimerCountdown(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_timer->setCountdown(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v2::o2_processPaletteIndex(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_processPaletteIndex(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- uint8 *palette = _screen->getPalette(0);
- const int index = stackPos(0);
- const bool updatePalette = (stackPos(4) != 0);
- const int delayTime = stackPos(5);
- palette[index*3+0] = (stackPos(1) * 0x3F) / 100;
- palette[index*3+1] = (stackPos(2) * 0x3F) / 100;
- palette[index*3+2] = (stackPos(3) * 0x3F) / 100;
- if (updatePalette) {
- if (delayTime > 0)
- _screen->fadePalette(palette, delayTime, &_updateFunctor);
- else
- _screen->setScreenPalette(palette);
- }
- return 0;
-}
-
-int KyraEngine_v2::o2_updateTwoSceneAnims(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- updateSceneAnim(stackPos(0), stackPos(1));
- updateSceneAnim(stackPos(2), stackPos(3));
- _specialSceneScriptRunFlag = false;
- return 0;
-}
-
-int KyraEngine_v2::o2_getRainbowRoomData(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRainbowRoomData(%p) (%d)", (const void *)script, stackPos(0));
- return _rainbowRoomData[stackPos(0)];
-}
-
-int KyraEngine_v2::o2_drawSceneShapeEx(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShapeEx(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- const int itemShape = stackPos(0) + 64;
- const int x = stackPos(1);
- const int y = stackPos(2);
- const bool skipFronUpdate = (stackPos(3) != 0);
-
- _screen->drawShape(2, _sceneShapeTable[6], x, y, 2, 0);
- _screen->drawShape(2, getShapePtr(itemShape), x+2, y+2, 2, 0);
-
- if (!skipFronUpdate) {
- _screen->copyRegion(x, y, x, y, 0x15, 0x14, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- }
-
- return 0;
-}
-
-int KyraEngine_v2::o2_getBoolFromStack(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getBoolFromStack(%p) ()", (const void *)script);
- return stackPos(0) ? 1 : 0;
-}
-
-int KyraEngine_v2::o2_getSfxDriver(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getSfxDriver(%p) ()", (const void *)script);
- if (_sound->getSfxType() == Sound::kAdlib)
- return 1;
- else if (_sound->getSfxType() == Sound::kMidiMT32)
- return 6;
- else if (_sound->getSfxType() == Sound::kMidiGM)
- return 7;
- // TODO: find nice default value
- return 0;
-}
-
-int KyraEngine_v2::o2_getVocSupport(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getVocSupport(%p) ()", (const void *)script);
- // we always support VOC file playback
- return 1;
-}
-
-int KyraEngine_v2::o2_getMusicDriver(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getMusicDriver(%p) ()", (const void *)script);
- if (_sound->getMusicType() == Sound::kAdlib)
- return 1;
- else if (_sound->getMusicType() == Sound::kMidiMT32)
- return 6;
- else if (_sound->getMusicType() == Sound::kMidiGM)
- return 7;
- // TODO: find nice default value
- return 0;
-}
-
-int KyraEngine_v2::o2_setVocHigh(ScriptState *script) {
+int KyraEngine_v2::o2_setVocHigh(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setVocHigh(%p) (%d)", (const void *)script, stackPos(0));
_vocHigh = stackPos(0);
return _vocHigh;
}
-int KyraEngine_v2::o2_getVocHigh(ScriptState *script) {
+int KyraEngine_v2::o2_getVocHigh(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getVocHigh(%p) ()", (const void *)script);
return _vocHigh;
}
-int KyraEngine_v2::o2_zanthiaChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_zanthiaChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- objectChat(stackPosString(0), 0, _vocHigh, stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_isVoiceEnabled(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isVoiceEnabled(%p) ()", (const void *)script);
- return speechEnabled() ? 1 : 0;
-}
-
-int KyraEngine_v2::o2_isVoicePlaying(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isVoicePlaying(%p) ()", (const void *)script);
- return (snd_voiceIsPlaying() && !skipFlag()) ? 1 : 0;
-}
-
-int KyraEngine_v2::o2_stopVoicePlaying(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_stopVoicePlaying(%p) ()", (const void *)script);
- snd_stopVoice();
- return 0;
-}
-
-int KyraEngine_v2::o2_getGameLanguage(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getGameLanguage(%p) ()", (const void *)script);
- return _lang;
-}
-
-int KyraEngine_v2::o2_demoFinale(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_demoFinale(%p) ()", (const void *)script);
- if (!_flags.isDemo)
- return 0;
-
- int tmpSize;
- const char *const *strings = _staticres->loadStrings(k2IngameTlkDemoStrings, tmpSize);
- assert(strings);
-
- _screen->clearPage(0);
- _screen->loadPalette("THANKS.COL", _screen->_currentPalette);
- _screen->loadBitmap("THANKS.CPS", 3, 3, 0);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
-
- _screen->_curPage = 0;
- _screen->setFont(Screen::FID_6_FNT);
- int y = _lang == 1 ? 70 : 65;
- for (int i = 0; i < 6; i++)
- _text->printText(strings[i], _text->getCenterStringX(strings[i], 1, 319), y + i * 10, 255, 207, 0);
-
- _screen->setScreenPalette(_screen->_currentPalette);
- _screen->updateScreen();
-
- _eventList.clear();
- while (!skipFlag())
- delay(10);
-
- _sound->beginFadeOut();
- _screen->fadeToBlack();
-
- _runFlag = 0;
- return 0;
-}
-
-int KyraEngine_v2::o2_dummy(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_dummy(%p) ()", (const void *)script);
- return 0;
-}
-
#pragma mark -
-int KyraEngine_v2::o2t_defineNewShapes(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0),
- stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
-
- strcpy(_newShapeFilename, stackPosString(0));
- _newShapeLastEntry = stackPos(1);
- _newShapeWidth = stackPos(2);
- _newShapeHeight = stackPos(3);
- _newShapeXAdd = stackPos(4);
- _newShapeYAdd = stackPos(5);
- //word_324EB = stackPos(6); <- never used
-
- return 0;
-}
-
-int KyraEngine_v2::o2t_setCurrentFrame(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _newShapeAnimFrame = stackPos(0);
- _newShapeDelay = stackPos(1);
- _temporaryScriptExecBit = true;
+int KyraEngine_v2::o2a_setAnimationShapes(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2a_setAnimationShapes(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script,
+ stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ strcpy(_animShapeFilename, stackPosString(0));
+ _animShapeLastEntry = stackPos(1);
+ _animShapeWidth = stackPos(2);
+ _animShapeHeight = stackPos(3);
+ _animShapeXAdd = stackPos(4);
+ _animShapeYAdd = stackPos(5);
return 0;
}
-int KyraEngine_v2::o2t_playSoundEffect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
- snd_playSoundEffect(stackPos(0));
+int KyraEngine_v2::o2a_setResetFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3t_setResetFrame(%p) (%d)", (const void *)script, stackPos(0));
+ _animResetFrame = stackPos(0);
return 0;
}
-int KyraEngine_v2::o2t_fadeScenePal(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- fadeScenePal(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2t_setShapeFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_setShapeFlag(%p) (%d)", (const void *)script, stackPos(0));
- if (_flags.isTalkie)
- _newShapeFlag = stackPos(0);
- return 0;
-}
-
-#pragma mark -
-
-int KyraEngine_v2::t2_initChat(const TIM *tim, const uint16 *param) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_initChat(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
- _chatText = (const char*)tim->text + READ_LE_UINT16(tim->text + (param[0] << 1));
- _chatObject = param[1];
-
- if (_flags.lang == Common::JA_JPN) {
- for (int i = 0; i < _ingameTimJpStrSize; i += 2) {
- if (!scumm_stricmp(_chatText, _ingameTimJpStr[i]))
- _chatText = _ingameTimJpStr[i + 1];
- }
- }
-
- objectChatInit(_chatText, _chatObject);
- return 0;
-}
-
-int KyraEngine_v2::t2_updateSceneAnim(const TIM *tim, const uint16 *param) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_updateSceneAnim(%p, %p) (%d, %d)", (const void*)tim, (const void*)param, param[0], param[1]);
- updateSceneAnim(param[1], param[0]);
- return 0;
-}
-
-int KyraEngine_v2::t2_resetChat(const TIM *tim, const uint16 *param) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_resetChat(%p, %p) ()", (const void*)tim, (const void*)param);
- _text->restoreScreen();
- _chatText = 0;
- _chatObject = -1;
- return 0;
-}
-
-int KyraEngine_v2::t2_playSoundEffect(const TIM *tim, const uint16 *param) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_playSoundEffect(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
- snd_playSoundEffect(*param);
- return 0;
-}
-
-#pragma mark -
-
-typedef Common::Functor1Mem<ScriptState*, int, KyraEngine_v2> OpcodeV2;
-#define SetOpcodeTable(x) table = &x;
-#define Opcode(x) table->push_back(new OpcodeV2(this, &KyraEngine_v2::x))
-#define OpcodeUnImpl() table->push_back(new OpcodeV2(this, 0))
-
-typedef Common::Functor2Mem<const TIM*, const uint16*, int, KyraEngine_v2> TIMOpcodeV2;
-#define OpcodeTim(x) _timOpcodes.push_back(new TIMOpcodeV2(this, &KyraEngine_v2::x))
-#define OpcodeTimUnImpl() _timOpcodes.push_back(TIMOpcodeV2(this, 0))
-
-void KyraEngine_v2::setupOpcodeTable() {
- Common::Array<const Opcode*> *table = 0;
-
- SetOpcodeTable(_opcodes);
- // 0x00
- Opcode(o2_setCharacterFacingRefresh);
- Opcode(o2_setCharacterPos);
- Opcode(o2_defineObject);
- Opcode(o2_refreshCharacter);
- // 0x04
- Opcode(o2_getCharacterX);
- Opcode(o2_getCharacterY);
- Opcode(o2_getCharacterFacing);
- Opcode(o2_getCharacterScene);
- // 0x08
- Opcode(o2_setSceneComment);
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o2_setCharacterAnimFrame);
- // 0x0c
- Opcode(o2_setCharacterFacing);
- Opcode(o2_trySceneChange);
- Opcode(o2_moveCharacter);
- Opcode(o2_customCharacterChat);
- // 0x10
- Opcode(o2_soundFadeOut);
- Opcode(o2_showChapterMessage);
- Opcode(o2_restoreTalkTextMessageBkgd);
- OpcodeUnImpl();
- // 0x14
- Opcode(o2_wsaClose);
- Opcode(o2_backUpScreen);
- Opcode(o2_restoreScreen);
- Opcode(o2_displayWsaFrame);
- // 0x18
- Opcode(o2_displayWsaSequentialFramesLooping);
- Opcode(o2_wsaOpen);
- Opcode(o2_displayWsaSequentialFrames);
- Opcode(o2_displayWsaSequence);
- // 0x1c
- Opcode(o2_addItemToInventory);
- Opcode(o2_drawShape);
- Opcode(o2_addItemToCurScene);
- Opcode(o2_dummy); // the original used this opcode to limit the mouse range temporary,
- // since that is of no use and not really important we just use a dummy here
- // 0x20
- Opcode(o2_checkForItem);
- Opcode(o2_loadSoundFile);
- Opcode(o2_removeItemSlotFromInventory);
- Opcode(o2_defineItem);
- // 0x24
- Opcode(o2_removeItemFromInventory);
- Opcode(o2_countItemInInventory);
- Opcode(o2_countItemsInScene);
- Opcode(o2_queryGameFlag);
- // 0x28
- Opcode(o2_resetGameFlag);
- Opcode(o2_setGameFlag);
- Opcode(o2_setHandItem);
- Opcode(o2_removeHandItem);
- // 0x2c
- Opcode(o2_handItemSet);
- Opcode(o2_hideMouse);
- Opcode(o2_addSpecialExit);
- Opcode(o2_setMousePos);
- // 0x30
- Opcode(o2_showMouse);
- OpcodeUnImpl();
- Opcode(o2_wipeDownMouseItem);
- Opcode(o2_getElapsedSecs);
- // 0x34
- Opcode(o2_getTimerDelay);
- Opcode(o2_playSoundEffect);
- Opcode(o2_delaySecs);
- Opcode(o2_delay);
- // 0x38
- Opcode(o2_dummy);
- Opcode(o2_setTimerDelay);
- Opcode(o2_setScaleTableItem);
- Opcode(o2_setDrawLayerTableItem);
- // 0x3c
- Opcode(o2_setCharPalEntry);
- Opcode(o2_loadZShapes);
- Opcode(o2_drawSceneShape);
- Opcode(o2_drawSceneShapeOnPage);
- // 0x40
- Opcode(o2_disableAnimObject);
- Opcode(o2_enableAnimObject);
- Opcode(o2_dummy);
- Opcode(o2_loadPalette384);
- // 0x44
- Opcode(o2_setPalette384);
- Opcode(o2_restoreBackBuffer);
- Opcode(o2_backUpInventoryGfx);
- Opcode(o2_disableSceneAnim);
- // 0x48
- Opcode(o2_enableSceneAnim);
- Opcode(o2_restoreInventoryGfx);
- Opcode(o2_setSceneAnimPos2);
- Opcode(o2_update);
- // 0x4c
- OpcodeUnImpl();
- Opcode(o2_fadeScenePal);
- Opcode(o2_dummy);
- Opcode(o2_dummy);
- // 0x50
- Opcode(o2_enterNewSceneEx);
- Opcode(o2_switchScene);
- Opcode(o2_getShapeFlag1);
- Opcode(o2_setPathfinderFlag);
- // 0x54
- Opcode(o2_getSceneExitToFacing);
- Opcode(o2_setLayerFlag);
- Opcode(o2_setZanthiaPos);
- Opcode(o2_loadMusicTrack);
- // 0x58
- Opcode(o2_playWanderScoreViaMap);
- Opcode(o2_playSoundEffect);
- Opcode(o2_setSceneAnimPos);
- Opcode(o2_blockInRegion);
- // 0x5c
- Opcode(o2_blockOutRegion);
- OpcodeUnImpl();
- Opcode(o2_setCauldronState);
- Opcode(o2_showItemString);
- // 0x60
- Opcode(o2_getRand);
- Opcode(o2_isAnySoundPlaying);
- Opcode(o2_setDeathHandlerFlag);
- Opcode(o2_setDrawNoShapeFlag);
- // 0x64
- Opcode(o2_setRunFlag);
- Opcode(o2_showLetter);
- OpcodeUnImpl();
- Opcode(o2_fillRect);
- // 0x68
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o2_waitForConfirmationClick);
- // 0x6c
- Opcode(o2_encodeShape);
- Opcode(o2_defineRoomEntrance);
- Opcode(o2_runTemporaryScript);
- Opcode(o2_setSpecialSceneScriptRunTime);
- // 0x70
- Opcode(o2_defineSceneAnim);
- Opcode(o2_updateSceneAnim);
- Opcode(o2_updateSceneAnim);
- Opcode(o2_addToSceneAnimPosAndUpdate);
- // 0x74
- Opcode(o2_useItemOnMainChar);
- Opcode(o2_startDialogue);
- Opcode(o2_zanthRandomChat);
- Opcode(o2_setupDialogue);
- // 0x78
- Opcode(o2_getDlgIndex);
- Opcode(o2_defineRoom);
- Opcode(o2_addCauldronStateTableEntry);
- Opcode(o2_setCountDown);
- // 0x7c
- Opcode(o2_getCountDown);
- Opcode(o2_dummy);
- Opcode(o2_dummy);
- Opcode(o2_pressColorKey);
- // 0x80
- Opcode(o2_objectChat);
- Opcode(o2_chapterChange);
- Opcode(o2_getColorCodeFlag1);
- Opcode(o2_setColorCodeFlag1);
- // 0x84
- Opcode(o2_getColorCodeFlag2);
- Opcode(o2_setColorCodeFlag2);
- Opcode(o2_getColorCodeValue);
- Opcode(o2_setColorCodeValue);
- // 0x88
- Opcode(o2_countItemInstances);
- Opcode(o2_removeItemFromScene);
- Opcode(o2_initObject);
- Opcode(o2_npcChat);
- // 0x8c
- Opcode(o2_deinitObject);
- Opcode(o2_playTimSequence);
- Opcode(o2_makeBookOrCauldronAppear);
- Opcode(o2_setSpecialSceneScriptState);
- // 0x90
- Opcode(o2_clearSpecialSceneScriptState);
- Opcode(o2_querySpecialSceneScriptState);
- Opcode(o2_resetInputColorCode);
- Opcode(o2_setHiddenItemsEntry);
- // 0x94
- Opcode(o2_getHiddenItemsEntry);
- Opcode(o2_mushroomEffect);
- Opcode(o2_wsaClose);
- Opcode(o2_meanWhileScene);
- // 0x98
- Opcode(o2_customChat);
- Opcode(o2_customChatFinish);
- Opcode(o2_setupSceneAnimation);
- Opcode(o2_stopSceneAnimation);
- // 0x9c
- Opcode(o2_disableTimer);
- Opcode(o2_enableTimer);
- Opcode(o2_setTimerCountdown);
- Opcode(o2_processPaletteIndex);
- // 0xa0
- Opcode(o2_updateTwoSceneAnims);
- Opcode(o2_getRainbowRoomData);
- Opcode(o2_drawSceneShapeEx);
- Opcode(o2_getBoolFromStack);
- // 0xa4
- Opcode(o2_getSfxDriver);
- Opcode(o2_getVocSupport);
- Opcode(o2_getMusicDriver);
- Opcode(o2_setVocHigh);
- // 0xa8
- Opcode(o2_getVocHigh);
- Opcode(o2_zanthiaChat);
- Opcode(o2_isVoiceEnabled);
- Opcode(o2_isVoicePlaying);
- // 0xac
- Opcode(o2_stopVoicePlaying);
- Opcode(o2_getGameLanguage);
- Opcode(o2_demoFinale);
- Opcode(o2_dummy);
-
- SetOpcodeTable(_opcodesTemporary);
-
- // 0x00
- Opcode(o2t_defineNewShapes);
- Opcode(o2t_setCurrentFrame);
- Opcode(o2t_playSoundEffect);
- Opcode(o2t_fadeScenePal);
- // 0x04
- Opcode(o2t_setShapeFlag);
- Opcode(o2_dummy);
-
- // ---- TIM opcodes
-
- // 0x00
- OpcodeTim(t2_initChat);
- OpcodeTim(t2_updateSceneAnim);
- OpcodeTim(t2_resetChat);
- OpcodeTim(t2_playSoundEffect);
-}
-
} // end of namespace Kyra
-
-
-
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
deleted file mode 100644
index 09af5b169e..0000000000
--- a/engines/kyra/script_v3.cpp
+++ /dev/null
@@ -1,1268 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "kyra/kyra_v3.h"
-#include "kyra/script.h"
-#include "kyra/screen_v3.h"
-#include "kyra/wsamovie.h"
-
-#include "common/endian.h"
-
-namespace Kyra {
-
-int KyraEngine_v3::o3_getMalcolmShapes(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMaloclmShapes(%p) ()", (const void *)script);
- return _malcolmShapes;
-}
-
-int KyraEngine_v3::o3_setCharacterPos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- int x = stackPos(0);
- int y = stackPos(1);
-
- if (x != -1 && y != -1) {
- x &= ~3;
- y &= ~1;
- }
-
- _mainCharacter.x1 = _mainCharacter.x2 = x;
- _mainCharacter.y1 = _mainCharacter.y2 = y;
-
- return 0;
-}
-
-int KyraEngine_v3::o3_defineObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineObject(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
- TalkObject &obj = _talkObjectList[stackPos(0)];
- strcpy(obj.filename, stackPosString(1));
- obj.sceneAnim = stackPos(2);
- obj.sceneScript = stackPos(3);
- obj.x = stackPos(4);
- obj.y = stackPos(5);
- obj.color = stackPos(6);
- obj.sceneId = stackPos(7);
- return 0;
-}
-
-int KyraEngine_v3::o3_refreshCharacter(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_refreshCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- const int frame = stackPos(0);
- const int facing = stackPos(1);
- const bool updateNeed = stackPos(2) != 0;
-
- if (facing >= 0)
- _mainCharacter.facing = facing;
-
- if (frame >= 0 && frame != 87)
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- else
- _mainCharacter.animFrame = 87;
-
- updateCharacterAnim(0);
-
- if (updateNeed)
- refreshAnimObjectsIfNeed();
- return 0;
-}
-
-int KyraEngine_v3::o3_getCharacterX(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterX(%p) ()", (const void *)script);
- return _mainCharacter.x1;
-}
-
-int KyraEngine_v3::o3_getCharacterY(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterY(%p) ()", (const void *)script);
- return _mainCharacter.y1;
-}
-
-int KyraEngine_v3::o3_getCharacterFacing(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterFacing(%p) ()", (const void *)script);
- return _mainCharacter.facing;
-}
-
-int KyraEngine_v3::o3_getCharacterScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterScene(%p) ()", (const void *)script);
- return _mainCharacter.sceneId;
-}
-
-int KyraEngine_v3::o3_getMalcolmsMood(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMalcolmsMood(%p) ()", (const void *)script);
- return _malcolmsMood;
-}
-
-int KyraEngine_v3::o3_trySceneChange(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3));
-
- _unkHandleSceneChangeFlag = 1;
- int success = inputSceneChange(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _unkHandleSceneChangeFlag = 0;
-
- if (success) {
- _scriptInterpreter->initScript(script, script->dataPtr);
- _unk4 = 0;
- _unk3 = -1;
- _unk5 = 1;
- return 0;
- } else {
- return (_unk4 != 0) ? 1 : 0;
- }
-}
-
-int KyraEngine_v3::o3_moveCharacter(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- moveCharacter(stackPos(0), stackPos(1), stackPos(2));
- return 0;
-}
-
-int KyraEngine_v3::o3_setCharacterFacing(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0));
- _mainCharacter.facing = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v3::o3_showSceneFileMessage(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0));
- showMessage((const char*)getTableEntry(_scenesFile, stackPos(0)), 0xFF, 0xF0);
- return 0;
-}
-
-int KyraEngine_v3::o3_showBadConscience(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showBadConscience(%p) ()", (const void *)script);
- showBadConscience();
- return 0;
-}
-
-int KyraEngine_v3::o3_hideBadConscience(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideBadConscience(%p) ()", (const void *)script);
- hideBadConscience();
- return 0;
-}
-
-int KyraEngine_v3::o3_objectChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_objectChat(%p) (%d)", (const void *)script, stackPos(0));
- int id = stackPos(0);
- const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id);
- if (str) {
- objectChat(str, 0, _vocHigh, id);
- playStudioSFX(str);
- }
- return 0;
-}
-
-int KyraEngine_v3::o3_checkForItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- return findItem(stackPos(0), stackPos(1)) == -1 ? 0 : 1;
-}
-
-int KyraEngine_v3::o3_defineItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineItem(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- int freeItem = findFreeItem();
- if (freeItem != -1) {
- _itemList[freeItem].id = stackPos(0);
- _itemList[freeItem].x = stackPos(1);
- _itemList[freeItem].y = stackPos(2);
- _itemList[freeItem].sceneId = stackPos(3);
- }
- return freeItem;
-}
-
-int KyraEngine_v3::o3_npcChatSequence(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_npcChatSequence(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const int id = stackPos(0);
- const char *str = (const char*)getTableEntry(_sceneStrings, id);
- if (str)
- npcChatSequence(str, stackPos(1), _vocHigh, id);
- return 0;
-}
-
-int KyraEngine_v3::o3_queryGameFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return queryGameFlag(stackPos(0));
-}
-
-int KyraEngine_v3::o3_resetGameFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- resetGameFlag(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v3::o3_setGameFlag(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- setGameFlag(stackPos(0));
- return 1;
-}
-
-int KyraEngine_v3::o3_setHandItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
- setHandItem(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v3::o3_removeHandItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeHandItem(%p) ()", (const void *)script);
- removeHandItem();
- return 0;
-}
-
-int KyraEngine_v3::o3_handItemSet(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_handItemSet(%p) ()", (const void *)script);
- return _handItemSet;
-}
-
-int KyraEngine_v3::o3_hideMouse(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideMouse(%p) ()", (const void *)script);
- _screen->hideMouse();
- return 0;
-}
-
-int KyraEngine_v3::o3_addSpecialExit(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- if (_specialExitCount < 5) {
- _specialExitTable[_specialExitCount+0] = stackPos(0);
- _specialExitTable[_specialExitCount+5] = stackPos(1);
- _specialExitTable[_specialExitCount+10] = stackPos(2) + stackPos(0) - 1;
- _specialExitTable[_specialExitCount+15] = stackPos(3) + stackPos(1) - 1;
- _specialExitTable[_specialExitCount+20] = stackPos(4);
- ++_specialExitCount;
- }
- return 0;
-}
-
-int KyraEngine_v3::o3_setMousePos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setMousePos(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_showMouse(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showMouse(%p) ()", (const void *)script);
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v3::o3_badConscienceChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_badConscienceChat(%p) (%d)", (const void *)script, stackPos(0));
- int id = stackPos(0);
- const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id);
- badConscienceChat(str, _vocHigh, id);
- return 0;
-}
-
-int KyraEngine_v3::o3_wipeDownMouseItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
- _screen->hideMouse();
- const int x = stackPos(1) - 12;
- const int y = stackPos(2) - 19;
-
- if (_itemInHand >= 0) {
- backUpGfxRect32x32(x, y);
- uint8 *shape = getShapePtr(_itemInHand+248);
- for (int curY = y, height = 20; height > 0; height -= 2, curY += 2) {
- restoreGfxRect32x32(x, y);
- _screen->setNewShapeHeight(shape, height);
- uint32 waitTime = _system->getMillis() + _tickLength;
- _screen->drawShape(0, shape, x, curY, 0, 0);
- _screen->updateScreen();
- delayUntil(waitTime);
- }
- restoreGfxRect32x32(x, y);
- _screen->resetShapeHeight(shape);
- }
-
- _screen->showMouse();
- removeHandItem();
-
- return 0;
-}
-
-int KyraEngine_v3::o3_setMalcolmsMood(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmsMood(%p) (%d)", (const void *)script, stackPos(0));
- return (_malcolmsMood = stackPos(0));
-}
-
-int KyraEngine_v3::o3_delay(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- const uint32 delayTime = stackPos(0) * _tickLength;
- const int delayFunc = stackPos(1);
-
- if (delayFunc)
- warning("STUB o3_delay func 1");
-
- delay(delayTime, true);
- return 0;
-}
-
-int KyraEngine_v3::o3_setSceneFilename(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneFilename(%p) (%d, '%s')", (const void *)script, stackPos(0), stackPosString(1));
- strcpy(_sceneList[stackPos(0)].filename1, stackPosString(1));
- _sceneList[stackPos(0)].filename1[9] = 0;
- return 0;
-}
-
-int KyraEngine_v3::o3_drawSceneShape(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_drawSceneShape(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- const int shape = stackPos(0);
-
- int x = _sceneShapeDescs[shape].drawX;
- int y = _sceneShapeDescs[shape].drawY;
- _screen->drawShape(stackPos(2), _sceneShapes[shape], x, y, 2, (stackPos(1) != 0) ? 1 : 0);
- return 0;
-}
-
-int KyraEngine_v3::o3_checkInRect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_checkInRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- const int x1 = stackPos(0);
- const int y1 = stackPos(1);
- const int x2 = stackPos(2);
- const int y2 = stackPos(3);
- int x = stackPos(4), y = stackPos(5);
- if (_itemInHand >= 0) {
- const int8 *desc = &_itemBuffer2[_itemInHand*2];
- x -= 12;
- x += desc[0];
- y -= 19;
- y += desc[1];
- }
-
- if (x >= x1 && x <= x2 && y >= y1 && y <= y2) {
- //XXX
- return 1;
- } else {
- //XXX
- return 0;
- }
-}
-
-int KyraEngine_v3::o3_updateConversations(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_updateConversations(%p) (%d)", (const void *)script, stackPos(0));
- int dlgIndex = stackPos(0);
- switch (_curChapter-2) {
- case 0:
- dlgIndex -= 34;
- break;
-
- case 1:
- dlgIndex -= 54;
- break;
-
- case 2:
- dlgIndex -= 55;
- break;
-
- case 3:
- dlgIndex -= 70;
- break;
-
- default:
- break;
- }
-
- int convs[4];
- Common::set_to(convs, convs+4, -1);
-
- if (_curChapter == 1) {
- switch (_mainCharacter.dlgIndex) {
- case 0:
- convs[0] = 6;
- convs[1] = 12;
- break;
-
- case 2:
- convs[0] = 8;
- convs[1] = 14;
- break;
-
- case 3:
- convs[0] = 9;
- convs[1] = 15;
- break;
-
- case 4:
- convs[0] = 10;
- convs[1] = 16;
- break;
-
- case 5:
- convs[0] = 11;
- convs[1] = 17;
- break;
-
- case 6:
- convs[0] = 0;
- convs[1] = 12;
- break;
-
- case 8:
- convs[0] = 2;
- convs[1] = 14;
- break;
-
- case 9:
- convs[0] = 3;
- convs[1] = 15;
- break;
-
- case 10:
- convs[0] = 4;
- convs[1] = 16;
- break;
-
- case 11:
- convs[0] = 5;
- convs[1] = 17;
- break;
-
- case 12:
- convs[0] = 0;
- convs[1] = 6;
- break;
-
- case 14:
- convs[0] = 2;
- convs[1] = 8;
- break;
-
- case 15:
- convs[0] = 3;
- convs[1] = 9;
- break;
-
- case 16:
- convs[0] = 4;
- convs[1] = 10;
- break;
-
- case 17:
- convs[0] = 5;
- convs[1] = 11;
- break;
-
- default:
- break;
- }
- } else if (_curChapter == 2) {
- switch (_mainCharacter.dlgIndex) {
- case 0:
- convs[0] = 4;
- convs[1] = 8;
- convs[2] = 5;
- convs[3] = 9;
- break;
-
- case 1:
- convs[0] = 4;
- convs[1] = 8;
- convs[2] = 0;
- convs[3] = 5;
- break;
-
- case 2:
- convs[0] = 6;
- convs[2] = 11;
- break;
-
- case 3:
- convs[0] = 7;
- convs[2] = 12;
- break;
-
- case 4:
- convs[0] = 0;
- convs[1] = 8;
- convs[2] = 1;
- convs[3] = 9;
- break;
-
- case 5:
- convs[0] = 0;
- convs[1] = 8;
- convs[2] = 4;
- convs[3] = 1;
- break;
-
- case 6:
- convs[0] = 2;
- convs[1] = 10;
- break;
-
- case 7:
- convs[0] = 3;
- convs[1] = 11;
- break;
-
- case 8:
- convs[0] = 0;
- convs[1] = 4;
- convs[2] = 1;
- break;
-
- case 9:
- convs[0] = 0;
- convs[1] = 4;
- convs[2] = 0;
- convs[4] = 1;
- break;
-
- case 10:
- convs[0] = 2;
- convs[1] = 6;
- break;
-
- case 11:
- convs[0] = 3;
- convs[1] = 7;
- break;
-
- default:
- break;
- }
- } else if (_curChapter == 4) {
- if (_malcolmsMood == 0) {
- convs[0] = _mainCharacter.dlgIndex - 10;
- convs[1] = _mainCharacter.dlgIndex - 5;
- } else if (_malcolmsMood == 1) {
- convs[0] = _mainCharacter.dlgIndex + 5;
- convs[1] = _mainCharacter.dlgIndex + 10;
- } else if (_malcolmsMood == 2) {
- convs[0] = _mainCharacter.dlgIndex - 5;
- convs[1] = _mainCharacter.dlgIndex + 5;
- }
- }
-
- for (int i = 0; i < 4; ++i) {
- if (convs[i] != -1)
- _conversationState[dlgIndex][convs[i]] = 0;
- }
-
- return 1;
-}
-
-int KyraEngine_v3::o3_setSceneDim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneDim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _sceneMinX = stackPos(0);
- _sceneMaxX = stackPos(1);
- return 0;
-}
-
-int KyraEngine_v3::o3_update(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_update(%p) (%d)", (const void *)script, stackPos(0));
- for (int times = stackPos(0); times != 0; --times) {
- if (_chatText)
- updateWithText();
- else
- update();
- }
- return 0;
-}
-
-int KyraEngine_v3::o3_enterNewScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0),
- stackPos(1), stackPos(2), stackPos(3), stackPos(4));
-
- _screen->hideMouse();
- enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
-
- _unk5 = 1;
-
- if (_mainCharX == -1 || _mainCharY == -1) {
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- updateCharacterAnim(0);
- }
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v3::o3_setMalcolmPos(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _mainCharX = stackPos(0);
- _mainCharY = stackPos(1);
-
- if (_mainCharX == -1 && _mainCharY == -1)
- _mainCharacter.animFrame = 87;
- else
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
-
- return 0;
-}
-
-int KyraEngine_v3::o3_stopMusic(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_stopMusic(%p) ()", (const void *)script);
- stopMusicTrack();
- return 0;
-}
-
-int KyraEngine_v3::o3_playMusicTrack(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playMusicTrack(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- playMusicTrack(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_playSoundEffect(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- playSoundEffect(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_blockOutRegion(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- const int x1 = stackPos(0);
- int y1 = stackPos(1);
- const int x2 = stackPos(2);
- int y2 = stackPos(3);
-
- if (y1 < _maskPageMinY)
- y1 = _maskPageMinY;
- if (y2 > _maskPageMaxY)
- y2 = _maskPageMaxY;
-
- _screen->blockOutRegion(x1, y1, x2-x1+1, y2-y1+1);
- return 0;
-}
-
-int KyraEngine_v3::o3_getRand(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < stackPos(1));
- return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
-}
-
-int KyraEngine_v3::o3_waitForConfirmationClick(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
- resetSkipFlag();
- uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
-
- while (_system->getMillis() < maxWaitTime) {
- int inputFlag = checkInput(0);
- removeInputTop();
-
- if (inputFlag == 198 || inputFlag == 199) {
- _sceneScriptState.regs[1] = _mouseX;
- _sceneScriptState.regs[2] = _mouseY;
- return 0;
- }
-
- update();
- _system->delayMillis(10);
- }
-
- _sceneScriptState.regs[1] = _mouseX;
- _sceneScriptState.regs[2] = _mouseY;
- return 1;
-}
-
-int KyraEngine_v3::o3_defineRoomEntrance(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- switch (stackPos(0)) {
- case 0:
- _sceneEnterX1 = stackPos(1);
- _sceneEnterY1 = stackPos(2);
- break;
-
- case 1:
- _sceneEnterX2 = stackPos(1);
- _sceneEnterY2 = stackPos(2);
- break;
-
- case 2:
- _sceneEnterX3 = stackPos(1);
- _sceneEnterY3 = stackPos(2);
- break;
-
- case 3:
- _sceneEnterX4 = stackPos(1);
- _sceneEnterY4 = stackPos(2);
- break;
-
- default:
- break;
- }
- return 0;
-}
-
-int KyraEngine_v3::o3_runTemporaryScript(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script,
- stackPosString(0), stackPos(1), stackPos(2), stackPos(3));
- const int newShapes = stackPos(1);
- const int unloadShapes = stackPos(2);
- const int allowSkip = stackPos(3);
- runTemporaryScript(stackPosString(0), allowSkip, (unloadShapes != 0) ? 1 : 0, newShapes, unloadShapes);
- return 0;
-}
-
-int KyraEngine_v3::o3_setSpecialSceneScriptRunTime(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) >= 0 && stackPos(0) < 10);
- _sceneSpecialScriptsTimer[stackPos(0)] = _system->getMillis() + stackPos(1) * _tickLength;
- return 0;
-}
-
-int KyraEngine_v3::o3_defineSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')",
- (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7),
- stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
- const int animId = stackPos(0);
- SceneAnim &anim = _sceneAnims[animId];
-
- musicUpdate(0);
-
- uint16 flags = anim.flags = stackPos(1);
- int x = anim.x = stackPos(2);
- int y = anim.y = stackPos(3);
- int x2 = anim.x2 = stackPos(4);
- int y2 = anim.y2 = stackPos(5);
- int w = anim.width = stackPos(6);
- int h = anim.height = stackPos(7);
- anim.unk10 = stackPos(8);
- anim.specialSize = stackPos(9);
- anim.unk14 = stackPos(10);
- anim.shapeIndex = stackPos(11);
- const char *filename = stackPosString(12);
-
- if (filename)
- strcpy(anim.filename, filename);
-
- if (flags & 8) {
- _sceneAnimMovie[animId]->open(filename, 1, 0);
- musicUpdate(0);
- if (_sceneAnimMovie[animId]->opened()) {
- anim.wsaFlag = 1;
- if (x2 == -1)
- x2 = _sceneAnimMovie[animId]->xAdd();
- if (y2 == -1)
- y2 = _sceneAnimMovie[animId]->yAdd();
- if (w == -1)
- w = _sceneAnimMovie[animId]->width();
- if (h == -1)
- h = _sceneAnimMovie[animId]->height();
- if (x == -1)
- x = (w >> 1) + x2;
- if (y == -1)
- y = y2 + h - 1;
-
- anim.x = x;
- anim.y = y;
- anim.x2 = x2;
- anim.y2 = y2;
- anim.width = w;
- anim.height = h;
- }
- }
-
- musicUpdate(0);
-
- return 9;
-}
-
-int KyraEngine_v3::o3_updateSceneAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- updateSceneAnim(stackPos(0), stackPos(1));
- _specialSceneScriptRunFlag = false;
- return 0;
-}
-
-int KyraEngine_v3::o3_runActorScript(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runActorScript(%p) ()", (const void *)script);
- ScriptData data;
- ScriptState state;
- memset(&data, 0, sizeof(data));
- memset(&state, 0, sizeof(state));
-
- _res->exists("_ACTOR.EMC", true);
- _scriptInterpreter->loadScript("_ACTOR.EMC", &data, &_opcodes);
- _scriptInterpreter->initScript(&state, &data);
- _scriptInterpreter->startScript(&state, 0);
-
- state.regs[4] = _itemInHand;
- state.regs[0] = _mainCharacter.sceneId;
-
- int vocHigh = _vocHigh;
- _vocHigh = 200;
- _useActorBuffer = true;
-
- while (_scriptInterpreter->validScript(&state))
- _scriptInterpreter->runScript(&state);
-
- _useActorBuffer = false;
- _vocHigh = vocHigh;
- _scriptInterpreter->unloadScript(&data);
-
- if (queryGameFlag(0x218)) {
- resetGameFlag(0x218);
- enterNewScene(78, -1, 0, 0, 0);
- }
-
- return 0;
-}
-
-int KyraEngine_v3::o3_runDialog(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runDialog(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- runDialog(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_malcolmRandomChat(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_malcolmRandomChat(%p) ()", (const void *)script);
- malcolmRandomChat();
- return 0;
-}
-
-int KyraEngine_v3::o3_setDlgIndex(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setDlgIndex(%p) (%d)", (const void *)script, stackPos(0));
- setDlgIndex(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v3::o3_getDlgIndex(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getDlgIndex(%p) ()", (const void *)script);
- return _mainCharacter.dlgIndex;
-}
-
-int KyraEngine_v3::o3_defineScene(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineScene(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)",
- (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
- const int scene = stackPos(0);
- strcpy(_sceneList[scene].filename1, stackPosString(1));
- _sceneList[scene].filename1[9] = 0;
- strcpy(_sceneList[scene].filename2, stackPosString(1));
- _sceneList[scene].filename2[9] = 0;
-
- _sceneList[scene].exit1 = stackPos(2);
- _sceneList[scene].exit2 = stackPos(3);
- _sceneList[scene].exit3 = stackPos(4);
- _sceneList[scene].exit4 = stackPos(5);
- _sceneList[scene].flags = stackPos(6);
- _sceneList[scene].sound = stackPos(7);
-
- if (_mainCharacter.sceneId == scene) {
- _sceneExit1 = _sceneList[scene].exit1;
- _sceneExit2 = _sceneList[scene].exit2;
- _sceneExit3 = _sceneList[scene].exit3;
- _sceneExit4 = _sceneList[scene].exit4;
- }
-
- return 0;
-}
-
-int KyraEngine_v3::o3_countItemInstances(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_countItemInstances(%p) (%d)", (const void *)script, stackPos(0));
- int count = 0;
- const int16 item = stackPos(0);
-
- for (int i = 0; i < 10; ++i) {
- if (_mainCharacter.inventory[i] == item)
- ++count;
- }
-
- if (_itemInHand == item)
- ++count;
-
- for (int i = 0; i < 50; ++i) {
- if (_itemList[i].id == item)
- ++count;
- }
-
- return count;
-}
-
-int KyraEngine_v3::o3_dialogStartScript(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dialogStartScript(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- dialogStartScript(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_dialogEndScript(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dialogEndScript(%p) (%d)", (const void *)script, stackPos(0));
- dialogEndScript(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v3::o3_setSpecialSceneScriptState(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
- _specialSceneScriptState[stackPos(0)] = 1;
- return 1;
-}
-
-int KyraEngine_v3::o3_clearSpecialSceneScriptState(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
- _specialSceneScriptState[stackPos(0)] = 0;
- return 0;
-}
-
-int KyraEngine_v3::o3_querySpecialSceneScriptState(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0));
- return _specialSceneScriptState[stackPos(0)];
-}
-
-int KyraEngine_v3::o3_setHiddenItemsEntry(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- return (_hiddenItems[stackPos(0)] = (uint16)stackPos(1));
-}
-
-int KyraEngine_v3::o3_getHiddenItemsEntry(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0));
- return (int16)_hiddenItems[stackPos(0)];
-}
-
-int KyraEngine_v3::o3_setupSceneAnimObject(ScriptState *script) {
- debugC(9, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setupSceneAnimObject(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9),
- stackPos(10), stackPos(11), stackPosString(12));
- musicUpdate(0);
- setupSceneAnimObject(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8),
- stackPos(9), stackPos(10), stackPos(11), stackPosString(12));
- return 0;
-}
-
-int KyraEngine_v3::o3_removeSceneAnimObject(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeSceneAnimObject(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- removeSceneAnimObject(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v3::o3_setVocHigh(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setVocHigh(%p) (%d)", (const void *)script, stackPos(0));
- _vocHigh = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v3::o3_getVocHigh(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getVocHigh(%p) ()", (const void *)script);
- return _vocHigh;
-}
-
-int KyraEngine_v3::o3_dummy(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dummy(%p) ()", (const void *)script);
- return 0;
-}
-
-#pragma mark -
-
-int KyraEngine_v3::o3t_defineNewShapes(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script,
- stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- strcpy(_newShapeFilename, stackPosString(0));
- _newShapeLastEntry = stackPos(1);
- _newShapeWidth = stackPos(2);
- _newShapeHeight = stackPos(3);
- _newShapeXAdd = stackPos(4);
- _newShapeYAdd = stackPos(5);
- return 0;
-}
-
-int KyraEngine_v3::o3t_setCurrentFrame(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- static const uint8 frameTable[] = {
- 0x58, 0xD8, 0xD8, 0x98, 0x78, 0x78, 0xB8, 0xB8
- };
-
- _newShapeAnimFrame = stackPos(0);
- if (_useFrameTable)
- _newShapeAnimFrame += frameTable[_mainCharacter.facing];
-
- _newShapeDelay = stackPos(1);
- _temporaryScriptExecBit = true;
- return 0;
-}
-
-#pragma mark -
-
-int KyraEngine_v3::o3d_updateAnim(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3d_updateAnim(%p) (%d)", (const void *)script, stackPos(0));
- if (_dialogSceneAnim >= 0)
- updateSceneAnim(_dialogSceneAnim, stackPos(0));
- return 0;
-}
-
-int KyraEngine_v3::o3d_delay(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3d_delay(%p) (%d)", (const void *)script, stackPos(0));
- const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength;
- while (_system->getMillis() < endTime) {
- if (_chatText)
- updateWithText();
- else
- update();
- _system->delayMillis(10);
- }
- return 0;
-}
-
-#pragma mark -
-
-typedef Common::Functor1Mem<ScriptState*, int, KyraEngine_v3> OpcodeV3;
-#define SetOpcodeTable(x) table = &x;
-#define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_v3::x))
-#define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0))
-void KyraEngine_v3::setupOpcodeTable() {
- Common::Array<const Opcode*> *table = 0;
-
- SetOpcodeTable(_opcodes);
- // 0x00
- Opcode(o3_getMalcolmShapes);
- Opcode(o3_setCharacterPos);
- Opcode(o3_defineObject);
- Opcode(o3_refreshCharacter);
- // 0x04
- Opcode(o3_getCharacterX);
- Opcode(o3_getCharacterY);
- Opcode(o3_getCharacterFacing);
- Opcode(o3_getCharacterScene);
- // 0x08
- Opcode(o3_getMalcolmsMood);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- // 0x0c
- OpcodeUnImpl();
- Opcode(o3_trySceneChange);
- Opcode(o3_moveCharacter);
- Opcode(o3_setCharacterFacing);
- // 0x10
- OpcodeUnImpl();
- Opcode(o3_showSceneFileMessage);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- // 0x14
- OpcodeUnImpl();
- Opcode(o3_showBadConscience);
- Opcode(o3_dummy);
- Opcode(o3_hideBadConscience);
- // 0x18
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x1c
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_objectChat);
- // 0x20
- Opcode(o3_checkForItem);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- Opcode(o3_defineItem);
- // 0x24
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_npcChatSequence);
- Opcode(o3_queryGameFlag);
- // 0x28
- Opcode(o3_resetGameFlag);
- Opcode(o3_setGameFlag);
- Opcode(o3_setHandItem);
- Opcode(o3_removeHandItem);
- // 0x2c
- Opcode(o3_handItemSet);
- Opcode(o3_hideMouse);
- Opcode(o3_addSpecialExit);
- Opcode(o3_setMousePos);
- // 0x30
- Opcode(o3_showMouse);
- Opcode(o3_badConscienceChat);
- Opcode(o3_wipeDownMouseItem);
- Opcode(o3_dummy);
- // 0x34
- Opcode(o3_setMalcolmsMood);
- OpcodeUnImpl();
- Opcode(o3_dummy);
- Opcode(o3_delay);
- // 0x38
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_setSceneFilename);
- OpcodeUnImpl();
- // 0x3c
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_drawSceneShape);
- // 0x40
- Opcode(o3_checkInRect);
- Opcode(o3_updateConversations);
- OpcodeUnImpl();
- Opcode(o3_dummy);
- // 0x44
- Opcode(o3_dummy);
- Opcode(o3_setSceneDim);
- OpcodeUnImpl();
- Opcode(o3_dummy);
- // 0x48
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- Opcode(o3_update);
- // 0x4c
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x50
- Opcode(o3_enterNewScene);
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_dummy);
- // 0x54
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_setMalcolmPos);
- Opcode(o3_stopMusic);
- // 0x58
- Opcode(o3_playMusicTrack);
- Opcode(o3_playSoundEffect);
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x5c
- Opcode(o3_blockOutRegion);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x60
- Opcode(o3_getRand);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x64
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_dummy);
- OpcodeUnImpl();
- // 0x68
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_waitForConfirmationClick);
- // 0x6c
- Opcode(o3_dummy);
- Opcode(o3_defineRoomEntrance);
- Opcode(o3_runTemporaryScript);
- Opcode(o3_setSpecialSceneScriptRunTime);
- // 0x70
- Opcode(o3_defineSceneAnim);
- Opcode(o3_dummy);
- Opcode(o3_updateSceneAnim);
- Opcode(o3_dummy);
- // 0x74
- Opcode(o3_runActorScript);
- Opcode(o3_runDialog);
- Opcode(o3_malcolmRandomChat);
- Opcode(o3_setDlgIndex);
- // 0x78
- Opcode(o3_getDlgIndex);
- Opcode(o3_defineScene);
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0x7c
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- // 0x80
- Opcode(o3_dummy);
- OpcodeUnImpl();
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- // 0x84
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- // 0x88
- Opcode(o3_countItemInstances);
- Opcode(o3_dummy);
- Opcode(o3_dialogStartScript);
- Opcode(o3_dummy);
- // 0x8c
- Opcode(o3_dialogEndScript);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_setSpecialSceneScriptState);
- // 0x90
- Opcode(o3_clearSpecialSceneScriptState);
- Opcode(o3_querySpecialSceneScriptState);
- Opcode(o3_dummy);
- Opcode(o3_setHiddenItemsEntry);
- // 0x94
- Opcode(o3_getHiddenItemsEntry);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- OpcodeUnImpl();
- // 0x98
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_setupSceneAnimObject);
- Opcode(o3_removeSceneAnimObject);
- // 0x9c
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0xa0
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- Opcode(o3_dummy);
- // 0xa4
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- Opcode(o3_setVocHigh);
- // 0xa8
- Opcode(o3_getVocHigh);
- OpcodeUnImpl();
- OpcodeUnImpl();
- OpcodeUnImpl();
- // 0xac
- OpcodeUnImpl();
- Opcode(o3_dummy);
- OpcodeUnImpl();
- Opcode(o3_dummy);
-
- SetOpcodeTable(_opcodesTemporary);
- // 0x00
- Opcode(o3t_defineNewShapes);
- Opcode(o3t_setCurrentFrame);
- Opcode(o3_playSoundEffect);
- Opcode(o3_dummy);
- // 0x0a
- OpcodeUnImpl();
- Opcode(o3_getRand);
- Opcode(o3_getMalcolmShapes);
- Opcode(o3_dummy);
-
- SetOpcodeTable(_opcodesDialog);
- // 0x00
- Opcode(o3d_updateAnim);
- Opcode(o3d_delay);
- Opcode(o3_getRand);
- Opcode(o3_queryGameFlag);
- // 0x04
- Opcode(o3_dummy);
-}
-
-} // end of namespace Kyra
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
new file mode 100644
index 0000000000..1c74f48990
--- /dev/null
+++ b/engines/kyra/sequences_hof.cpp
@@ -0,0 +1,2782 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra.h"
+#include "kyra/kyra_hof.h"
+#include "kyra/screen.h"
+#include "kyra/wsamovie.h"
+#include "kyra/sound.h"
+#include "kyra/text_hof.h"
+#include "kyra/timer.h"
+#include "kyra/resource.h"
+
+#include "common/system.h"
+
+namespace Kyra {
+
+void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_playSequences(%i, %i)", startSeq, endSeq);
+ seq_init();
+
+ bool allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (startSeq == kSequenceTitle)) ? false : true;
+
+ if (endSeq == -1)
+ endSeq = startSeq;
+
+ assert(startSeq >= 0 && endSeq < kSequenceArraySize && startSeq <= endSeq);
+
+ _sound->setSoundList(&_soundData[(startSeq > kSequenceZanfaun) ? kMusicFinale : kMusicIntro]);
+ _sound->loadSoundFile(0);
+
+ _screen->_charWidth = -2;
+
+ memset(_activeWSA, 0, sizeof(ActiveWSA) * 8);
+ for (int i = 0; i < 8; ++i)
+ _activeWSA[i].flags = -1;
+
+ memset(_activeText, 0, sizeof(ActiveText) * 10);
+ seq_resetAllTextEntries();
+
+ _screen->hideMouse();
+ int oldPage = _screen->setCurPage(2);
+
+ for (int i = 0; i < 4; ++i)
+ memset(_screen->getPalette(i), 0, 0x300);
+
+ _screen->clearPage(10);
+ _screen->clearPage(12);
+
+ _seqSubframePlaying = false;
+
+ _seqWsaCurrentFrame = 0;
+ _seqTextColor[0] = _seqTextColor[1] = 0;
+ _seqEndTime = 0;
+ _menuChoice = 0;
+
+ for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
+ _screen->clearPage(0);
+ _screen->clearPage(8);
+ memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300);
+ _seqFrameCounter = 0;
+ _seqStartTime = _system->getMillis();
+
+ allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (seqNum == kSequenceTitle)) ? false : true;
+
+ Sequence cseq = _sequences->seq[seqNum];
+ SeqProc cb = _callbackS[seqNum];
+
+ if (cseq.flags & 2) {
+ _screen->loadBitmap(cseq.cpsFile, 2, 2, _screen->getPalette(0));
+ _screen->setScreenPalette(_screen->getPalette(0));
+ } else {
+ _screen->setCurPage(2);
+ _screen->clearPage(2);
+ _screen->loadPalette("goldfont.col", _screen->getPalette(0));
+ }
+
+ if (cb && !(_flags.isDemo && !_flags.isTalkie))
+ (this->*cb)(0, 0, 0, -1);
+
+ if (cseq.flags & 1) {
+ _seqWsa->close();
+ _seqWsa->open(cseq.wsaFile, 0, _screen->getPalette(0));
+ _screen->setScreenPalette(_screen->getPalette(0));
+ _seqWsa->setX(cseq.xPos);
+ _seqWsa->setY(cseq.yPos);
+ _seqWsa->setDrawPage(2);
+ _seqWsa->displayFrame(0, 0);
+ }
+
+ if (cseq.flags & 4) {
+ int cp = _screen->setCurPage(2);
+ Screen::FontId cf = _screen->setFont(Screen::FID_GOLDFONT_FNT);
+ if (cseq.stringIndex1 != -1) {
+ int sX = (320 - _screen->getTextWidth(_sequenceStrings[cseq.stringIndex1])) / 2;
+ _screen->printText(_sequenceStrings[cseq.stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0);
+ }
+ if (cseq.stringIndex2 != -1) {
+ int sX = (320 - _screen->getTextWidth(_sequenceStrings[cseq.stringIndex2])) / 2;
+ _screen->printText(_sequenceStrings[cseq.stringIndex2], sX, 100, 1, 0);
+ }
+ _screen->setFont(cf);
+ _screen->setCurPage(cp);
+ }
+
+ _screen->copyPage(2, 12);
+ _screen->copyPage(0, 2);
+ _screen->copyPage(2, 10);
+ _screen->copyPage(12, 2);
+
+ seq_sequenceCommand(cseq.startupCommand);
+
+ if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ }
+
+ if (cseq.flags & 1) {
+ int w2 = _seqWsa->width();
+ int h2 = _seqWsa->height();
+ int x = cseq.xPos;
+ int y = cseq.yPos;
+
+ _seqFrameDelay = cseq.frameDelay;
+
+ if (_seqWsa) {
+ if (x < 0) {
+ x = 0;
+ w2 = 0;
+ }
+
+ if (y < 0) {
+ y = 0;
+ h2 = 0;
+ }
+
+ if (cseq.xPos + _seqWsa->width() > 319)
+ _seqWsa->setWidth(320 - cseq.xPos);
+
+ if (cseq.yPos + _seqWsa->height() > 199)
+ _seqWsa->setHeight(199 - cseq.yPos);
+ }
+ uint8 dir = (cseq.startFrame > cseq.numFrames) ? 0 : 1;
+ _seqWsaCurrentFrame = cseq.startFrame;
+
+ bool loop = true;
+ while (loop && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
+
+ if (_seqWsa || !cb)
+ _screen->copyPage(12, 2);
+
+ if (cb) {
+ int f = _seqWsaCurrentFrame % _seqWsa->frames();
+ (this->*cb)(_seqWsa, cseq.xPos, cseq.yPos, f);
+ }
+
+ if (_seqWsa) {
+ int f = _seqWsaCurrentFrame % _seqWsa->frames();
+ _seqWsa->setX(cseq.xPos);
+ _seqWsa->setY(cseq.yPos);
+ _seqWsa->setDrawPage(2);
+ _seqWsa->displayFrame(f, 0);
+ }
+
+ _screen->copyPage(2, 12);
+
+ seq_processWSAs();
+ seq_processText();
+
+ if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ }
+
+ bool loop2 = true;
+ while (loop2 && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ if (_seqWsa) {
+ seq_processText();
+ if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ }
+
+ uint32 now = _system->getMillis();
+ if (now >= _seqEndTime) {
+ loop2 = false;
+ } else {
+ uint32 tdiff = _seqEndTime - now;
+ uint32 dly = tdiff < _tickLength ? tdiff : _tickLength;
+ delay(dly);
+ }
+ } else {
+ loop = loop2 = false;
+ }
+ }
+
+ if (loop) {
+ if (dir == 1) {
+ if (++_seqWsaCurrentFrame >= cseq.numFrames)
+ loop = false;
+ } else {
+ if (--_seqWsaCurrentFrame < cseq.numFrames)
+ loop = false;
+ }
+ }
+ }
+ _seqWsa->close();
+ } else {
+ _seqFrameDelay = cseq.frameDelay;
+ _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
+ while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ uint32 starttime = _system->getMillis();
+ seq_processWSAs();
+ if (cb)
+ (this->*cb)(0, 0, 0, 0);
+
+ seq_processText();
+
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _screen->copyPage(12, 2);
+
+ uint32 now = _system->getMillis();
+ if (now >= _seqEndTime && !_seqSubframePlaying)
+ break;
+
+ uint32 tdiff = _seqEndTime - starttime;
+ int32 dly = _tickLength - (now - starttime);
+ if (dly > 0)
+ delay(MIN<uint32>(dly, tdiff));
+ }
+ }
+
+ if (cb && !(_flags.isDemo && !_flags.isTalkie))
+ (this->*cb)(0, 0, 0, -2);
+
+ uint32 ct = seq_activeTextsTimeLeft();
+ uint32 dl = cseq.duration * _tickLength;
+ if (dl < ct)
+ dl = ct;
+ _seqEndTime = _system->getMillis() + dl;
+
+ while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ uint32 starttime = _system->getMillis();
+ seq_processWSAs();
+
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _screen->copyPage(12, 2);
+
+ uint32 now = _system->getMillis();
+ if (now >= _seqEndTime && !_seqSubframePlaying) {
+ break;
+ }
+
+ uint32 tdiff = _seqEndTime - starttime;
+ int32 dly = _tickLength - (now - starttime);
+ if (dly > 0)
+ delay(MIN<uint32>(dly, tdiff));
+ }
+
+ seq_sequenceCommand(cseq.finalCommand);
+ seq_resetAllTextEntries();
+
+ if (_flags.isDemo && !_flags.isTalkie) {
+ if (seqNum == kSequenceDemoFisher) {
+ _abortIntroFlag = false;
+ resetSkipFlag();
+ seqNum = kSequenceDemoVirgin;
+ }
+ } else {
+ if ((seqNum != kSequenceTitle && seqNum < kSequenceZanfaun &&
+ (_abortIntroFlag || skipFlag())) || seqNum == kSequenceZanfaun) {
+ _abortIntroFlag = false;
+ _eventList.clear();
+ seqNum = kSequenceWestwood;
+ } else if (seqNum < kSequenceFrash && (_abortIntroFlag || skipFlag())) {
+ _abortIntroFlag = false;
+ _eventList.clear();
+ seqNum = kSequenceFirates;
+ }
+ }
+
+ if (_menuChoice) {
+ _abortIntroFlag = false;
+ _eventList.clear();
+
+ if (_menuChoice == 2) {
+ seqNum = kSequenceTitle;
+ _menuChoice = 0;
+ }
+ }
+ }
+
+ if (!_menuChoice)
+ delay(1000);
+
+ _screen->setCurPage(oldPage);
+ _screen->showMouse();
+
+ for (int i = 0; i < 8; i++)
+ seq_unloadWSA(i);
+
+ _seqWsa->close();
+
+ _screen->_charWidth = 0;
+
+ seq_uninit();
+}
+
+int KyraEngine_HoF::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introWestwood(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
+
+ if (frm == -2) {
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
+ delay(300 * _tickLength);
+ } else if (!frm) {
+ _sound->playTrack(2);
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introTitle(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
+
+ if (frm == 1) {
+ _sound->playTrack(3);
+ } else if (frm == 25) {
+ int cp = _screen->setCurPage(0);
+ _screen->showMouse();
+ _system->updateScreen();
+ _menuChoice = _menu->handle(11) + 1;
+ _seqEndTime = 0;
+ _seqSubframePlaying = false;
+ if (_menuChoice == 4)
+ quitGame();
+
+ _screen->hideMouse();
+ _screen->setCurPage(cp);
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introOverview(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
+
+ uint8 *tmpPal = &(_screen->getPalette(3)[0x101]);
+ memset(tmpPal, 0, 256);
+ uint32 endtime = 0, now = 0;
+
+ switch (_seqFrameCounter) {
+ case 0:
+ _seqSubframePlaying = true;
+ _sound->playTrack(4);
+ endtime = _system->getMillis() + 60 * _tickLength;
+
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
+
+ _screen->setTextColorMap(_seqTextColorMap);
+
+ now = _system->getMillis();
+ if (endtime > now)
+ delay(endtime - now);
+ break;
+
+ case 1:
+ _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x40, 0, 0, 0, 0x100, true);
+ for (int i = 0; i < 256; i++)
+ tmpPal[_screen->getPalette(3)[i]] = 1;
+
+ for (int i = 0; i < 256; i++) {
+ int v = (tmpPal[i] == 1) ? i : _screen->getPalette(3)[i];
+ v *= 3;
+ _screen->getPalette(2)[3 * i] = _screen->getPalette(0)[v];
+ _screen->getPalette(2)[3 * i + 1] = _screen->getPalette(0)[v + 1];
+ _screen->getPalette(2)[3 * i + 2] = _screen->getPalette(0)[v + 2];
+ }
+ break;
+
+ case 40:
+ seq_loadNestedSequence(0, kSequenceOver1);
+ break;
+
+ case 60:
+ seq_loadNestedSequence(1, kSequenceOver2);
+ break;
+
+ case 120:
+ seq_playTalkText(0);
+ break;
+
+ case 200:
+ seq_waitForTextsTimeout();
+ _screen->fadePalette(_screen->getPalette(2), 64);
+ break;
+
+ case 201:
+ _screen->setScreenPalette(_screen->getPalette(2));
+ _screen->updateScreen();
+ _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
+ _screen->copyPage(2, 12);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ _screen->updateScreen();
+ seq_resetActiveWSA(0);
+ seq_resetActiveWSA(1);
+ break;
+
+ case 282:
+ seq_loadNestedSequence(0, kSequenceForest);
+ seq_playTalkText(1);
+ break;
+
+ case 354:
+ case 434:
+ if (!((_seqFrameCounter == 354 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 434 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_resetActiveWSA(0);
+ seq_loadNestedSequence(0, kSequenceDragon);
+ break;
+
+ case 400:
+ case 540:
+ if (!((_seqFrameCounter == 400 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(0);
+ _seqEndTime = 0;
+ _seqSubframePlaying = false;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introLibrary(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
+
+ switch (_seqFrameCounter) {
+ case 0:
+ _seqSubframePlaying = true;
+ _sound->playTrack(5);
+
+ _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
+
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 1:
+ seq_loadNestedSequence(0, kSequenceLibrary3);
+ seq_playTalkText(4);
+ break;
+
+ case 100:
+ seq_waitForTextsTimeout();
+
+ _screen->copyPage(12, 2);
+ _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+ _screen->copyPage(2, 12);
+
+ seq_resetActiveWSA(0);
+ seq_loadNestedSequence(0, kSequenceDarm);
+ break;
+
+ case 104:
+ seq_playTalkText(5);
+ break;
+
+ case 240:
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(0);
+ seq_loadNestedSequence(0, kSequenceLibrary2);
+ break;
+
+ case 340:
+ seq_resetActiveWSA(0);
+ _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
+ _screen->copyPage(2, 12);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+
+ seq_loadNestedSequence(0, kSequenceMarco);
+ seq_playTalkText(6);
+ break;
+
+ case 480:
+ case 660:
+ if (!((_seqFrameCounter == 480 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 660 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ _screen->copyPage(2, 12);
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(0);
+ _seqEndTime = 0;
+ _seqSubframePlaying = false;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+
+int KyraEngine_HoF::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introHand(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
+
+ switch (_seqFrameCounter) {
+ case 0:
+ _seqSubframePlaying = true;
+ _sound->playTrack(6);
+
+ _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
+
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 1:
+ seq_loadNestedSequence(0, kSequenceHand1a);
+ seq_loadNestedSequence(1, kSequenceHand1b);
+ seq_loadNestedSequence(2, kSequenceHand1c);
+ seq_playTalkText(7);
+ break;
+
+ case 201:
+ seq_waitForTextsTimeout();
+ _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
+ _screen->copyPage(2, 12);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+ seq_resetActiveWSA(0);
+ seq_resetActiveWSA(1);
+ seq_resetActiveWSA(2);
+ seq_loadNestedSequence(0, kSequenceHand2);
+ seq_playTalkText(8);
+ break;
+
+ case 260:
+ case 395:
+ if (!((_seqFrameCounter == 260 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 395 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(0);
+ seq_loadNestedSequence(1, kSequenceHand3);
+ seq_playTalkText(9);
+ break;
+
+ case 365:
+ case 500:
+ if (!((_seqFrameCounter == 365 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 500 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(1);
+ seq_loadNestedSequence(0, kSequenceHand4);
+ break;
+
+ case 405:
+ case 540:
+ if (!((_seqFrameCounter == 405 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_playTalkText(10);
+ break;
+
+ case 484:
+ case 630:
+ if (!((_seqFrameCounter == 484 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 630 && _flags.platform == Common::kPlatformPC)))
+ break;
+
+ seq_waitForTextsTimeout();
+ seq_resetActiveWSA(0);
+ _seqEndTime = 0;
+ _seqSubframePlaying = false;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == -2) {
+ seq_waitForTextsTimeout();
+ _seqEndTime = 0;
+ }
+
+ switch (_seqFrameCounter) {
+ case -2:
+ seq_waitForTextsTimeout();
+ break;
+
+ case 0:
+ _sound->playTrack(7);
+
+ _seqTextColor[1] = 0xf7;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
+ break;
+
+ case 1:
+ seq_playTalkText(11);
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == -2) {
+ seq_waitForTextsTimeout();
+ _seqEndTime = 0;
+ return 0;
+ }
+
+ switch (_seqFrameCounter) {
+ case 0:
+ _sound->playTrack(8);
+
+ _seqTextColor[1] = 0xfd;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 1:
+ if (_flags.isTalkie) {
+ seq_playWsaSyncDialogue(21, 13, -1, 140, 70, 160, wsaObj, 0, 8, x, y);
+ } else {
+ seq_setTextEntry(21, 140, 70, 200, 160);
+ _seqFrameDelay = 200;
+ }
+ break;
+
+ case 2:
+ case 11:
+ case 21:
+ if (!_flags.isTalkie)
+ _seqFrameDelay = 12;
+ break;
+
+ case 9:
+ if (_flags.isTalkie)
+ seq_playWsaSyncDialogue(13, 14, -1, 140, (_flags.lang == Common::FR_FRA
+ || _flags.lang == Common::DE_DEU) ? 50 : 70, 160, wsaObj, 9, 15, x, y);
+ break;
+
+ case 10:
+ if (!_flags.isTalkie) {
+ seq_waitForTextsTimeout();
+ seq_setTextEntry(13, 140, 50, _sequenceStringsDuration[13], 160);
+ _seqFrameDelay = 300;
+ }
+ break;
+
+ case 16:
+ if (_flags.isTalkie)
+ seq_playWsaSyncDialogue(18, 15, -1, 140, (_flags.lang == Common::FR_FRA) ? 50 :
+ (_flags.lang == Common::DE_DEU ? 40 : 70), 160, wsaObj, 10, 16, x, y);
+ break;
+
+ case 17:
+ if (_flags.isTalkie)
+ _seqFrameDelay = 12;
+ break;
+
+ case 20:
+ if (!_flags.isTalkie) {
+ seq_waitForTextsTimeout();
+ seq_setTextEntry(18, 160, 50, _sequenceStringsDuration[18], 160);
+ _seqFrameDelay = 200;
+ }
+ break;
+
+ case 26:
+ seq_waitForTextsTimeout();
+ break;
+
+ case 46:
+ if (_flags.isTalkie) {
+ seq_playWsaSyncDialogue(16, 16, -1, 200, 50, 120, wsaObj, 46, 46, x, y);
+ } else {
+ seq_waitForTextsTimeout();
+ seq_setTextEntry(16, 200, 50, _sequenceStringsDuration[16], 120);
+ }
+
+ _seqEndTime = _system->getMillis() + 120 * _tickLength;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 2)
+ seq_waitForTextsTimeout();
+ else if (frm == 3)
+ seq_playTalkText(12);
+ return frm;
+}
+
+
+int KyraEngine_HoF::seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 1)
+ seq_playTalkText(12);
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 11)
+ seq_waitForTextsTimeout();
+ else if (frm == 12)
+ seq_playTalkText(2);
+
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 11)
+ seq_waitForTextsTimeout();
+ else if (frm == 3)
+ seq_playTalkText(3);
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ //NULLSUB (at least in fm-towns version)
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ //NULLSUB (at least in fm-towns version)
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 36) {
+ seq_waitForTextsTimeout();
+ _seqEndTime = 0;
+ }
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ //NULLSUB (at least in fm-towns version)
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 15)
+ frm = 12;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 8)
+ frm = 4;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ //NULLSUB (at least in fm-towns version)
+ return frm;
+}
+
+int KyraEngine_HoF::seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ //NULLSUB (at least in fm-towns version)
+ return frm;
+}
+
+int KyraEngine_HoF::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ int chatFirstFrame = 0;
+ int chatLastFrame = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ seq_sequenceCommand(9);
+ break;
+
+ case 0:
+ _sound->playTrack(3);
+
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(81, 240, 70, _seqTextColorMap, 252);
+ seq_printCreditsString(82, 240, 90, _seqTextColorMap, _seqTextColor[0]);
+ _screen->copyPage(2, 12);
+ delay(endtime - _system->getMillis());
+ seq_playTalkText(_flags.isTalkie ? 28 : 24);
+ _seqTextColor[0] = 1;
+
+ if (_flags.isTalkie) {
+ chatY = (_flags.lang == Common::FR_FRA) ? 70 : 78;
+ chatFirstFrame = 9;
+ chatLastFrame = 15;
+ voiceIndex = 34;
+ } else {
+ chatY = (_flags.lang == Common::FR_FRA) ? 78 : 70;
+ chatFirstFrame = 0;
+ chatLastFrame = 8;
+ }
+ chatX = (_flags.lang == Common::FR_FRA) ? 84 : 88;
+ chatW = 100;
+
+ seq_playWsaSyncDialogue(22, voiceIndex, 187, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ break;
+
+ case 9:
+ case 16:
+ if (!((frm == 9 && !_flags.isTalkie) || (frm == 16 && _flags.isTalkie)))
+ break;
+
+ _seqFrameDelay = 12;
+
+ if (_flags.lang == Common::FR_FRA) {
+ chatX = 80;
+ chatW = 112;
+ } else {
+ chatX = (_flags.lang == Common::DE_DEU) ? 84 : 96;
+ chatW = 100;
+ }
+
+ if (_flags.isTalkie) {
+ chatFirstFrame = 0;
+ chatLastFrame = 8;
+ voiceIndex = 35;
+ } else {
+ chatFirstFrame = 9;
+ chatLastFrame = 15;
+ }
+ chatY = 70;
+
+ seq_playWsaSyncDialogue(23, voiceIndex, 137, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ if (_flags.isTalkie)
+ _seqWsaCurrentFrame = 17;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ int chatFirstFrame = 0;
+ int chatLastFrame = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(34, 240, _flags.isTalkie ? 60 : 40, _seqTextColorMap, 252);
+ seq_printCreditsString(35, 240, _flags.isTalkie ? 70 : 50, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(36, 240, _flags.isTalkie ? 90 : 70, _seqTextColorMap, 252);
+ seq_printCreditsString(37, 240, _flags.isTalkie ? 100 : 90, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(38, 240, _flags.isTalkie ? 120 : 110, _seqTextColorMap, 252);
+ seq_printCreditsString(39, 240, _flags.isTalkie ? 130 : 120, _seqTextColorMap, _seqTextColor[0]);
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
+ seq_printCreditsString(103, 240, 130, _seqTextColorMap, _seqTextColor[0]);
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 255;
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 5:
+ if (!_flags.isTalkie)
+ seq_playTalkText(18);
+ _seqFrameDelay = 16;
+
+ if (_flags.isTalkie) {
+ chatFirstFrame = 5;
+ chatLastFrame = 8;
+ voiceIndex = 22;
+ } else {
+ chatLastFrame = 14;
+ }
+ chatX = 116;
+ chatY = 90;
+ chatW = 60;
+
+ seq_playWsaSyncDialogue(24, voiceIndex, 149, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ break;
+
+ case 11:
+ if (_flags.isTalkie)
+ seq_playWsaSyncDialogue(24, 22, 149, 116, 90, 60, wsaObj, 11, 14, x, y);
+ break;
+
+ case 16:
+ seq_playTalkText(_flags.isTalkie ? 23 : 19);
+ _seqFrameDelay = _flags.isTalkie ? 20 : 16;
+
+ if (_flags.lang == Common::FR_FRA) {
+ chatY = 48;
+ chatW = 88;
+ } else {
+ chatY = 60;
+ chatW = 100;
+ }
+ chatX = 60;
+
+ if (_flags.isTalkie)
+ voiceIndex = 36;
+
+ seq_playWsaSyncDialogue(25, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 16, 25, x, y);
+ _seqFrameDelay = 16;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+
+ seq_printCreditsString(40, 240, _flags.isTalkie ? 55 : 40, _seqTextColorMap, 252);
+ seq_printCreditsString(41, 240, _flags.isTalkie ? 65 : 50, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(42, 240, _flags.isTalkie ? 75 : 60, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(43, 240, _flags.isTalkie ? 95 : 80, _seqTextColorMap, 252);
+ seq_printCreditsString(44, 240, _flags.isTalkie ? 105 : 90, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(93, 240, _flags.isTalkie ? 125 : 110, _seqTextColorMap, 252);
+ seq_printCreditsString(94, 240, _flags.isTalkie ? 135 : 120, _seqTextColorMap, _seqTextColor[0]);
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 4:
+ chatX = 94;
+ chatY = 42;
+ chatW = 100;
+ if (_flags.isTalkie)
+ voiceIndex = 37;
+ seq_playWsaSyncDialogue(26, voiceIndex, 149, chatX, chatY, chatW, wsaObj, 3, 12, x, y);
+ break;
+
+ case 14:
+ seq_playTalkText(_flags.isTalkie ? 19 : 15);
+ break;
+
+ case 23:
+ seq_playTalkText(_flags.isTalkie ? 20 : 16);
+ break;
+
+ case 29:
+ chatX = (_flags.lang == Common::DE_DEU) ? 82 : ((_flags.lang == Common::FR_FRA) ? 92 : 88);
+ chatY = 40;
+ chatW = 100;
+
+ if (_flags.isTalkie) {
+ if (_flags.lang == Common::DE_DEU)
+ chatY = 35;
+ voiceIndex = 38;
+ }
+
+ seq_playWsaSyncDialogue(27, voiceIndex, 187, chatX, chatY, chatW, wsaObj, 28, 34, x, y);
+ break;
+
+ case 45:
+ seq_playTalkText(_flags.isTalkie ? 21 : 17);
+ break;
+
+ case 50:
+ seq_playTalkText(_flags.isTalkie ? 29 : 25);
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ int chatFirstFrame = 0;
+ int chatLastFrame = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ _screen->copyPage(12, 2);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(49, 240, 20, _seqTextColorMap, 252);
+ seq_printCreditsString(50, 240, 30, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(51, 240, 40, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(52, 240, 50, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(53, 240, 60, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(54, 240, 70, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(55, 240, 80, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(56, 240, 90, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(57, 240, 100, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(58, 240, 110, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(60, 240, 120, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(61, 240, 130, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(62, 240, 140, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(63, 240, 150, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(64, 240, 160, _seqTextColorMap, _seqTextColor[0]);
+
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 2:
+ seq_playTalkText(_flags.isTalkie ? 25 : 21);
+
+ if (_flags.lang == Common::FR_FRA) {
+ chatX = 92;
+ chatY = 72;
+ } else {
+ chatX = (_flags.lang == Common::DE_DEU) ? 90 : 98;
+ chatY = 84;
+ }
+
+ if (_flags.isTalkie) {
+ chatFirstFrame = 8;
+ chatLastFrame = 9;
+ voiceIndex = 39;
+ } else {
+ chatFirstFrame = 2;
+ chatLastFrame = -8;
+ }
+ chatW = 100;
+
+ seq_playWsaSyncDialogue(28, voiceIndex, -1, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ if (_flags.isTalkie)
+ _seqWsaCurrentFrame = 4;
+ break;
+
+ case 9:
+ seq_playTalkText(_flags.isTalkie ? 24 : 20);
+ _seqFrameDelay = 100;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ _screen->copyPage(12, 2);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(45, 240, 40, _seqTextColorMap, 252);
+ seq_printCreditsString(46, 240, 50, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(47, 240, 60, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(83, 240, 80, _seqTextColorMap, 252);
+ seq_printCreditsString(48, 240, 90, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(65, 240, 110, _seqTextColorMap, 252);
+ seq_printCreditsString(66, 240, 120, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(67, 240, 130, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(68, 240, 140, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(69, 240, 150, _seqTextColorMap, _seqTextColor[0]);
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
+ seq_printCreditsString(104, 240, 160, _seqTextColorMap, _seqTextColor[0]);
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ _seqTextColor[1] = 1 + (_screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 254) & 0xff);
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColorMap[1] = _seqTextColor[0] = 1 + (_screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 254) & 0xff);
+ _screen->setTextColorMap(_seqTextColorMap);
+ seq_playTalkText(_flags.isTalkie ? 30 : 26);
+ break;
+
+ case 6:
+ if (_flags.isTalkie)
+ seq_playTalkText(18);
+ break;
+
+ case 12:
+ if (!_flags.isTalkie)
+ seq_playTalkText(14);
+
+ chatX = 90;
+ chatY = 30;
+ chatW = 100;
+
+ if (_flags.isTalkie) {
+ if (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) {
+ chatX = 75;
+ chatY = 25;
+ }
+ voiceIndex = 40;
+ }
+
+ seq_playWsaSyncDialogue(29, voiceIndex, 150, chatX, chatY, chatW, wsaObj, 12, -21, x, y);
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ int chatFirstFrame = 0;
+ int chatLastFrame = 0;
+ int textCol = 0;
+
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(70, 240, 20, _seqTextColorMap, 252);
+ seq_printCreditsString(71, 240, 30, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(72, 240, 40, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(73, 240, 50, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(74, 240, 60, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(75, 240, 70, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(101, 240, 80, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(102, 240, 90, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(87, 240, 100, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(88, 240, 110, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(89, 240, 120, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(90, 240, 130, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(91, 240, 140, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(92, 240, 150, _seqTextColorMap, _seqTextColor[0]);
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ for (int i = 0; i < 0x300; i++)
+ _screen->getPalette(0)[i] &= 0x3f;
+ _seqTextColor[1] = 0xCf;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xfe;
+
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 6:
+ _seqFrameDelay = 20;
+
+ if (_flags.isTalkie) {
+ chatX = 82;
+ textCol = 143;
+ chatFirstFrame = 16;
+ chatLastFrame = 21;
+ voiceIndex = 41;
+ } else {
+ chatX = 62;
+ textCol = 137;
+ chatFirstFrame = 9;
+ chatLastFrame = 13;
+ }
+ chatY = (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) ? 88 :100;
+ chatW = 80;
+
+ seq_playWsaSyncDialogue(30, voiceIndex, 137, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ if (_flags.isTalkie)
+ _seqWsaCurrentFrame = 8;
+ break;
+
+ case 9:
+ case 16:
+ if (_flags.isTalkie) {
+ if (frm == 16)
+ break;
+ chatX = 64;
+ textCol = 137;
+ chatFirstFrame = 9;
+ chatLastFrame = 13;
+ voiceIndex = 42;
+ } else {
+ if (frm == 9)
+ break;
+ chatX = 80;
+ textCol = 143;
+ chatFirstFrame = 16;
+ chatLastFrame = 21;
+ }
+ chatY = 100;
+ chatW = 100;
+
+ seq_playWsaSyncDialogue(31, voiceIndex, 143, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
+ if (_flags.isTalkie)
+ _seqWsaCurrentFrame = 21;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ uint32 endtime = 0;
+ int chatX = 0;
+ int chatY = 0;
+ int chatW = 0;
+ uint16 voiceIndex = 0;
+
+ switch (frm) {
+ case -2:
+ _screen->copyPage(12, 2);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ seq_sequenceCommand(9);
+ endtime = _system->getMillis() + 480 * _tickLength;
+ seq_printCreditsString(76, 240, 40, _seqTextColorMap, 252);
+ seq_printCreditsString(77, 240, 50, _seqTextColorMap, 252);
+ seq_printCreditsString(78, 240, 60, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(79, 240, 70, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(80, 240, 80, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(84, 240, 100, _seqTextColorMap, 252);
+ seq_printCreditsString(85, 240, 110, _seqTextColorMap, _seqTextColor[0]);
+ seq_printCreditsString(99, 240, 130, _seqTextColorMap, 252);
+ seq_printCreditsString(100, 240, 140, _seqTextColorMap, _seqTextColor[0]);
+ delay(endtime - _system->getMillis());
+ _seqEndTime = 0;
+ break;
+
+ case 0:
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ break;
+
+ case 6:
+ seq_playTalkText(_flags.isTalkie ? 31 : 27);
+ break;
+
+ case 14:
+ case 15:
+ if (!((frm == 15 && !_flags.isTalkie) || (frm == 14 && _flags.isTalkie)))
+ break;
+
+ seq_playTalkText(_flags.isTalkie ? 31 : 27);
+
+ if (_flags.lang == Common::DE_DEU) {
+ chatX = 82;
+ chatY = 84;
+ chatW = 140;
+ } else {
+ chatX = 74;
+ chatY = (_flags.lang == Common::FR_FRA) ? 96: 108;
+ chatW = 80;
+ }
+
+ if (_flags.isTalkie)
+ voiceIndex = 43;
+
+ seq_playWsaSyncDialogue(32, voiceIndex, 137, chatX, chatY, chatW, wsaObj, 14, 16, x, y);
+ break;
+
+ case 28:
+ seq_playTalkText(_flags.isTalkie ? 32 : 28);
+ break;
+
+ case 29:
+ seq_playTalkText(_flags.isTalkie ? 33 : 29);
+ break;
+
+ case 31:
+ if (_flags.isTalkie)
+ voiceIndex = 44;
+
+ chatX = 90;
+ chatY = (_flags.lang == Common::DE_DEU) ? 60 : 76;
+ chatW = 80;
+
+ seq_playWsaSyncDialogue(33, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 31, 34, x, y);
+ break;
+
+ case 35:
+ _seqFrameDelay = 300;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ int tmp = 0;
+
+ switch (frm) {
+ case -2:
+ _screen->setCurPage(2);
+ _screen->clearCurPage();
+ _screen->copyPage(2, 12);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _seqFrameCounter = 0;
+ seq_loadNestedSequence(0, kSequenceFiggle);
+ break;
+
+ case -1:
+ if (_flags.isTalkie)
+ seq_finaleActorScreen();
+ _seqSpecialFlag = _flags.isTalkie;
+ break;
+
+ case 0:
+ if (_seqFrameCounter == 1) {
+ _sound->playTrack(4);
+ _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
+ memset(_seqTextColorMap, _seqTextColor[1], 16);
+ _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
+ _screen->setTextColorMap(_seqTextColorMap);
+ }
+ _seqFrameDelay = 10;
+ break;
+
+ case 1:
+ if (_seqFrameCounter < 20 && _seqSpecialFlag) {
+ _seqWsaCurrentFrame = 0;
+ } else {
+ _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
+ seq_playTalkText(_flags.isTalkie ? 26 : 22);
+ if (_seqSpecialFlag) {
+ _seqFrameCounter = 3;
+ _seqSpecialFlag = false;
+ }
+ }
+ break;
+
+ case 2:
+ _seqFrameDelay = 20;
+ break;
+
+ case 3:
+ seq_playTalkText(_flags.isTalkie ? 27 : 23);
+ _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
+ break;
+
+ case 4:
+ _seqFrameDelay = 10;
+ break;
+
+ case 5:
+ seq_playTalkText(_flags.isTalkie ? 27 : 23);
+ tmp = _seqFrameCounter / 6;
+ if (tmp == 2)
+ _seqFrameDelay = _flags.isTalkie ? 7 : (1 + _rnd.getRandomNumberRng(1, 10));
+ else if (tmp < 2)
+ _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
+ break;
+
+ case 6:
+ _seqFrameDelay = 10;
+ tmp = _seqFrameCounter / 6;
+ if (tmp == 2)
+ _seqWsaCurrentFrame = 4;
+ else if (tmp < 2)
+ _seqWsaCurrentFrame = 0;
+ break;
+
+ case 7:
+ _seqFrameCounter = 0;
+ _seqFrameDelay = 5;
+ seq_playTalkText(_flags.isTalkie ? 26 : 22);
+ break;
+
+ case 11:
+ if (_seqFrameCounter < 8)
+ _seqWsaCurrentFrame = 8;
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+void KyraEngine_HoF::seq_finaleActorScreen() {
+ static const uint8 colormap[] = {0, 0, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ static const ScreenDim d = { 0x00, 0x0C, 0x28, 0xB4, 0xFF, 0x00, 0x00, 0x00 };
+
+ _screen->loadBitmap("finale.cps", 3, 3, _screen->_currentPalette);
+ _screen->setFont(Screen::FID_GOLDFONT_FNT);
+
+ int talkieCreditsSize, talkieCreditsSpecialSize;
+ const uint8 *talkieCredits = _staticres->loadRawData(k2SeqplayCredits, talkieCreditsSize);
+ const char *const *talkieCreditsSpecial = _staticres->loadStrings(k2SeqplayCreditsSpecial, talkieCreditsSpecialSize);
+
+ _sound->setSoundList(&_soundData[kMusicIngame]);
+ _sound->loadSoundFile(3);
+ _sound->playTrack(3);
+
+ _screen->setTextColorMap(colormap);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+ _screen->fadeFromBlack();
+
+ _screen->_charWidth = -2;
+ uint8 *dataPtr = new uint8[0xafd];
+ memcpy(dataPtr, talkieCredits, talkieCreditsSize);
+ _staticres->unloadId(k2SeqplayCredits);
+
+ seq_displayScrollText(dataPtr, &d, 2, 6, 5, 1, Screen::FID_GOLDFONT_FNT, Screen::FID_GOLDFONT_FNT, 0, talkieCreditsSpecial);
+ delay(120);
+
+ delete [] dataPtr;
+ _staticres->unloadId(k2SeqplayCreditsSpecial);
+ _sound->setSoundList(&_soundData[kMusicFinale]);
+ _sound->loadSoundFile(0);
+}
+
+int KyraEngine_HoF::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (_seqFrameCounter == 10)
+ _seqEndTime = 0;
+ if (_seqFrameCounter == 10 || _seqFrameCounter == 5 || _seqFrameCounter == 7)
+ seq_playTalkText(_flags.isTalkie ? 45 : 30);
+
+ _seqFrameCounter++;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (!frm)
+ delay(50 * _tickLength);
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (!frm)
+ _sound->playTrack(2);
+ return 0;
+}
+int KyraEngine_HoF::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (!frm) {
+ _sound->playTrack(3);
+ } else if (frm == 25) {
+ delay(60 * _tickLength);
+ _seqEndTime = 0;
+ seq_sequenceCommand(0);
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (!frm) {
+ _sound->playTrack(4);
+ } else if (frm == 25) {
+ seq_loadNestedSequence(0, kSequenceDemoWater);
+ _seqFrameDelay--;
+ } else if (frm > 25 && frm < 50) {
+ if (_seqFrameDelay > 3)
+ _seqFrameDelay--;
+ } else if (frm == 95) {
+ _seqFrameDelay = 70;
+ } else if (frm == 96) {
+ _seqFrameDelay = 7;
+ } else if (frm == 129) {
+ seq_resetActiveWSA(0);
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ switch (frm) {
+ case 12:
+ seq_playTalkText(4);
+ break;
+
+ case 32:
+ seq_playTalkText(7);
+ break;
+
+ case 36:
+ seq_playTalkText(10);
+ break;
+
+ case 57:
+ seq_playTalkText(9);
+ break;
+
+ case 80:
+ case 96:
+ case 149:
+ _seqFrameDelay = 70;
+ break;
+
+ case 81:
+ case 97:
+ _seqFrameDelay = 5;
+ break;
+
+ case 110:
+ seq_playTalkText(5);
+ break;
+
+ case 137:
+ seq_playTalkText(6);
+ break;
+ }
+
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (!_seqFrameCounter)
+ seq_loadNestedSequence(0, kSequenceDemoWharf2);
+
+ switch (frm) {
+ case 0:
+ seq_playTalkText(11);
+ break;
+
+ case 5:
+ if ((_seqFrameCounter / 8) <= 2 || _activeWSA[0].flags != -1)
+ _seqWsaCurrentFrame = 0;
+ else
+ seq_resetActiveWSA(0);
+ break;
+
+ case 6:
+ seq_resetActiveWSA(0);
+ break;
+
+ case 8:
+ case 10:
+ seq_playTalkText(2);
+ break;
+
+ case 13:
+ seq_playTalkText(7);
+ break;
+
+ case 16:
+ seq_playTalkText(12);
+ break;
+
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 0) {
+ if (!(_seqFrameCounter/8)) {
+ seq_loadNestedSequence(0, kSequenceDemoDinob2);
+ _seqWsaCurrentFrame = 0;
+ }
+ } else if (frm == 3) {
+ if (_activeWSA[0].flags != -1) {
+ _seqWsaCurrentFrame = 0;
+ } else {
+ seq_resetActiveWSA(0);
+ _screen->copyPage(2, 12);
+ }
+ } else if (frm == 4) {
+ seq_resetActiveWSA(0);
+ }
+
+ _seqFrameCounter++;
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (((_system->getMillis() - _seqStartTime) / (5 * _tickLength)) > 0) {
+ _seqStartTime = _system->getMillis();
+ if (!_seqFrameCounter) {
+ seq_loadNestedSequence(0, kSequenceDemoBail);
+ seq_loadNestedSequence(1, kSequenceDemoDig);
+ }
+
+ if (_seqScrollTextCounter >= 0x18f && !_seqFrameCounter)
+ return 0;
+
+ if (!_seqFrameCounter) {
+ _screen->loadBitmap("adtext.cps", 4, 4, 0);
+ _screen->loadBitmap("adtext2.cps", 6, 6, 0);
+ _screen->copyPageMemory(6, 0, 4, 64000, 1024);
+ _screen->copyPageMemory(6, 1023, 6, 0, 64000);
+ _seqScrollTextCounter = 0;
+ }
+
+ seq_scrollPage();
+ _seqFrameCounter++;
+ if (_seqFrameCounter < 0x256 || _seqFrameCounter > 0x31c) {
+ if (_seqFrameCounter < 0x174 || _seqFrameCounter > 0x1d7) {
+ if (_seqFrameCounter < 0x84 || _seqFrameCounter > 0xe7) {
+ _seqScrollTextCounter++;
+ }
+ }
+ }
+
+ if (_seqFrameCounter > 0x31e) {
+ seq_resetActiveWSA(0);
+ seq_resetActiveWSA(1);
+ _seqEndTime = 0;
+ _screen->copyPage(2, 12);
+ }
+
+ } else {
+ seq_scrollPage();
+ }
+ return 0;
+}
+
+int KyraEngine_HoF::seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 69)
+ _seqWsaCurrentFrame = 8;
+
+ return frm;
+}
+
+int KyraEngine_HoF::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ switch (frm) {
+ case 19:
+ seq_playTalkText(13);
+ break;
+
+ case 54:
+ seq_playTalkText(15);
+ break;
+
+ case 61:
+ seq_playTalkText(16);
+ break;
+
+ case 69:
+ seq_playTalkText(14);
+ break;
+
+ case 77:
+ seq_playTalkText(13);
+ break;
+
+ case 79:
+ _seqWsaCurrentFrame = 4;
+ break;
+ }
+
+ return frm;
+}
+
+int KyraEngine_HoF::seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ if (frm == 1)
+ seq_playTalkText(11);
+ return frm;
+}
+
+int KyraEngine_HoF::seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ return frm;
+}
+
+int KyraEngine_HoF::seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+ return frm;
+}
+
+uint32 KyraEngine_HoF::seq_activeTextsTimeLeft() {
+ uint32 res = 0;
+
+ for (int i = 0; i < 10; i++) {
+ uint32 chatend = (_activeText[i].duration + _activeText[i].startTime);
+ uint32 curtime = _system->getMillis();
+ if (_activeText[i].duration != -1 && chatend > curtime) {
+ chatend -= curtime;
+ if (res < chatend)
+ res = chatend;
+ }
+ }
+
+ return res;
+}
+
+void KyraEngine_HoF::seq_processWSAs() {
+ for (int i = 0; i < 8; i++) {
+ if (_activeWSA[i].flags != -1) {
+ if (seq_processNextSubFrame(i))
+ seq_resetActiveWSA(i);
+ }
+ }
+}
+
+void KyraEngine_HoF::seq_processText() {
+ Screen::FontId curFont = _screen->setFont(Screen::FID_GOLDFONT_FNT);
+ int curPage = _screen->setCurPage(2);
+ char outputStr[70];
+
+ for (int i = 0; i < 10; i++) {
+ if (_activeText[i].startTime + _activeText[i].duration > _system->getMillis() && _activeText[i].duration != -1) {
+
+ char *srcStr = seq_preprocessString(_sequenceStrings[_activeText[i].strIndex], _activeText[i].width);
+ int yPos = _activeText[i].y;
+
+ while (*srcStr) {
+ uint32 linePos = 0;
+ for (; *srcStr; linePos++) {
+ if (*srcStr == 0x0d) // Carriage return
+ break;
+ outputStr[linePos] = *srcStr;
+ srcStr++;
+ }
+ outputStr[linePos] = 0;
+ if (*srcStr == 0x0d)
+ srcStr++;
+
+ uint8 textColor = (_activeText[i].textcolor >= 0) ? _activeText[i].textcolor : _seqTextColor[0];
+ _screen->printText(outputStr, _activeText[i].x - (_screen->getTextWidth(outputStr) / 2), yPos, textColor, 0);
+ yPos += 10;
+ }
+ } else {
+ _activeText[i].duration = -1;
+ }
+ }
+
+ _screen->setCurPage(curPage);
+ _screen->setFont(curFont);
+}
+
+char *KyraEngine_HoF::seq_preprocessString(const char *srcStr, int width) {
+ char *dstStr = _seqProcessedString;
+ int lineStart = 0;
+ int linePos = 0;
+
+ while (*srcStr) {
+ while (*srcStr && *srcStr != 0x20) // Space
+ dstStr[lineStart + linePos++] = *srcStr++;
+ dstStr[lineStart + linePos] = 0;
+
+ int len = _screen->getTextWidth(&dstStr[lineStart]);
+ if (width >= len && *srcStr) {
+ dstStr[lineStart + linePos++] = *srcStr++;
+ } else {
+ dstStr[lineStart + linePos] = 0x0d; // Carriage return
+ lineStart += linePos + 1;
+ linePos = 0;
+ if (*srcStr)
+ srcStr++;
+ }
+ }
+ dstStr[lineStart + linePos] = 0;
+
+ return strlen(_seqProcessedString) ? dstStr : 0;
+}
+
+void KyraEngine_HoF::seq_sequenceCommand(int command) {
+ uint8 pal[768];
+
+ for (int i = 0; i < 8; i++)
+ seq_resetActiveWSA(i);
+
+ switch (command) {
+ case 0:
+ memset(pal, 0, 0x300);
+ _screen->fadePalette(pal, 16);
+ memcpy (_screen->getPalette(0), pal, 0x300);
+ memcpy (_screen->getPalette(1), pal, 0x300);
+ break;
+
+ case 1:
+ memset(pal, 0x3F, 0x300);
+ //////////XXX
+ //////////Unused anyway (at least by fm-towns intro/outro)
+
+ _screen->fadePalette(pal, 16);
+ memcpy (_screen->getPalette(0), pal, 0x300);
+ memcpy (_screen->getPalette(1), pal, 0x300);
+ break;
+
+ case 3:
+ _screen->copyPage(2, 0);
+ _screen->fadePalette(_screen->getPalette(0), 16);
+ memcpy (_screen->getPalette(1), _screen->getPalette(0), 0x300);
+ break;
+
+ case 4:
+ _screen->copyPage(2, 0);
+ _screen->fadePalette(_screen->getPalette(0), 36);
+ memcpy (_screen->getPalette(1), _screen->getPalette(0), 0x300);
+ break;
+
+ case 5:
+ _screen->copyPage(2, 0);
+ break;
+
+ case 6:
+ // UNUSED
+ // seq_loadBLD("library.bld");
+ break;
+
+ case 7:
+ // UNUSED
+ // seq_loadBLD("marco.bld");
+ break;
+
+ case 8:
+ memset(pal, 0, 0x300);
+ _screen->fadePalette(pal, 16);
+ memcpy (_screen->getPalette(0), pal, 0x300);
+ memcpy (_screen->getPalette(1), pal, 0x300);
+
+ delay(120 * _tickLength);
+ break;
+
+ case 9:
+ for (int i = 0; i < 0x100; i++) {
+ int pv = (_screen->getPalette(0)[3 * i] + _screen->getPalette(0)[3 * i + 1] + _screen->getPalette(0)[3 * i + 2]) / 3;
+ pal[3 * i] = pal[3 * i + 1] = pal[3 * i + 2] = pv & 0xff;
+ }
+
+ //int a = 0x100;
+ //int d = (0x800 << 5) - 0x100;
+ //pal[3 * i] = pal[3 * i + 1] = pal[3 * i + 2] = 0x3f;
+
+ _screen->fadePalette(pal, 64);
+ memcpy (_screen->getPalette(0), pal, 0x300);
+ memcpy (_screen->getPalette(1), pal, 0x300);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void KyraEngine_HoF::seq_cmpFadeFrame(const char *cmpFile) {
+ _screen->copyPage(10, 2);
+ _screen->copyPage(4, 10);
+ _screen->clearPage(6);
+ _screen->loadBitmap(cmpFile, 6, 6, 0);
+ _screen->copyPage(12, 4);
+
+ for (int i = 0; i < 3; i++) {
+ uint32 endtime = _system->getMillis() + 4 * _tickLength;
+ _screen->cmpFadeFrameStep(4, 320, 200, 0, 0, 2, 320, 200, 0, 0, 320, 200, 6);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+ _screen->updateScreen();
+ delayUntil(endtime);
+ }
+
+ _screen->copyPage(4, 0);
+ _screen->updateScreen();
+ _screen->copyPage(4, 2);
+ _screen->copyPage(4, 6);
+ _screen->copyPage(10, 4);
+}
+
+void KyraEngine_HoF::seq_playTalkText(uint8 chatNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_playTalkText(%i)", chatNum);
+
+ assert(chatNum < _sequenceSoundListSize);
+
+ if (chatNum < 12 && !_flags.isDemo && textEnabled())
+ seq_setTextEntry(chatNum, 160, 168, _sequenceStringsDuration[chatNum], 160);
+
+ _speechFile = _sequenceSoundList[chatNum];
+ _sound->voicePlay(_sequenceSoundList[chatNum]);
+}
+
+void KyraEngine_HoF::seq_waitForTextsTimeout() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_waitForTextsTimeout()");
+
+ uint32 longest = seq_activeTextsTimeLeft() + _system->getMillis();
+ uint32 now = _system->getMillis();
+
+ if (textEnabled()) {
+ if (longest > now)
+ delay(longest - now);
+ } else if (speechEnabled()) {
+ while (snd_voiceIsPlaying())
+ delay(_tickLength);
+ }
+
+ seq_resetAllTextEntries();
+}
+
+void KyraEngine_HoF::seq_resetAllTextEntries() {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_resetAllTextEntries()");
+ for (int i = 0; i < 10; i++)
+ _activeText[i].duration = -1;
+}
+
+int KyraEngine_HoF::seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_setTextEntry(%i, %i, %i, %i, %i)", strIndex, posX, posY, duration, width);
+
+ for (int i = 0; i < 10; i++) {
+ if (_activeText[i].duration != -1) {
+ if (i < 9)
+ continue;
+ else
+ return -1;
+ }
+
+ _activeText[i].strIndex = strIndex;
+ _activeText[i].x = posX;
+ _activeText[i].y = posY;
+ _activeText[i].duration = duration * _tickLength;
+ _activeText[i].width = width;
+ _activeText[i].startTime = _system->getMillis();
+ _activeText[i].textcolor = -1;
+
+ return i;
+ }
+ return -1;
+}
+
+void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_loadNestedSequence(%i, %i)", wsaNum, seqNum);
+
+ if (_activeWSA[wsaNum].flags != -1)
+ return;
+
+ NestedSequence s = _sequences->seqn[seqNum];
+
+ if (!_activeWSA[wsaNum].movie) {
+ _activeWSA[wsaNum].movie = new WSAMovieV2(this, _screen);
+ assert(_activeWSA[wsaNum].movie);
+ }
+
+ _activeWSA[wsaNum].movie->close();
+
+ _activeWSA[wsaNum].movie->open(s.wsaFile, 0, 0);
+
+ if (!_activeWSA[wsaNum].movie->opened()) {
+ delete _activeWSA[wsaNum].movie;
+ _activeWSA[wsaNum].movie = 0;
+ return;
+ }
+
+ _activeWSA[wsaNum].endFrame = s.endFrame;
+ _activeWSA[wsaNum].startFrame = _activeWSA[wsaNum].currentFrame = s.startframe;
+ _activeWSA[wsaNum].frameDelay = s.frameDelay;
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ _activeWSA[wsaNum].movie->setDrawPage(_screen->_curPage);
+ _activeWSA[wsaNum].callback = _callbackN[seqNum];
+ _activeWSA[wsaNum].control = s.wsaControl;
+
+ _activeWSA[wsaNum].flags = s.flags | 1;
+ _activeWSA[wsaNum].x = s.x;
+ _activeWSA[wsaNum].y = s.y;
+ _activeWSA[wsaNum].startupCommand = s.startupCommand;
+ _activeWSA[wsaNum].finalCommand = s.finalCommand;
+ _activeWSA[wsaNum].lastFrame = 0xffff;
+
+ seq_nestedSequenceFrame(s.startupCommand, wsaNum);
+
+ if (!s.startupCommand)
+ seq_processNextSubFrame(wsaNum);
+
+ _activeWSA[wsaNum].nextFrame = _system->getMillis();
+}
+
+void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
+ int xa = 0, ya = 0;
+ command--;
+ if (!_activeWSA[wsaNum].movie || skipFlag() || _quitFlag || _abortIntroFlag)
+ return;
+
+ switch (command) {
+ case 0:
+ _activeWSA[wsaNum].movie->setDrawPage(8);
+ xa = -_activeWSA[wsaNum].movie->xAdd();
+ ya = -_activeWSA[wsaNum].movie->yAdd();
+ _activeWSA[wsaNum].movie->setX(xa);
+ _activeWSA[wsaNum].movie->setY(ya);
+ _activeWSA[wsaNum].movie->displayFrame(0, 0);
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
+ _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 2);
+ break;
+
+ case 1:
+ _activeWSA[wsaNum].movie->setDrawPage(8);
+ xa = -_activeWSA[wsaNum].movie->xAdd();
+ ya = -_activeWSA[wsaNum].movie->yAdd();
+ _activeWSA[wsaNum].movie->setX(xa);
+ _activeWSA[wsaNum].movie->setY(ya);
+ _activeWSA[wsaNum].movie->displayFrame(0, 0);
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
+ _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 1);
+ break;
+
+ case 2:
+ seq_waitForTextsTimeout();
+ _activeWSA[wsaNum].movie->setDrawPage(8);
+ xa = -_activeWSA[wsaNum].movie->xAdd();
+ ya = -_activeWSA[wsaNum].movie->yAdd();
+ _activeWSA[wsaNum].movie->setX(xa);
+ _activeWSA[wsaNum].movie->setY(ya);
+ _activeWSA[wsaNum].movie->displayFrame(0x15, 0);
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
+ _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 0, 2);
+ break;
+
+ case 3:
+ _screen->copyPage(2, 10);
+ _activeWSA[wsaNum].movie->setDrawPage(2);
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 0);
+ _screen->copyPage(2, 12);
+ seq_cmpFadeFrame("scene2.cmp");
+ break;
+
+ case 4:
+ _screen->copyPage(2, 10);
+ _activeWSA[wsaNum].movie->setDrawPage(2);
+ _activeWSA[wsaNum].movie->setX(0);
+ _activeWSA[wsaNum].movie->setY(0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 0);
+ _screen->copyPage(2, 12);
+ seq_cmpFadeFrame("scene3.cmp");
+ break;
+
+ default:
+ break;
+ }
+}
+
+void KyraEngine_HoF::seq_animatedSubFrame(int srcPage, int dstPage, int delaytime, int steps,
+ int x, int y, int w, int h, int openClose, int directionFlags) {
+ if (openClose) {
+ for (int i = 1; i < steps; i++) {
+ uint32 endtime = _system->getMillis() + delaytime * _tickLength;
+
+ int w2 = (((w * 256) / steps) * i) / 256;
+ int h2 = (((h * 256) / steps) * i) / 256;
+
+ int ym = (directionFlags & 2) ? (h - h2) : 0;
+ int xm = (directionFlags & 1) ? (w - w2) : 0;
+
+ _screen->wsaFrameAnimationStep(0, 0, x + xm, y + ym, w, h, w2, h2, srcPage, dstPage, 0);
+
+ _screen->copyPage(dstPage, 6);
+ _screen->copyPage(dstPage, 0);
+ _screen->updateScreen();
+
+ _screen->copyPage(12, dstPage);
+ delayUntil(endtime);
+ }
+
+ _screen->wsaFrameAnimationStep(0, 0, x, y, w, h, w, h, srcPage, dstPage, 0);
+ _screen->copyPage(dstPage, 6);
+ _screen->copyPage(dstPage, 0);
+ _screen->updateScreen();
+ } else {
+ _screen->copyPage(12, dstPage);
+ for (int i = steps; i; i--) {
+ uint32 endtime = _system->getMillis() + delaytime * _tickLength;
+
+ int w2 = (((w * 256) / steps) * i) / 256;
+ int h2 = (((h * 256) / steps) * i) / 256;
+
+ int ym = (directionFlags & 2) ? (h - h2) : 0;
+ int xm = (directionFlags & 1) ? (w - w2) : 0;
+
+ _screen->wsaFrameAnimationStep(0, 0, x + xm, y + ym, w, h, w2, h2, srcPage, dstPage, 0);
+
+ _screen->copyPage(dstPage, 6);
+ _screen->copyPage(dstPage, 0);
+ _screen->updateScreen();
+
+ _screen->copyPage(12, dstPage);
+ delayUntil(endtime);
+ }
+ }
+}
+
+void KyraEngine_HoF::seq_resetActiveWSA(int wsaNum) {
+ if (_activeWSA[wsaNum].flags == -1)
+ return;
+
+ _activeWSA[wsaNum].flags = -1;
+ seq_nestedSequenceFrame(_activeWSA[wsaNum].finalCommand, wsaNum);
+ _activeWSA[wsaNum].movie->close();
+}
+
+void KyraEngine_HoF::seq_unloadWSA(int wsaNum) {
+ if (_activeWSA[wsaNum].movie) {
+ _activeWSA[wsaNum].movie->close();
+ delete _activeWSA[wsaNum].movie;
+ _activeWSA[wsaNum].movie = 0;
+ }
+}
+
+bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) {
+ uint32 currentFrame = _activeWSA[wsaNum].currentFrame;
+ uint32 currentTime = _system->getMillis();
+
+ if (_activeWSA[wsaNum].callback && currentFrame != _activeWSA[wsaNum].lastFrame) {
+ _activeWSA[wsaNum].lastFrame = currentFrame;
+ currentFrame = (this->*_activeWSA[wsaNum].callback)(_activeWSA[wsaNum].movie, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, currentFrame);
+ }
+
+ if (_activeWSA[wsaNum].movie) {
+ _activeWSA[wsaNum].movie->setDrawPage(2);
+ _activeWSA[wsaNum].movie->setX(_activeWSA[wsaNum].x);
+ _activeWSA[wsaNum].movie->setY(_activeWSA[wsaNum].y);
+
+ if (_activeWSA[wsaNum].flags & 0x20) {
+ _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].index, 0x4000);
+ _activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame].delay;
+ } else {
+ _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 0x4000);
+ }
+ }
+
+ if (_activeWSA[wsaNum].flags & 0x10) {
+ currentFrame = (currentTime - _activeWSA[wsaNum].nextFrame) / (_activeWSA[wsaNum].frameDelay * _tickLength);
+ } else {
+ if (((int32)(currentTime - _activeWSA[wsaNum].nextFrame) / (int32)(_activeWSA[wsaNum].frameDelay * _tickLength)) > 0) {
+ currentFrame++;
+ _activeWSA[wsaNum].nextFrame = currentTime;
+ }
+ }
+
+ bool res = false;
+
+ if (currentFrame >= _activeWSA[wsaNum].endFrame) {
+ int sw = ((_activeWSA[wsaNum].flags & 0x1e) - 2);
+ switch (sw) {
+ case 0:
+ res = true;
+ currentFrame = _activeWSA[wsaNum].endFrame;
+ _screen->copyPage(2, 12);
+ break;
+
+ case 6:
+ case 8:
+ currentFrame = _activeWSA[wsaNum].endFrame - 1;
+ break;
+
+ case 2:
+ case 10:
+ currentFrame = _activeWSA[wsaNum].startFrame;
+ break;
+
+ default:
+ currentFrame = _activeWSA[wsaNum].endFrame - 1;
+ res = true;
+ break;
+ }
+ }
+
+ _activeWSA[wsaNum].currentFrame = currentFrame & 0xffff;
+ return res;
+}
+
+void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {
+ uint8 colormap[16];
+ if (skipFlag() || _quitFlag || _abortIntroFlag || _menuChoice)
+ return;
+
+ memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6);
+ _screen->getPalette(0)[0x2f6] = 0x3f;
+ _screen->getPalette(0)[0x2f5] = 0x20;
+ _screen->getPalette(0)[0x2f4] = 0x30;
+ colormap[0] = colorMap[0];
+ colormap[1] = 0xfd;
+ memcpy(&colormap[2], &colorMap[2], 14);
+ uint8 seqTextColor0 = _seqTextColor[0];
+
+ _seqTextColor[0] = 0xfd;
+ _screen->setTextColorMap(colormap);
+ seq_resetAllTextEntries();
+ seq_setTextEntry(strIndex, x, y, 0x80, 0x78);
+ seq_processText();
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _screen->getPalette(0)[0x2f7] = _screen->getPalette(0)[textcolor * 3];
+ _screen->getPalette(0)[0x2f8] = _screen->getPalette(0)[textcolor * 3 + 1];
+ _screen->getPalette(0)[0x2f9] = _screen->getPalette(0)[textcolor * 3 + 2];
+ _screen->fadePalette(_screen->getPalette(0), 0x18);
+
+ _seqTextColor[0] = textcolor;
+ _screen->setTextColorMap(colorMap);
+ seq_resetAllTextEntries();
+ seq_setTextEntry(strIndex, x, y, 0x80, 0x78);
+ seq_processText();
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _screen->getPalette(0)[0x2f7] = _screen->getPalette(0)[0x2f8] = _screen->getPalette(0)[0x2f9] = 0;
+ _screen->fadePalette(_screen->getPalette(0), 1);
+ _screen->copyPage(2, 12);
+ seq_resetAllTextEntries();
+
+ _seqTextColor[0] = seqTextColor0;
+}
+
+void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) {
+ int dur = int(strlen(_sequenceStrings[strIndex])) * (_flags.isTalkie ? 7 : 15);
+ int entry = textEnabled() ? seq_setTextEntry(strIndex, x, y, dur, width) : strIndex;
+ _activeText[entry].textcolor = textColor;
+ uint32 chatTimeout = _system->getMillis() + dur * _tickLength;
+ int curframe = firstframe;
+
+ if (vocIndex && speechEnabled())
+ seq_playTalkText(vocIndex);
+
+ while (_system->getMillis() < chatTimeout && !(_abortIntroFlag || skipFlag())) {
+ if (lastframe < 0) {
+ int t = ABS(lastframe);
+ if (t < curframe)
+ curframe = t;
+ }
+
+ if (ABS(lastframe) < curframe)
+ curframe = firstframe;
+
+ uint32 frameTimeout = _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
+ if (wsa) {
+ wsa->setDrawPage(2);
+ wsa->setX(wsaXpos);
+ wsa->setY(wsaYpos);
+ wsa->displayFrame(curframe % wsa->frames(), 0);
+ }
+
+ _screen->copyPage(2, 12);
+
+ seq_processText();
+
+ uint32 tm = _system->getMillis();
+ if (frameTimeout > tm && chatTimeout > tm)
+ delay(MIN(frameTimeout - tm, chatTimeout - tm));
+
+ if (speechEnabled() && !textEnabled() && !snd_voiceIsPlaying())
+ break;
+
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ curframe++;
+ }
+
+ if (_abortIntroFlag || skipFlag())
+ _sound->voiceStop();
+
+ if (lastframe < 0) {
+ int t = ABS(lastframe);
+ if (t < curframe)
+ curframe = t;
+ }
+
+ if (curframe == firstframe)
+ curframe++;
+
+ _seqWsaCurrentFrame = curframe;
+}
+
+void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed,
+ int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData, const char *const *specialData) {
+
+ if (!data)
+ return;
+
+ static const char mark[] = { 5, 13, 0};
+
+ _screen->clearPage(tempPage1);
+ _screen->clearPage(tempPage2);
+ _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, 0, tempPage1);
+
+ uint8 *tmp = new uint8[397];
+ memset(tmp, 0, 397);
+ uint8 **tmpStringTable = new uint8*[35];
+ uint8 *ptr = data;
+ int strTblIndex = 0;
+
+ bool loop = true;
+ int cnt = 0;
+
+ while (loop) {
+ uint32 endTime = _system->getMillis() + speed * _tickLength;
+
+ while (cnt < 35 && *ptr) {
+ int m = cnt * 11;
+ uint16 cH = cnt ? READ_LE_UINT16(&tmp[m + 2]) + tmp[m + 9] + (tmp[m + 9] >> 3) : d->h;
+
+ char *str = (char*)ptr;
+
+ ptr = (uint8*)strpbrk(str, mark);
+ if (!ptr)
+ ptr = (uint8*)strchr(str, 0);
+
+ tmp[m + 19] = *ptr;
+ *ptr = 0;
+ if (tmp[m + 19])
+ ptr++;
+
+ tmp[m + 21] = (*str == 3 || *str == 4) ? tmp[m + 21] = *str++ : 0;
+
+ _screen->setFont(fid1);
+
+ if (*str == 1) {
+ _screen->setFont(fid2);
+ str++;
+ } else if (*str == 2) {
+ str++;
+ }
+
+ tmp[m + 20] = _screen->getFontHeight();
+
+ WRITE_LE_UINT16(&tmp[m + 11], (tmp[m + 21] == 3) ? 157 - _screen->getTextWidth(str) :
+ ((tmp[m + 21] == 4) ? 161 : (((d->w << 3) - _screen->getTextWidth(str)) >> 1) + 1));
+
+ if (tmp[m + 8] == 5)
+ cH -= (tmp[m + 9] + (tmp[m + 9] >> 3));
+
+ WRITE_LE_UINT16(&tmp[m + 13], cH);
+ WRITE_LE_UINT32(&tmp[m + 15], strTblIndex);
+ tmpStringTable[strTblIndex] = (uint8*) str;
+ strTblIndex = (strTblIndex + 1) % 35;
+ cnt++;
+ }
+
+ _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, tempPage1, tempPage2);
+
+ int cnt2 = 0;
+ bool palCycle = 0;
+
+ while (cnt2 < cnt) {
+ int m = cnt2 * 11;
+ const char *str = (const char*)tmpStringTable[READ_LE_UINT32(&tmp[m + 15])];
+ const char *str2 = str;
+ uint16 cW = READ_LE_UINT16(&tmp[m + 11]) - 10;
+ uint16 cH = READ_LE_UINT16(&tmp[m + 13]);
+ int x = (d->sx << 3) + cW;
+ int y = d->sy + cH;
+ int col1 = 255;
+
+ if (cH < d->h) {
+ _screen->setCurPage(tempPage2);
+ _screen->setFont(fid1);
+ if (tmp[m + 20] != _screen->getFontHeight())
+ _screen->setFont(fid2);
+
+ if (specialData) {
+ if (!strcmp(str, specialData[0])) {
+ col1 = 112;
+ char cChar[2] = " ";
+ while (*str2) {
+ cChar[0] = *str2;
+ _screen->printText(cChar, x, y, col1++, 0);
+ x += _screen->getCharWidth(*str2++);
+ }
+ palCycle = true;
+ } else if (!strcmp(str, specialData[1])) {
+ col1 = 133;
+ char cChar[2] = " ";
+ while (*str2) {
+ cChar[0] = *str2;
+ _screen->printText(cChar, x, y, col1--, 0);
+ x += _screen->getCharWidth(*str2++);
+ }
+ palCycle = true;
+ } else {
+ _screen->printText(str, x, y, col1, 0);
+ }
+ } else {
+ _screen->printText(str, x, y, col1, 0);
+ }
+ _screen->setCurPage(0);
+ }
+
+ WRITE_LE_UINT16(&tmp[m + 13], READ_LE_UINT16(&tmp[m + 13]) - step);
+ cnt2++;
+ }
+
+ _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, tempPage2, 0);
+ _screen->updateScreen();
+
+ if ((int16)READ_LE_UINT16(&tmp[13]) < -10) {
+ tmpStringTable[tmp[15]] += strlen((char*)tmpStringTable[tmp[15]]);
+ tmpStringTable[tmp[15]][0] = tmp[19];
+ cnt--;
+ memcpy(&tmp[11], &tmp[22], cnt * 11);
+ }
+
+ if (palCycle) {
+ for (int col = 133; col > 112; col--)
+ memcpy(_screen->_currentPalette + (col * 3), _screen->_currentPalette + ((col - 1) * 3), 3);
+ memcpy(_screen->_currentPalette + 336, _screen->_currentPalette + 399, 3);
+ _screen->setScreenPalette(_screen->_currentPalette);
+ }
+
+ delayUntil(endTime);
+
+ if ((cnt < 36) && ((d->sy + d->h) > (READ_LE_UINT16(&tmp[cnt * 11 + 2]) + tmp[cnt * 11 + 9])) && !skipFlag()) {
+ resetSkipFlag();
+ delay(_tickLength * 500);
+ cnt = 0;
+ }
+
+ if (!cnt || skipFlag())
+ loop = false;
+ }
+
+ _sound->beginFadeOut();
+ _screen->fadeToBlack();
+
+ _abortIntroFlag= false;
+ resetSkipFlag();
+
+ delete [] tmp;
+ delete [] tmpStringTable;
+}
+
+void KyraEngine_HoF::seq_scrollPage() {
+ int dstY, dstH, srcH;
+
+ static const ScreenDim d = { 0x00, 0x00, 0x28, 0x320, 0xFF, 0xFE, 0x00, 0x00 };
+
+ if (_seqScrollTextCounter - 143 < 0) {
+ dstY = 144 - _seqScrollTextCounter;
+ dstH = _seqScrollTextCounter;
+ srcH = 0;
+ } else {
+ dstY = 0;
+ srcH = _seqScrollTextCounter - 144;
+ dstH = (400 - srcH <= 144) ? 400 - srcH : 144;
+ }
+
+ if (dstH > 0) {
+ for (int i = 0; i < 4; i++) {
+ const ItemAnimData_v1 *def = &_demoAnimData[i];
+ ActiveItemAnim *a = &_activeItemAnim[i];
+
+ _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4);
+ _screen->drawShape(4, getShapePtr(def->itemIndex + def->frames[a->currentFrame]), 12, def->y - 8, 0, 0);
+ if(_seqFrameCounter % 2 == 0)
+ a->currentFrame = ++a->currentFrame % 20;
+ }
+ _screen->copyRegionEx(4, 0, srcH, 2, 2, dstY + 24, 320, dstH, &d);
+ }
+}
+
+void KyraEngine_HoF::seq_showStarcraftLogo() {
+ WSAMovieV2 *ci = new WSAMovieV2(this, _screen);
+ assert(ci);
+ _screen->clearPage(2);
+ _res->loadPakFile("INTROGEN.PAK");
+ int endframe = ci->open("ci.wsa", 0, _screen->_currentPalette);
+ _res->unloadPakFile("INTROGEN.PAK");
+ if (!ci->opened()) {
+ delete ci;
+ return;
+ }
+ _screen->hideMouse();
+ ci->setX(0);
+ ci->setY(0);
+ ci->setDrawPage(2);
+ ci->displayFrame(0, 0);
+ _screen->copyPage(2, 0);
+ _screen->fadeFromBlack();
+ for (int i = 1; i < endframe; i++) {
+ uint32 endTime = _system->getMillis() + 50;
+ if (skipFlag())
+ break;
+ ci->displayFrame(i, 0);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ delay(endTime - _system->getMillis());
+ }
+ if(!skipFlag()) {
+ uint32 endTime = _system->getMillis() + 50;
+ ci->displayFrame(0, 0);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ delay(endTime - _system->getMillis());
+ }
+ _screen->fadeToBlack();
+ _screen->showMouse();
+
+ _eventList.clear();
+ delete ci;
+}
+
+void KyraEngine_HoF::seq_init() {
+ _seqProcessedString = new char[200];
+ _seqWsa = new WSAMovieV2(this, _screen);
+ _activeWSA = new ActiveWSA[8];
+ _activeText = new ActiveText[10];
+
+ _res->unloadAllPakFiles();
+ _res->loadPakFile(StaticResource::staticDataFilename());
+ _res->loadFileList(_sequencePakList, _sequencePakListSize);
+
+ int numShp = -1;
+ if (_flags.isDemo && !_flags.isTalkie) {
+ _demoAnimData = _staticres->loadHofShapeAnimDataV1(k2SeqplayShapeAnimData, _itemAnimDataSize);
+ uint8 *shp = _res->fileData("icons.shp", 0);
+ uint32 outsize = READ_LE_UINT16(shp + 4);
+ _animShapeFiledata = new uint8[outsize];
+ Screen::decodeFrame4(shp + 10, _animShapeFiledata, outsize);
+ delete [] shp;
+
+ do {
+ numShp++;
+ addShapeToPool(_screen->getPtrToShape(_animShapeFiledata, numShp), numShp);
+ } while (getShapePtr(numShp));
+ } else {
+ MainMenu::StaticData data = {
+ { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98] },
+ { 0x01, 0x04, 0x0C, 0x04, 0x00, 0xd7, 0xd6, 0x00, 0x01, 0x02, 0x03 },
+ { 0xd8, 0xda, 0xd9, 0xd8 },
+ 0xd7, 0xd6
+ };
+ _menu = new MainMenu(this);
+ _menu->init(data, MainMenu::Animation());
+ }
+}
+
+void KyraEngine_HoF::seq_uninit() {
+ delete [] _seqProcessedString;
+ _seqProcessedString = NULL;
+
+ delete [] _activeWSA;
+ _activeWSA = NULL;
+
+ delete [] _activeText;
+ _activeText = NULL;
+
+ delete _seqWsa;
+ _seqWsa = NULL;
+
+ delete [] _animShapeFiledata;
+ _animShapeFiledata = 0;
+
+ if (_flags.isDemo && !_flags.isTalkie)
+ _staticres->unloadId(k2SeqplayShapeAnimData);
+
+ _gameShapes.clear();
+
+ delete _menu;
+ _menu = 0;
+}
+
+#pragma mark -
+#pragma mark - Ingame sequences
+#pragma mark -
+
+void KyraEngine_HoF::seq_makeBookOrCauldronAppear(int type) {
+ _screen->hideMouse();
+ showMessage(0, 0xCF);
+
+ if (type == 1)
+ seq_makeBookAppear();
+ else if (type == 2)
+ loadInvWsa("CAULDRON.WSA", 1, 6, 0, -2, -2, 1);
+
+ _screen->copyRegionToBuffer(2, 0, 0, 320, 200, _screenBuffer);
+ _screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
+
+ static const uint8 bookCauldronRects[] = {
+ 0x46, 0x90, 0x7F, 0x2B, // unknown rect (maybe unused?)
+ 0xCE, 0x90, 0x2C, 0x2C, // book rect
+ 0xFA, 0x90, 0x46, 0x2C // cauldron rect
+ };
+
+ int x = bookCauldronRects[type*4+0];
+ int y = bookCauldronRects[type*4+1];
+ int w = bookCauldronRects[type*4+2];
+ int h = bookCauldronRects[type*4+3];
+ _screen->copyRegion(x, y, x, y, w, h, 2, 0, Screen::CR_NO_P_CHECK);
+
+ _screen->copyBlockToPage(2, 0, 0, 320, 200, _screenBuffer);
+
+ if (type == 2) {
+ int32 countdown = _rnd.getRandomNumberRng(45, 80);
+ _timer->setCountdown(2, countdown * 60);
+ }
+
+ _screen->showMouse();
+}
+
+void KyraEngine_HoF::seq_makeBookAppear() {
+ _screen->hideMouse();
+
+ displayInvWsaLastFrame();
+
+ showMessage(0, 0xCF);
+
+ loadInvWsa("BOOK2.WSA", 0, 4, 2, -1, -1, 0);
+
+ uint8 *rect = new uint8[_screen->getRectSize(_invWsa.w, _invWsa.h)];
+ assert(rect);
+
+ _screen->copyRegionToBuffer(_invWsa.page, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, rect);
+
+ _invWsa.running = false;
+ snd_playSoundEffect(0xAF);
+
+ _invWsa.wsa->setX(0);
+ _invWsa.wsa->setY(0);
+ _invWsa.wsa->setDrawPage(_invWsa.page);
+
+ while (true) {
+ _invWsa.timer = _system->getMillis() + _invWsa.delay * _tickLength;
+
+ _screen->copyBlockToPage(_invWsa.page, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, rect);
+
+ _invWsa.wsa->displayFrame(_invWsa.curFrame, 0x4000, 0, 0);
+
+ if (_invWsa.page)
+ _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
+
+ ++_invWsa.curFrame;
+
+ if (_invWsa.curFrame >= _invWsa.lastFrame && !_quitFlag)
+ break;
+
+ switch (_invWsa.curFrame) {
+ case 39:
+ snd_playSoundEffect(0xCA);
+ break;
+
+ case 50:
+ snd_playSoundEffect(0x6A);
+ break;
+
+ case 72:
+ snd_playSoundEffect(0xCB);
+ break;
+
+ case 85:
+ snd_playSoundEffect(0x38);
+ break;
+
+ default:
+ break;
+ }
+
+ do {
+ update();
+ } while (_invWsa.timer > _system->getMillis() && !skipFlag());
+ }
+
+ closeInvWsa();
+ delete [] rect;
+ _invWsa.running = false;
+
+ _screen->showMouse();
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/sequences_mr.cpp b/engines/kyra/sequences_mr.cpp
new file mode 100644
index 0000000000..8c826e2048
--- /dev/null
+++ b/engines/kyra/sequences_mr.cpp
@@ -0,0 +1,249 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_mr.h"
+#include "kyra/resource.h"
+
+namespace Kyra {
+
+void KyraEngine_MR::showBadConscience() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showBadConscience()");
+ if (_badConscienceShown)
+ return;
+
+ _badConscienceShown = true;
+ _badConscienceAnim = _rnd.getRandomNumberRng(0, 2);
+ if (_currentChapter == 2)
+ _badConscienceAnim = 5;
+ else if (_currentChapter == 3)
+ _badConscienceAnim = 3;
+ else if (_currentChapter == 4 && _rnd.getRandomNumberRng(1, 100) <= 25)
+ _badConscienceAnim = 6;
+ else if (_currentChapter == 5 && _rnd.getRandomNumberRng(1, 100) <= 25)
+ _badConscienceAnim = 7;
+ else if (_characterShapeFile == 9)
+ _badConscienceAnim = 4;
+
+ _badConsciencePosition = (_mainCharacter.x1 <= 160);
+
+ if (_goodConscienceShown)
+ _badConsciencePosition = !_goodConsciencePosition;
+
+ int anim = _badConscienceAnim + (_badConsciencePosition ? 0 : 8);
+ TalkObject &talkObject = _talkObjectList[1];
+
+ if (_badConsciencePosition)
+ talkObject.x = 290;
+ else
+ talkObject.x = 30;
+ talkObject.y = 30;
+
+ static const char *animFilenames[] = {
+ "GUNFL00.WSA", "GUNFL01.WSA", "GUNFL02.WSA", "GUNFL03.WSA", "GUNFL04.WSA", "GUNFL05.WSA", "GUNFL06.WSA", "GUNFL07.WSA",
+ "GUNFR00.WSA", "GUNFR01.WSA", "GUNFR02.WSA", "GUNFR03.WSA", "GUNFR04.WSA", "GUNFR05.WSA", "GUNFR06.WSA", "GUNFR07.WSA"
+ };
+
+ setupSceneAnimObject(0x0E, 9, 0, 187, -1, -1, -1, -1, 0, 0, 0, -1, animFilenames[anim]);
+ for (uint i = 0; i <= _badConscienceFrameTable[_badConscienceAnim]; ++i) {
+ if (i == 8)
+ snd_playSoundEffect(0x1B, 0xC8);
+ updateSceneAnim(0x0E, i);
+ delay(3*_tickLength, true);
+ }
+
+ if (_mainCharacter.animFrame < 50 || _mainCharacter.animFrame > 87)
+ return;
+
+ if (_mainCharacter.y1 == -1 || (_mainCharacter.x1 != -1 && _mainCharacter.animFrame == 87) || _mainCharacter.animFrame == 87) {
+ _mainCharacter.animFrame = 87;
+ } else {
+ if (_badConsciencePosition)
+ _mainCharacter.facing = 3;
+ else
+ _mainCharacter.facing = 5;
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ }
+
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+}
+
+void KyraEngine_MR::hideBadConscience() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::hideBadConscience()");
+ if (!_badConscienceShown)
+ return;
+
+ _badConscienceShown = false;
+ for (int frame = _badConscienceFrameTable[_badConscienceAnim+8]; frame >= 0; --frame) {
+ if (frame == 15)
+ snd_playSoundEffect(0x31, 0xC8);
+ updateSceneAnim(0x0E, frame);
+ delay(1*_tickLength, true);
+ }
+
+ updateSceneAnim(0x0E, -1);
+ update();
+ removeSceneAnimObject(0x0E, 1);
+ setNextIdleAnimTimer();
+}
+
+void KyraEngine_MR::showGoodConscience() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showGoodConscience()");
+
+ if (_goodConscienceShown)
+ return;
+
+ _goodConscienceShown = true;
+ ++_goodConscienceAnim;
+ _goodConscienceAnim %= 5;
+
+ setNextIdleAnimTimer();
+ _goodConsciencePosition = (_mainCharacter.x1 <= 160);
+
+ if (_badConscienceShown)
+ _goodConsciencePosition = !_badConsciencePosition;
+
+ int anim = _goodConscienceAnim + (_goodConsciencePosition ? 0 : 5);
+ TalkObject &talkObject = _talkObjectList[87];
+
+ if (_goodConsciencePosition)
+ talkObject.x = 290;
+ else
+ talkObject.x = 30;
+ talkObject.y = 30;
+
+ static const char *animFilenames[] = {
+ "STUFL00.WSA", "STUFL02.WSA", "STUFL04.WSA", "STUFL03.WSA", "STUFL01.WSA",
+ "STUFR00.WSA", "STUFR02.WSA", "STUFR04.WSA", "STUFR03.WSA", "STUFR01.WSA"
+ };
+
+ setupSceneAnimObject(0x0F, 9, 0, 187, -1, -1, -1, -1, 0, 0, 0, -1, animFilenames[anim]);
+ for (uint i = 0; i <= _goodConscienceFrameTable[_goodConscienceAnim]; ++i) {
+ if (i == 10)
+ snd_playSoundEffect(0x7F, 0xC8);
+ updateSceneAnim(0x0F, i);
+ delay(2*_tickLength, true);
+ }
+
+ if (_mainCharacter.animFrame < 50 || _mainCharacter.animFrame > 87)
+ return;
+
+ if (_mainCharacter.y1 == -1 || (_mainCharacter.x1 != -1 && _mainCharacter.animFrame == 87) || _mainCharacter.animFrame == 87) {
+ _mainCharacter.animFrame = 87;
+ } else {
+ if (_goodConsciencePosition)
+ _mainCharacter.facing = 3;
+ else
+ _mainCharacter.facing = 5;
+ _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+ }
+
+ updateCharacterAnim(0);
+ refreshAnimObjectsIfNeed();
+}
+
+void KyraEngine_MR::hideGoodConscience() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::hideGoodConscience()");
+ if (!_goodConscienceShown)
+ return;
+
+ _goodConscienceShown = false;
+ for (int frame = _goodConscienceFrameTable[_goodConscienceAnim+5]; frame >= 0; --frame) {
+ if (frame == 17)
+ snd_playSoundEffect(0x31, 0xC8);
+ updateSceneAnim(0x0F, frame);
+ delay(1*_tickLength, true);
+ }
+
+ updateSceneAnim(0x0F, -1);
+ update();
+ removeSceneAnimObject(0x0F, 1);
+ setNextIdleAnimTimer();
+}
+
+void KyraEngine_MR::eelScript() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::eelScript()");
+ if (_chatText)
+ return;
+ _screen->hideMouse();
+
+ if (_inventoryState)
+ hideInventory();
+ removeHandItem();
+
+ objectChat((const char*)getTableEntry(_cCodeFile, 35), 0, 204, 35);
+ objectChat((const char*)getTableEntry(_cCodeFile, 40), 0, 204, 40);
+
+ setGameFlag(0xD1);
+
+ snd_playSoundEffect(0x2A, 0xC8);
+
+ setGameFlag(0x171);
+
+ switch (_characterShapeFile-1) {
+ case 0:
+ runAnimationScript("EELS01.EMC", 0, 0, 1, 1);
+ break;
+
+ case 1:
+ runAnimationScript("EELS02.EMC", 0, 0, 1, 1);
+ break;
+
+ case 2:
+ runAnimationScript("EELS03.EMC", 0, 0, 1, 1);
+ break;
+
+ case 3:
+ runAnimationScript("EELS04.EMC", 0, 0, 1, 1);
+ break;
+
+ default:
+ resetGameFlag(0x171);
+ runAnimationScript("EELS00.EMC", 0, 0, 1, 1);
+ break;
+ }
+
+ changeChapter(2, 29, 0, 4);
+ _screen->showMouse();
+}
+
+int KyraEngine_MR::initAnimationShapes(uint8 *filedata) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::initAnimationShapes(%p)", (const void*)filedata);
+ const int lastEntry = MIN(_animShapeLastEntry, 41);
+ for (int i = 0; i < lastEntry; ++i)
+ _gameShapes[9+i] = _screen->getPtrToShape(filedata, i);
+ return lastEntry;
+}
+
+void KyraEngine_MR::uninitAnimationShapes(int count, uint8 *filedata) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::uninitAnimationShapes(%d, %p)", count, (const void*)filedata);
+ for (int i = 0; i < count; ++i)
+ _gameShapes[9+i] = 0;
+ delete [] filedata;
+ setNextIdleAnimTimer();
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp
index 8e089f58be..aef510a616 100644
--- a/engines/kyra/sequences_v2.cpp
+++ b/engines/kyra/sequences_v2.cpp
@@ -23,2758 +23,114 @@
*
*/
-#include "kyra/kyra.h"
#include "kyra/kyra_v2.h"
-#include "kyra/screen.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
-#include "kyra/text_v2.h"
-#include "kyra/timer.h"
-
-#include "common/system.h"
+#include "kyra/resource.h"
namespace Kyra {
-void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_playSequences(%i, %i)", startSeq, endSeq);
- seq_init();
-
- bool allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (startSeq == kSequenceTitle)) ? false : true;
-
- if (endSeq == -1)
- endSeq = startSeq;
-
- assert(startSeq >= 0 && endSeq < kSequenceArraySize && startSeq <= endSeq);
-
- _sound->setSoundList(&_soundData[(startSeq > kSequenceZanfaun) ? kMusicFinale : kMusicIntro]);
- _sound->loadSoundFile(0);
-
- _screen->_charWidth = -2;
-
- memset(_activeWSA, 0, sizeof(ActiveWSA) * 8);
- for (int i = 0; i < 8; ++i)
- _activeWSA[i].flags = -1;
-
- memset(_activeText, 0, sizeof(ActiveText) * 10);
- seq_resetAllTextEntries();
-
- _screen->hideMouse();
- int oldPage = _screen->setCurPage(2);
-
- for (int i = 0; i < 4; ++i)
- memset(_screen->getPalette(i), 0, 0x300);
-
- _screen->clearPage(10);
- _screen->clearPage(12);
-
- _seqSubframePlaying = false;
-
- _seqWsaCurrentFrame = 0;
- _seqTextColor[0] = _seqTextColor[1] = 0;
- _seqEndTime = 0;
- _menuChoice = 0;
-
- for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
- _screen->clearPage(0);
- _screen->clearPage(8);
- memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300);
- _seqFrameCounter = 0;
- _seqStartTime = _system->getMillis();
-
- allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (seqNum == kSequenceTitle)) ? false : true;
-
- Sequence cseq = _sequences->seq[seqNum];
- SeqProc cb = _callbackS[seqNum];
-
- if (cseq.flags & 2) {
- _screen->loadBitmap(cseq.cpsFile, 2, 2, _screen->getPalette(0));
- _screen->setScreenPalette(_screen->getPalette(0));
- } else {
- _screen->setCurPage(2);
- _screen->clearPage(2);
- _screen->loadPalette("goldfont.col", _screen->getPalette(0));
- }
-
- if (cb && !(_flags.isDemo && !_flags.isTalkie))
- (this->*cb)(0, 0, 0, -1);
-
- if (cseq.flags & 1) {
- _seqWsa->close();
- _seqWsa->open(cseq.wsaFile, 0, _screen->getPalette(0));
- _screen->setScreenPalette(_screen->getPalette(0));
- _seqWsa->setX(cseq.xPos);
- _seqWsa->setY(cseq.yPos);
- _seqWsa->setDrawPage(2);
- _seqWsa->displayFrame(0, 0);
- }
-
- if (cseq.flags & 4) {
- int cp = _screen->setCurPage(2);
- Screen::FontId cf = _screen->setFont(Screen::FID_GOLDFONT_FNT);
- if (cseq.stringIndex1 != -1) {
- int sX = (320 - _screen->getTextWidth(_sequenceStrings[cseq.stringIndex1])) / 2;
- _screen->printText(_sequenceStrings[cseq.stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0);
- }
- if (cseq.stringIndex2 != -1) {
- int sX = (320 - _screen->getTextWidth(_sequenceStrings[cseq.stringIndex2])) / 2;
- _screen->printText(_sequenceStrings[cseq.stringIndex2], sX, 100, 1, 0);
- }
- _screen->setFont(cf);
- _screen->setCurPage(cp);
- }
-
- _screen->copyPage(2, 12);
- _screen->copyPage(0, 2);
- _screen->copyPage(2, 10);
- _screen->copyPage(12, 2);
-
- seq_sequenceCommand(cseq.startupCommand);
-
- if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- }
-
- if (cseq.flags & 1) {
- int w2 = _seqWsa->width();
- int h2 = _seqWsa->height();
- int x = cseq.xPos;
- int y = cseq.yPos;
-
- _seqFrameDelay = cseq.frameDelay;
-
- if (_seqWsa) {
- if (x < 0) {
- x = 0;
- w2 = 0;
- }
-
- if (y < 0) {
- y = 0;
- h2 = 0;
- }
-
- if (cseq.xPos + _seqWsa->width() > 319)
- _seqWsa->setWidth(320 - cseq.xPos);
-
- if (cseq.yPos + _seqWsa->height() > 199)
- _seqWsa->setHeight(199 - cseq.yPos);
- }
- uint8 dir = (cseq.startFrame > cseq.numFrames) ? 0 : 1;
- _seqWsaCurrentFrame = cseq.startFrame;
-
- bool loop = true;
- while (loop && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
-
- if (_seqWsa || !cb)
- _screen->copyPage(12, 2);
-
- if (cb) {
- int f = _seqWsaCurrentFrame % _seqWsa->frames();
- (this->*cb)(_seqWsa, cseq.xPos, cseq.yPos, f);
- }
-
- if (_seqWsa) {
- int f = _seqWsaCurrentFrame % _seqWsa->frames();
- _seqWsa->setX(cseq.xPos);
- _seqWsa->setY(cseq.yPos);
- _seqWsa->setDrawPage(2);
- _seqWsa->displayFrame(f, 0);
- }
-
- _screen->copyPage(2, 12);
-
- seq_processWSAs();
- seq_processText();
-
- if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- }
-
- bool loop2 = true;
- while (loop2 && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- if (_seqWsa) {
- seq_processText();
- if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- }
-
- uint32 now = _system->getMillis();
- if (now >= _seqEndTime) {
- loop2 = false;
- } else {
- uint32 tdiff = _seqEndTime - now;
- uint32 dly = tdiff < _tickLength ? tdiff : _tickLength;
- delay(dly);
- }
- } else {
- loop = loop2 = false;
- }
- }
-
- if (loop) {
- if (dir == 1) {
- if (++_seqWsaCurrentFrame >= cseq.numFrames)
- loop = false;
- } else {
- if (--_seqWsaCurrentFrame < cseq.numFrames)
- loop = false;
- }
- }
- }
- _seqWsa->close();
- } else {
- _seqFrameDelay = cseq.frameDelay;
- _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
- while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- uint32 starttime = _system->getMillis();
- seq_processWSAs();
- if (cb)
- (this->*cb)(0, 0, 0, 0);
-
- seq_processText();
-
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- _screen->copyPage(12, 2);
-
- uint32 now = _system->getMillis();
- if (now >= _seqEndTime && !_seqSubframePlaying)
- break;
-
- uint32 tdiff = _seqEndTime - starttime;
- int32 dly = _tickLength - (now - starttime);
- if (dly > 0)
- delay(MIN<uint32>(dly, tdiff));
- }
- }
-
- if (cb && !(_flags.isDemo && !_flags.isTalkie))
- (this->*cb)(0, 0, 0, -2);
-
- uint32 ct = seq_activeTextsTimeLeft();
- uint32 dl = cseq.duration * _tickLength;
- if (dl < ct)
- dl = ct;
- _seqEndTime = _system->getMillis() + dl;
-
- while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- uint32 starttime = _system->getMillis();
- seq_processWSAs();
-
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- _screen->copyPage(12, 2);
-
- uint32 now = _system->getMillis();
- if (now >= _seqEndTime && !_seqSubframePlaying) {
- break;
- }
-
- uint32 tdiff = _seqEndTime - starttime;
- int32 dly = _tickLength - (now - starttime);
- if (dly > 0)
- delay(MIN<uint32>(dly, tdiff));
- }
-
- seq_sequenceCommand(cseq.finalCommand);
- seq_resetAllTextEntries();
-
- if (_flags.isDemo && !_flags.isTalkie) {
- if (seqNum == kSequenceDemoFisher) {
- _abortIntroFlag = false;
- resetSkipFlag();
- seqNum = kSequenceDemoVirgin;
- }
- } else {
- if ((seqNum != kSequenceTitle && seqNum < kSequenceZanfaun &&
- (_abortIntroFlag || skipFlag())) || seqNum == kSequenceZanfaun) {
- _abortIntroFlag = false;
- _eventList.clear();
- seqNum = kSequenceWestwood;
- } else if (seqNum < kSequenceFrash && (_abortIntroFlag || skipFlag())) {
- _abortIntroFlag = false;
- _eventList.clear();
- seqNum = kSequenceFirates;
- }
- }
-
- if (_menuChoice) {
- _abortIntroFlag = false;
- _eventList.clear();
-
- if (_menuChoice == 2) {
- seqNum = kSequenceTitle;
- _menuChoice = 0;
- }
- }
- }
-
- if (!_menuChoice)
- delay(1000);
-
- _screen->setCurPage(oldPage);
- _screen->showMouse();
-
- for (int i = 0; i < 8; i++)
- seq_unloadWSA(i);
-
- _seqWsa->close();
-
- _screen->_charWidth = 0;
-
- seq_uninit();
-}
-
-int KyraEngine_v2::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introWestwood(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
-
- if (frm == -2) {
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
- delay(300 * _tickLength);
- } else if (!frm) {
- _sound->playTrack(2);
- }
-
- return 0;
-}
-
-int KyraEngine_v2::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introTitle(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
-
- if (frm == 1) {
- _sound->playTrack(3);
- } else if (frm == 25) {
- int cp = _screen->setCurPage(0);
- _screen->showMouse();
- _system->updateScreen();
- _menuChoice = _menu->handle(11) + 1;
- _seqEndTime = 0;
- _seqSubframePlaying = false;
- if (_menuChoice == 4)
- quitGame();
-
- _screen->hideMouse();
- _screen->setCurPage(cp);
- }
-
- return 0;
-}
-
-int KyraEngine_v2::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introOverview(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
-
- uint8 *tmpPal = &(_screen->getPalette(3)[0x101]);
- memset(tmpPal, 0, 256);
- uint32 endtime = 0, now = 0;
-
- switch (_seqFrameCounter) {
- case 0:
- _seqSubframePlaying = true;
- _sound->playTrack(4);
- endtime = _system->getMillis() + 60 * _tickLength;
-
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
-
- _screen->setTextColorMap(_seqTextColorMap);
-
- now = _system->getMillis();
- if (endtime > now)
- delay(endtime - now);
- break;
-
- case 1:
- _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x40, 0, 0, 0, 0x100, true);
- for (int i = 0; i < 256; i++)
- tmpPal[_screen->getPalette(3)[i]] = 1;
-
- for (int i = 0; i < 256; i++) {
- int v = (tmpPal[i] == 1) ? i : _screen->getPalette(3)[i];
- v *= 3;
- _screen->getPalette(2)[3 * i] = _screen->getPalette(0)[v];
- _screen->getPalette(2)[3 * i + 1] = _screen->getPalette(0)[v + 1];
- _screen->getPalette(2)[3 * i + 2] = _screen->getPalette(0)[v + 2];
- }
- break;
-
- case 40:
- seq_loadNestedSequence(0, kSequenceOver1);
- break;
-
- case 60:
- seq_loadNestedSequence(1, kSequenceOver2);
- break;
-
- case 120:
- seq_playTalkText(0);
- break;
-
- case 200:
- seq_waitForTextsTimeout();
- _screen->fadePalette(_screen->getPalette(2), 64);
- break;
-
- case 201:
- _screen->setScreenPalette(_screen->getPalette(2));
- _screen->updateScreen();
- _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
- _screen->copyPage(2, 12);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->setScreenPalette(_screen->getPalette(0));
- _screen->updateScreen();
- seq_resetActiveWSA(0);
- seq_resetActiveWSA(1);
- break;
-
- case 282:
- seq_loadNestedSequence(0, kSequenceForest);
- seq_playTalkText(1);
- break;
-
- case 354:
- case 434:
- if (!((_seqFrameCounter == 354 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 434 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_resetActiveWSA(0);
- seq_loadNestedSequence(0, kSequenceDragon);
- break;
-
- case 400:
- case 540:
- if (!((_seqFrameCounter == 400 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(0);
- _seqEndTime = 0;
- _seqSubframePlaying = false;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introLibrary(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
-
- switch (_seqFrameCounter) {
- case 0:
- _seqSubframePlaying = true;
- _sound->playTrack(5);
-
- _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
-
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 1:
- seq_loadNestedSequence(0, kSequenceLibrary3);
- seq_playTalkText(4);
- break;
-
- case 100:
- seq_waitForTextsTimeout();
-
- _screen->copyPage(12, 2);
- _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->updateScreen();
- _screen->copyPage(2, 12);
-
- seq_resetActiveWSA(0);
- seq_loadNestedSequence(0, kSequenceDarm);
- break;
-
- case 104:
- seq_playTalkText(5);
- break;
-
- case 240:
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(0);
- seq_loadNestedSequence(0, kSequenceLibrary2);
- break;
-
- case 340:
- seq_resetActiveWSA(0);
- _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
- _screen->copyPage(2, 12);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->updateScreen();
-
- seq_loadNestedSequence(0, kSequenceMarco);
- seq_playTalkText(6);
- break;
-
- case 480:
- case 660:
- if (!((_seqFrameCounter == 480 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 660 && _flags.platform == Common::kPlatformPC)))
- break;
-
- _screen->copyPage(2, 12);
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(0);
- _seqEndTime = 0;
- _seqSubframePlaying = false;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-
-int KyraEngine_v2::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introHand(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
-
- switch (_seqFrameCounter) {
- case 0:
- _seqSubframePlaying = true;
- _sound->playTrack(6);
-
- _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
-
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 1:
- seq_loadNestedSequence(0, kSequenceHand1a);
- seq_loadNestedSequence(1, kSequenceHand1b);
- seq_loadNestedSequence(2, kSequenceHand1c);
- seq_playTalkText(7);
- break;
-
- case 201:
- seq_waitForTextsTimeout();
- _screen->applyOverlay(0, 0, 320, 200, 2, _screen->getPalette(3));
- _screen->copyPage(2, 12);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->updateScreen();
- seq_resetActiveWSA(0);
- seq_resetActiveWSA(1);
- seq_resetActiveWSA(2);
- seq_loadNestedSequence(0, kSequenceHand2);
- seq_playTalkText(8);
- break;
-
- case 260:
- case 395:
- if (!((_seqFrameCounter == 260 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 395 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(0);
- seq_loadNestedSequence(1, kSequenceHand3);
- seq_playTalkText(9);
- break;
-
- case 365:
- case 500:
- if (!((_seqFrameCounter == 365 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 500 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(1);
- seq_loadNestedSequence(0, kSequenceHand4);
- break;
-
- case 405:
- case 540:
- if (!((_seqFrameCounter == 405 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_playTalkText(10);
- break;
-
- case 484:
- case 630:
- if (!((_seqFrameCounter == 484 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 630 && _flags.platform == Common::kPlatformPC)))
- break;
-
- seq_waitForTextsTimeout();
- seq_resetActiveWSA(0);
- _seqEndTime = 0;
- _seqSubframePlaying = false;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == -2) {
- seq_waitForTextsTimeout();
- _seqEndTime = 0;
- }
-
- switch (_seqFrameCounter) {
- case -2:
- seq_waitForTextsTimeout();
- break;
-
- case 0:
- _sound->playTrack(7);
-
- _seqTextColor[1] = 0xf7;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- _screen->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3), 0x24, 0, 0, 0, 0x100, false);
- break;
-
- case 1:
- seq_playTalkText(11);
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == -2) {
- seq_waitForTextsTimeout();
- _seqEndTime = 0;
- return 0;
- }
-
- switch (_seqFrameCounter) {
- case 0:
- _sound->playTrack(8);
-
- _seqTextColor[1] = 0xfd;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = _screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 255) & 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 1:
- if (_flags.isTalkie) {
- seq_playWsaSyncDialogue(21, 13, -1, 140, 70, 160, wsaObj, 0, 8, x, y);
- } else {
- seq_setTextEntry(21, 140, 70, 200, 160);
- _seqFrameDelay = 200;
- }
- break;
-
- case 2:
- case 11:
- case 21:
- if (!_flags.isTalkie)
- _seqFrameDelay = 12;
- break;
-
- case 9:
- if (_flags.isTalkie)
- seq_playWsaSyncDialogue(13, 14, -1, 140, (_flags.lang == Common::FR_FRA
- || _flags.lang == Common::DE_DEU) ? 50 : 70, 160, wsaObj, 9, 15, x, y);
- break;
-
- case 10:
- if (!_flags.isTalkie) {
- seq_waitForTextsTimeout();
- seq_setTextEntry(13, 140, 50, _sequenceStringsDuration[13], 160);
- _seqFrameDelay = 300;
- }
- break;
-
- case 16:
- if (_flags.isTalkie)
- seq_playWsaSyncDialogue(18, 15, -1, 140, (_flags.lang == Common::FR_FRA) ? 50 :
- (_flags.lang == Common::DE_DEU ? 40 : 70), 160, wsaObj, 10, 16, x, y);
- break;
-
- case 17:
- if (_flags.isTalkie)
- _seqFrameDelay = 12;
- break;
-
- case 20:
- if (!_flags.isTalkie) {
- seq_waitForTextsTimeout();
- seq_setTextEntry(18, 160, 50, _sequenceStringsDuration[18], 160);
- _seqFrameDelay = 200;
- }
- break;
-
- case 26:
- seq_waitForTextsTimeout();
- break;
-
- case 46:
- if (_flags.isTalkie) {
- seq_playWsaSyncDialogue(16, 16, -1, 200, 50, 120, wsaObj, 46, 46, x, y);
- } else {
- seq_waitForTextsTimeout();
- seq_setTextEntry(16, 200, 50, _sequenceStringsDuration[16], 120);
- }
-
- _seqEndTime = _system->getMillis() + 120 * _tickLength;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 2)
- seq_waitForTextsTimeout();
- else if (frm == 3)
- seq_playTalkText(12);
- return frm;
-}
-
-
-int KyraEngine_v2::seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 1)
- seq_playTalkText(12);
- return frm;
-}
-
-int KyraEngine_v2::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 11)
- seq_waitForTextsTimeout();
- else if (frm == 12)
- seq_playTalkText(2);
-
- return frm;
-}
-
-int KyraEngine_v2::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 11)
- seq_waitForTextsTimeout();
- else if (frm == 3)
- seq_playTalkText(3);
- return frm;
-}
-
-int KyraEngine_v2::seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- //NULLSUB (at least in fm-towns version)
- return frm;
-}
-
-int KyraEngine_v2::seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- //NULLSUB (at least in fm-towns version)
- return frm;
-}
-
-int KyraEngine_v2::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 36) {
- seq_waitForTextsTimeout();
- _seqEndTime = 0;
- }
- return frm;
-}
-
-int KyraEngine_v2::seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- //NULLSUB (at least in fm-towns version)
- return frm;
-}
-
-int KyraEngine_v2::seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 15)
- frm = 12;
- return frm;
-}
-
-int KyraEngine_v2::seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 8)
- frm = 4;
- return frm;
-}
-
-int KyraEngine_v2::seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- //NULLSUB (at least in fm-towns version)
- return frm;
-}
-
-int KyraEngine_v2::seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- //NULLSUB (at least in fm-towns version)
- return frm;
-}
-
-int KyraEngine_v2::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- int chatFirstFrame = 0;
- int chatLastFrame = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- seq_sequenceCommand(9);
- break;
-
- case 0:
- _sound->playTrack(3);
-
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
-
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(81, 240, 70, _seqTextColorMap, 252);
- seq_printCreditsString(82, 240, 90, _seqTextColorMap, _seqTextColor[0]);
- _screen->copyPage(2, 12);
- delay(endtime - _system->getMillis());
- seq_playTalkText(_flags.isTalkie ? 28 : 24);
- _seqTextColor[0] = 1;
-
- if (_flags.isTalkie) {
- chatY = (_flags.lang == Common::FR_FRA) ? 70 : 78;
- chatFirstFrame = 9;
- chatLastFrame = 15;
- voiceIndex = 34;
- } else {
- chatY = (_flags.lang == Common::FR_FRA) ? 78 : 70;
- chatFirstFrame = 0;
- chatLastFrame = 8;
- }
- chatX = (_flags.lang == Common::FR_FRA) ? 84 : 88;
- chatW = 100;
-
- seq_playWsaSyncDialogue(22, voiceIndex, 187, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- break;
-
- case 9:
- case 16:
- if (!((frm == 9 && !_flags.isTalkie) || (frm == 16 && _flags.isTalkie)))
- break;
-
- _seqFrameDelay = 12;
-
- if (_flags.lang == Common::FR_FRA) {
- chatX = 80;
- chatW = 112;
- } else {
- chatX = (_flags.lang == Common::DE_DEU) ? 84 : 96;
- chatW = 100;
- }
-
- if (_flags.isTalkie) {
- chatFirstFrame = 0;
- chatLastFrame = 8;
- voiceIndex = 35;
- } else {
- chatFirstFrame = 9;
- chatLastFrame = 15;
- }
- chatY = 70;
-
- seq_playWsaSyncDialogue(23, voiceIndex, 137, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- if (_flags.isTalkie)
- _seqWsaCurrentFrame = 17;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- int chatFirstFrame = 0;
- int chatLastFrame = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(34, 240, _flags.isTalkie ? 60 : 40, _seqTextColorMap, 252);
- seq_printCreditsString(35, 240, _flags.isTalkie ? 70 : 50, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(36, 240, _flags.isTalkie ? 90 : 70, _seqTextColorMap, 252);
- seq_printCreditsString(37, 240, _flags.isTalkie ? 100 : 90, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(38, 240, _flags.isTalkie ? 120 : 110, _seqTextColorMap, 252);
- seq_printCreditsString(39, 240, _flags.isTalkie ? 130 : 120, _seqTextColorMap, _seqTextColor[0]);
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
- seq_printCreditsString(103, 240, 130, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 255;
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 5:
- if (!_flags.isTalkie)
- seq_playTalkText(18);
- _seqFrameDelay = 16;
-
- if (_flags.isTalkie) {
- chatFirstFrame = 5;
- chatLastFrame = 8;
- voiceIndex = 22;
- } else {
- chatLastFrame = 14;
- }
- chatX = 116;
- chatY = 90;
- chatW = 60;
-
- seq_playWsaSyncDialogue(24, voiceIndex, 149, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- break;
-
- case 11:
- if (_flags.isTalkie)
- seq_playWsaSyncDialogue(24, 22, 149, 116, 90, 60, wsaObj, 11, 14, x, y);
- break;
-
- case 16:
- seq_playTalkText(_flags.isTalkie ? 23 : 19);
- _seqFrameDelay = _flags.isTalkie ? 20 : 16;
-
- if (_flags.lang == Common::FR_FRA) {
- chatY = 48;
- chatW = 88;
- } else {
- chatY = 60;
- chatW = 100;
- }
- chatX = 60;
-
- if (_flags.isTalkie)
- voiceIndex = 36;
-
- seq_playWsaSyncDialogue(25, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 16, 25, x, y);
- _seqFrameDelay = 16;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
-
- seq_printCreditsString(40, 240, _flags.isTalkie ? 55 : 40, _seqTextColorMap, 252);
- seq_printCreditsString(41, 240, _flags.isTalkie ? 65 : 50, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(42, 240, _flags.isTalkie ? 75 : 60, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(43, 240, _flags.isTalkie ? 95 : 80, _seqTextColorMap, 252);
- seq_printCreditsString(44, 240, _flags.isTalkie ? 105 : 90, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(93, 240, _flags.isTalkie ? 125 : 110, _seqTextColorMap, 252);
- seq_printCreditsString(94, 240, _flags.isTalkie ? 135 : 120, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 4:
- chatX = 94;
- chatY = 42;
- chatW = 100;
- if (_flags.isTalkie)
- voiceIndex = 37;
- seq_playWsaSyncDialogue(26, voiceIndex, 149, chatX, chatY, chatW, wsaObj, 3, 12, x, y);
- break;
-
- case 14:
- seq_playTalkText(_flags.isTalkie ? 19 : 15);
- break;
-
- case 23:
- seq_playTalkText(_flags.isTalkie ? 20 : 16);
- break;
-
- case 29:
- chatX = (_flags.lang == Common::DE_DEU) ? 82 : ((_flags.lang == Common::FR_FRA) ? 92 : 88);
- chatY = 40;
- chatW = 100;
-
- if (_flags.isTalkie) {
- if (_flags.lang == Common::DE_DEU)
- chatY = 35;
- voiceIndex = 38;
- }
-
- seq_playWsaSyncDialogue(27, voiceIndex, 187, chatX, chatY, chatW, wsaObj, 28, 34, x, y);
- break;
-
- case 45:
- seq_playTalkText(_flags.isTalkie ? 21 : 17);
- break;
-
- case 50:
- seq_playTalkText(_flags.isTalkie ? 29 : 25);
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- int chatFirstFrame = 0;
- int chatLastFrame = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- _screen->copyPage(12, 2);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(49, 240, 20, _seqTextColorMap, 252);
- seq_printCreditsString(50, 240, 30, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(51, 240, 40, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(52, 240, 50, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(53, 240, 60, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(54, 240, 70, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(55, 240, 80, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(56, 240, 90, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(57, 240, 100, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(58, 240, 110, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(60, 240, 120, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(61, 240, 130, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(62, 240, 140, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(63, 240, 150, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(64, 240, 160, _seqTextColorMap, _seqTextColor[0]);
-
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 2:
- seq_playTalkText(_flags.isTalkie ? 25 : 21);
-
- if (_flags.lang == Common::FR_FRA) {
- chatX = 92;
- chatY = 72;
- } else {
- chatX = (_flags.lang == Common::DE_DEU) ? 90 : 98;
- chatY = 84;
- }
-
- if (_flags.isTalkie) {
- chatFirstFrame = 8;
- chatLastFrame = 9;
- voiceIndex = 39;
- } else {
- chatFirstFrame = 2;
- chatLastFrame = -8;
- }
- chatW = 100;
-
- seq_playWsaSyncDialogue(28, voiceIndex, -1, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- if (_flags.isTalkie)
- _seqWsaCurrentFrame = 4;
- break;
-
- case 9:
- seq_playTalkText(_flags.isTalkie ? 24 : 20);
- _seqFrameDelay = 100;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- _screen->copyPage(12, 2);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(45, 240, 40, _seqTextColorMap, 252);
- seq_printCreditsString(46, 240, 50, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(47, 240, 60, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(83, 240, 80, _seqTextColorMap, 252);
- seq_printCreditsString(48, 240, 90, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(65, 240, 110, _seqTextColorMap, 252);
- seq_printCreditsString(66, 240, 120, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(67, 240, 130, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(68, 240, 140, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(69, 240, 150, _seqTextColorMap, _seqTextColor[0]);
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
- seq_printCreditsString(104, 240, 160, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- _seqTextColor[1] = 1 + (_screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 254) & 0xff);
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColorMap[1] = _seqTextColor[0] = 1 + (_screen->findLeastDifferentColor(_seqTextColorPresets + 3, _screen->getPalette(0) + 3, 254) & 0xff);
- _screen->setTextColorMap(_seqTextColorMap);
- seq_playTalkText(_flags.isTalkie ? 30 : 26);
- break;
-
- case 6:
- if (_flags.isTalkie)
- seq_playTalkText(18);
- break;
-
- case 12:
- if (!_flags.isTalkie)
- seq_playTalkText(14);
-
- chatX = 90;
- chatY = 30;
- chatW = 100;
-
- if (_flags.isTalkie) {
- if (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) {
- chatX = 75;
- chatY = 25;
- }
- voiceIndex = 40;
- }
-
- seq_playWsaSyncDialogue(29, voiceIndex, 150, chatX, chatY, chatW, wsaObj, 12, -21, x, y);
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- int chatFirstFrame = 0;
- int chatLastFrame = 0;
- int textCol = 0;
-
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(70, 240, 20, _seqTextColorMap, 252);
- seq_printCreditsString(71, 240, 30, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(72, 240, 40, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(73, 240, 50, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(74, 240, 60, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(75, 240, 70, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(101, 240, 80, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(102, 240, 90, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(87, 240, 100, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(88, 240, 110, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(89, 240, 120, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(90, 240, 130, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(91, 240, 140, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(92, 240, 150, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- for (int i = 0; i < 0x300; i++)
- _screen->getPalette(0)[i] &= 0x3f;
- _seqTextColor[1] = 0xCf;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xfe;
-
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 6:
- _seqFrameDelay = 20;
-
- if (_flags.isTalkie) {
- chatX = 82;
- textCol = 143;
- chatFirstFrame = 16;
- chatLastFrame = 21;
- voiceIndex = 41;
- } else {
- chatX = 62;
- textCol = 137;
- chatFirstFrame = 9;
- chatLastFrame = 13;
- }
- chatY = (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) ? 88 :100;
- chatW = 80;
-
- seq_playWsaSyncDialogue(30, voiceIndex, 137, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- if (_flags.isTalkie)
- _seqWsaCurrentFrame = 8;
- break;
-
- case 9:
- case 16:
- if (_flags.isTalkie) {
- if (frm == 16)
- break;
- chatX = 64;
- textCol = 137;
- chatFirstFrame = 9;
- chatLastFrame = 13;
- voiceIndex = 42;
- } else {
- if (frm == 9)
- break;
- chatX = 80;
- textCol = 143;
- chatFirstFrame = 16;
- chatLastFrame = 21;
- }
- chatY = 100;
- chatW = 100;
-
- seq_playWsaSyncDialogue(31, voiceIndex, 143, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y);
- if (_flags.isTalkie)
- _seqWsaCurrentFrame = 21;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
- int chatX = 0;
- int chatY = 0;
- int chatW = 0;
- uint16 voiceIndex = 0;
-
- switch (frm) {
- case -2:
- _screen->copyPage(12, 2);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
- seq_printCreditsString(76, 240, 40, _seqTextColorMap, 252);
- seq_printCreditsString(77, 240, 50, _seqTextColorMap, 252);
- seq_printCreditsString(78, 240, 60, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(79, 240, 70, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(80, 240, 80, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(84, 240, 100, _seqTextColorMap, 252);
- seq_printCreditsString(85, 240, 110, _seqTextColorMap, _seqTextColor[0]);
- seq_printCreditsString(99, 240, 130, _seqTextColorMap, 252);
- seq_printCreditsString(100, 240, 140, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
- _seqEndTime = 0;
- break;
-
- case 0:
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- break;
-
- case 6:
- seq_playTalkText(_flags.isTalkie ? 31 : 27);
- break;
-
- case 14:
- case 15:
- if (!((frm == 15 && !_flags.isTalkie) || (frm == 14 && _flags.isTalkie)))
- break;
-
- seq_playTalkText(_flags.isTalkie ? 31 : 27);
-
- if (_flags.lang == Common::DE_DEU) {
- chatX = 82;
- chatY = 84;
- chatW = 140;
- } else {
- chatX = 74;
- chatY = (_flags.lang == Common::FR_FRA) ? 96: 108;
- chatW = 80;
- }
-
- if (_flags.isTalkie)
- voiceIndex = 43;
-
- seq_playWsaSyncDialogue(32, voiceIndex, 137, chatX, chatY, chatW, wsaObj, 14, 16, x, y);
- break;
-
- case 28:
- seq_playTalkText(_flags.isTalkie ? 32 : 28);
- break;
-
- case 29:
- seq_playTalkText(_flags.isTalkie ? 33 : 29);
- break;
-
- case 31:
- if (_flags.isTalkie)
- voiceIndex = 44;
-
- chatX = 90;
- chatY = (_flags.lang == Common::DE_DEU) ? 60 : 76;
- chatW = 80;
-
- seq_playWsaSyncDialogue(33, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 31, 34, x, y);
- break;
-
- case 35:
- _seqFrameDelay = 300;
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- int tmp = 0;
-
- switch (frm) {
- case -2:
- _screen->setCurPage(2);
- _screen->clearCurPage();
- _screen->copyPage(2, 12);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- _seqFrameCounter = 0;
- seq_loadNestedSequence(0, kSequenceFiggle);
- break;
-
- case -1:
- if (_flags.isTalkie)
- seq_finaleActorScreen();
- _seqSpecialFlag = _flags.isTalkie;
- break;
-
- case 0:
- if (_seqFrameCounter == 1) {
- _sound->playTrack(4);
- _seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
- memset(_seqTextColorMap, _seqTextColor[1], 16);
- _seqTextColor[0] = _seqTextColorMap[1] = 0xff;
- _screen->setTextColorMap(_seqTextColorMap);
- }
- _seqFrameDelay = 10;
- break;
-
- case 1:
- if (_seqFrameCounter < 20 && _seqSpecialFlag) {
- _seqWsaCurrentFrame = 0;
- } else {
- _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
- seq_playTalkText(_flags.isTalkie ? 26 : 22);
- if (_seqSpecialFlag) {
- _seqFrameCounter = 3;
- _seqSpecialFlag = false;
- }
- }
- break;
-
- case 2:
- _seqFrameDelay = 20;
- break;
-
- case 3:
- seq_playTalkText(_flags.isTalkie ? 27 : 23);
- _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
- break;
-
- case 4:
- _seqFrameDelay = 10;
- break;
-
- case 5:
- seq_playTalkText(_flags.isTalkie ? 27 : 23);
- tmp = _seqFrameCounter / 6;
- if (tmp == 2)
- _seqFrameDelay = _flags.isTalkie ? 7 : (1 + _rnd.getRandomNumberRng(1, 10));
- else if (tmp < 2)
- _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300));
- break;
-
- case 6:
- _seqFrameDelay = 10;
- tmp = _seqFrameCounter / 6;
- if (tmp == 2)
- _seqWsaCurrentFrame = 4;
- else if (tmp < 2)
- _seqWsaCurrentFrame = 0;
- break;
-
- case 7:
- _seqFrameCounter = 0;
- _seqFrameDelay = 5;
- seq_playTalkText(_flags.isTalkie ? 26 : 22);
- break;
-
- case 11:
- if (_seqFrameCounter < 8)
- _seqWsaCurrentFrame = 8;
- break;
+void KyraEngine_v2::runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::runAnimationScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload);
+ memset(&_animationScriptData, 0, sizeof(_animationScriptData));
+ memset(&_animationScriptState, 0, sizeof(_animationScriptState));
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-void KyraEngine_v2::seq_finaleActorScreen() {
- static const uint8 colormap[] = {0, 0, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- static const ScreenDim d = { 0x00, 0x0C, 0x28, 0xB4, 0xFF, 0x00, 0x00, 0x00 };
-
- _screen->loadBitmap("finale.cps", 3, 3, _screen->_currentPalette);
- _screen->setFont(Screen::FID_GOLDFONT_FNT);
-
- int talkieCreditsSize, talkieCreditsSpecialSize;
- const uint8 *talkieCredits = _staticres->loadRawData(k2SeqplayCredits, talkieCreditsSize);
- const char *const *talkieCreditsSpecial = _staticres->loadStrings(k2SeqplayCreditsSpecial, talkieCreditsSpecialSize);
-
- _sound->setSoundList(&_soundData[kMusicIngame]);
- _sound->loadSoundFile(3);
- _sound->playTrack(3);
-
- _screen->setTextColorMap(colormap);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->updateScreen();
- _screen->fadeFromBlack();
-
- _screen->_charWidth = -2;
- uint8 *dataPtr = new uint8[0xafd];
- memcpy(dataPtr, talkieCredits, talkieCreditsSize);
- _staticres->unloadId(k2SeqplayCredits);
-
- seq_displayScrollText(dataPtr, &d, 2, 6, 5, 1, Screen::FID_GOLDFONT_FNT, Screen::FID_GOLDFONT_FNT, 0, talkieCreditsSpecial);
- delay(120);
-
- delete [] dataPtr;
- _staticres->unloadId(k2SeqplayCreditsSpecial);
- _sound->setSoundList(&_soundData[kMusicFinale]);
- _sound->loadSoundFile(0);
-}
-
-int KyraEngine_v2::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (_seqFrameCounter == 10)
- _seqEndTime = 0;
- if (_seqFrameCounter == 10 || _seqFrameCounter == 5 || _seqFrameCounter == 7)
- seq_playTalkText(_flags.isTalkie ? 45 : 30);
-
- _seqFrameCounter++;
- return frm;
-}
-
-int KyraEngine_v2::seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (!frm)
- delay(50 * _tickLength);
- return 0;
-}
-
-int KyraEngine_v2::seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (!frm)
- _sound->playTrack(2);
- return 0;
-}
-int KyraEngine_v2::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (!frm) {
- _sound->playTrack(3);
- } else if (frm == 25) {
- delay(60 * _tickLength);
- _seqEndTime = 0;
- seq_sequenceCommand(0);
- }
- return 0;
-}
-
-int KyraEngine_v2::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (!frm) {
- _sound->playTrack(4);
- } else if (frm == 25) {
- seq_loadNestedSequence(0, kSequenceDemoWater);
- _seqFrameDelay--;
- } else if (frm > 25 && frm < 50) {
- if (_seqFrameDelay > 3)
- _seqFrameDelay--;
- } else if (frm == 95) {
- _seqFrameDelay = 70;
- } else if (frm == 96) {
- _seqFrameDelay = 7;
- } else if (frm == 129) {
- seq_resetActiveWSA(0);
- }
-
- return 0;
-}
-
-int KyraEngine_v2::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- switch (frm) {
- case 12:
- seq_playTalkText(4);
- break;
-
- case 32:
- seq_playTalkText(7);
- break;
-
- case 36:
- seq_playTalkText(10);
- break;
-
- case 57:
- seq_playTalkText(9);
- break;
-
- case 80:
- case 96:
- case 149:
- _seqFrameDelay = 70;
- break;
-
- case 81:
- case 97:
- _seqFrameDelay = 5;
- break;
-
- case 110:
- seq_playTalkText(5);
- break;
-
- case 137:
- seq_playTalkText(6);
- break;
- }
-
- return 0;
-}
-
-int KyraEngine_v2::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (!_seqFrameCounter)
- seq_loadNestedSequence(0, kSequenceDemoWharf2);
-
- switch (frm) {
- case 0:
- seq_playTalkText(11);
- break;
-
- case 5:
- if ((_seqFrameCounter / 8) <= 2 || _activeWSA[0].flags != -1)
- _seqWsaCurrentFrame = 0;
- else
- seq_resetActiveWSA(0);
- break;
-
- case 6:
- seq_resetActiveWSA(0);
- break;
-
- case 8:
- case 10:
- seq_playTalkText(2);
- break;
-
- case 13:
- seq_playTalkText(7);
- break;
-
- case 16:
- seq_playTalkText(12);
- break;
-
- default:
- break;
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 0) {
- if (!(_seqFrameCounter/8)) {
- seq_loadNestedSequence(0, kSequenceDemoDinob2);
- _seqWsaCurrentFrame = 0;
- }
- } else if (frm == 3) {
- if (_activeWSA[0].flags != -1) {
- _seqWsaCurrentFrame = 0;
- } else {
- seq_resetActiveWSA(0);
- _screen->copyPage(2, 12);
- }
- } else if (frm == 4) {
- seq_resetActiveWSA(0);
- }
-
- _seqFrameCounter++;
- return 0;
-}
-
-int KyraEngine_v2::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (((_system->getMillis() - _seqStartTime) / (5 * _tickLength)) > 0) {
- _seqStartTime = _system->getMillis();
- if (!_seqFrameCounter) {
- seq_loadNestedSequence(0, kSequenceDemoBail);
- seq_loadNestedSequence(1, kSequenceDemoDig);
- }
-
- if (_seqScrollTextCounter >= 0x18f && !_seqFrameCounter)
- return 0;
-
- if (!_seqFrameCounter) {
- _screen->loadBitmap("adtext.cps", 4, 4, 0);
- _screen->loadBitmap("adtext2.cps", 6, 6, 0);
- _screen->copyPageMemory(6, 0, 4, 64000, 1024);
- _screen->copyPageMemory(6, 1023, 6, 0, 64000);
- _seqScrollTextCounter = 0;
- }
-
- seq_scrollPage();
- _seqFrameCounter++;
- if (_seqFrameCounter < 0x256 || _seqFrameCounter > 0x31c) {
- if (_seqFrameCounter < 0x174 || _seqFrameCounter > 0x1d7) {
- if (_seqFrameCounter < 0x84 || _seqFrameCounter > 0xe7) {
- _seqScrollTextCounter++;
- }
- }
- }
-
- if (_seqFrameCounter > 0x31e) {
- seq_resetActiveWSA(0);
- seq_resetActiveWSA(1);
- _seqEndTime = 0;
- _screen->copyPage(2, 12);
- }
-
- } else {
- seq_scrollPage();
- }
- return 0;
-}
-
-int KyraEngine_v2::seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 69)
- _seqWsaCurrentFrame = 8;
-
- return frm;
-}
-
-int KyraEngine_v2::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- switch (frm) {
- case 19:
- seq_playTalkText(13);
- break;
-
- case 54:
- seq_playTalkText(15);
- break;
-
- case 61:
- seq_playTalkText(16);
- break;
-
- case 69:
- seq_playTalkText(14);
- break;
-
- case 77:
- seq_playTalkText(13);
- break;
-
- case 79:
- _seqWsaCurrentFrame = 4;
- break;
- }
-
- return frm;
-}
-
-int KyraEngine_v2::seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- if (frm == 1)
- seq_playTalkText(11);
- return frm;
-}
-
-int KyraEngine_v2::seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- return frm;
-}
-
-int KyraEngine_v2::seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- return frm;
-}
-
-uint32 KyraEngine_v2::seq_activeTextsTimeLeft() {
- uint32 res = 0;
-
- for (int i = 0; i < 10; i++) {
- uint32 chatend = (_activeText[i].duration + _activeText[i].startTime);
- uint32 curtime = _system->getMillis();
- if (_activeText[i].duration != -1 && chatend > curtime) {
- chatend -= curtime;
- if (res < chatend)
- res = chatend;
- }
- }
-
- return res;
-}
-
-void KyraEngine_v2::seq_processWSAs() {
- for (int i = 0; i < 8; i++) {
- if (_activeWSA[i].flags != -1) {
- if (seq_processNextSubFrame(i))
- seq_resetActiveWSA(i);
- }
- }
-}
-
-void KyraEngine_v2::seq_processText() {
- Screen::FontId curFont = _screen->setFont(Screen::FID_GOLDFONT_FNT);
- int curPage = _screen->setCurPage(2);
- char outputStr[70];
-
- for (int i = 0; i < 10; i++) {
- if (_activeText[i].startTime + _activeText[i].duration > _system->getMillis() && _activeText[i].duration != -1) {
-
- char *srcStr = seq_preprocessString(_sequenceStrings[_activeText[i].strIndex], _activeText[i].width);
- int yPos = _activeText[i].y;
-
- while (*srcStr) {
- uint32 linePos = 0;
- for (; *srcStr; linePos++) {
- if (*srcStr == 0x0d) // Carriage return
- break;
- outputStr[linePos] = *srcStr;
- srcStr++;
- }
- outputStr[linePos] = 0;
- if (*srcStr == 0x0d)
- srcStr++;
-
- uint8 textColor = (_activeText[i].textcolor >= 0) ? _activeText[i].textcolor : _seqTextColor[0];
- _screen->printText(outputStr, _activeText[i].x - (_screen->getTextWidth(outputStr) / 2), yPos, textColor, 0);
- yPos += 10;
- }
- } else {
- _activeText[i].duration = -1;
- }
- }
-
- _screen->setCurPage(curPage);
- _screen->setFont(curFont);
-}
-
-char *KyraEngine_v2::seq_preprocessString(const char *srcStr, int width) {
- char *dstStr = _seqProcessedString;
- int lineStart = 0;
- int linePos = 0;
-
- while (*srcStr) {
- while (*srcStr && *srcStr != 0x20) // Space
- dstStr[lineStart + linePos++] = *srcStr++;
- dstStr[lineStart + linePos] = 0;
-
- int len = _screen->getTextWidth(&dstStr[lineStart]);
- if (width >= len && *srcStr) {
- dstStr[lineStart + linePos++] = *srcStr++;
- } else {
- dstStr[lineStart + linePos] = 0x0d; // Carriage return
- lineStart += linePos + 1;
- linePos = 0;
- if (*srcStr)
- srcStr++;
- }
- }
- dstStr[lineStart + linePos] = 0;
-
- return strlen(_seqProcessedString) ? dstStr : 0;
-}
-
-void KyraEngine_v2::seq_sequenceCommand(int command) {
- uint8 pal[768];
-
- for (int i = 0; i < 8; i++)
- seq_resetActiveWSA(i);
-
- switch (command) {
- case 0:
- memset(pal, 0, 0x300);
- _screen->fadePalette(pal, 16);
- memcpy (_screen->getPalette(0), pal, 0x300);
- memcpy (_screen->getPalette(1), pal, 0x300);
- break;
-
- case 1:
- memset(pal, 0x3F, 0x300);
- //////////XXX
- //////////Unused anyway (at least by fm-towns intro/outro)
-
- _screen->fadePalette(pal, 16);
- memcpy (_screen->getPalette(0), pal, 0x300);
- memcpy (_screen->getPalette(1), pal, 0x300);
- break;
-
- case 3:
- _screen->copyPage(2, 0);
- _screen->fadePalette(_screen->getPalette(0), 16);
- memcpy (_screen->getPalette(1), _screen->getPalette(0), 0x300);
- break;
-
- case 4:
- _screen->copyPage(2, 0);
- _screen->fadePalette(_screen->getPalette(0), 36);
- memcpy (_screen->getPalette(1), _screen->getPalette(0), 0x300);
- break;
-
- case 5:
- _screen->copyPage(2, 0);
- break;
-
- case 6:
- // UNUSED
- // seq_loadBLD("library.bld");
- break;
-
- case 7:
- // UNUSED
- // seq_loadBLD("marco.bld");
- break;
-
- case 8:
- memset(pal, 0, 0x300);
- _screen->fadePalette(pal, 16);
- memcpy (_screen->getPalette(0), pal, 0x300);
- memcpy (_screen->getPalette(1), pal, 0x300);
-
- delay(120 * _tickLength);
- break;
-
- case 9:
- for (int i = 0; i < 0x100; i++) {
- int pv = (_screen->getPalette(0)[3 * i] + _screen->getPalette(0)[3 * i + 1] + _screen->getPalette(0)[3 * i + 2]) / 3;
- pal[3 * i] = pal[3 * i + 1] = pal[3 * i + 2] = pv & 0xff;
- }
-
- //int a = 0x100;
- //int d = (0x800 << 5) - 0x100;
- //pal[3 * i] = pal[3 * i + 1] = pal[3 * i + 2] = 0x3f;
-
- _screen->fadePalette(pal, 64);
- memcpy (_screen->getPalette(0), pal, 0x300);
- memcpy (_screen->getPalette(1), pal, 0x300);
- break;
-
- default:
- break;
- }
-}
-
-void KyraEngine_v2::seq_cmpFadeFrame(const char *cmpFile) {
- _screen->copyPage(10, 2);
- _screen->copyPage(4, 10);
- _screen->clearPage(6);
- _screen->loadBitmap(cmpFile, 6, 6, 0);
- _screen->copyPage(12, 4);
-
- for (int i = 0; i < 3; i++) {
- uint32 endtime = _system->getMillis() + 4 * _tickLength;
- _screen->cmpFadeFrameStep(4, 320, 200, 0, 0, 2, 320, 200, 0, 0, 320, 200, 6);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
- _screen->updateScreen();
- delayUntil(endtime);
- }
-
- _screen->copyPage(4, 0);
- _screen->updateScreen();
- _screen->copyPage(4, 2);
- _screen->copyPage(4, 6);
- _screen->copyPage(10, 4);
-}
-
-void KyraEngine_v2::seq_playTalkText(uint8 chatNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_playTalkText(%i)", chatNum);
-
- assert(chatNum < _sequenceSoundListSize);
-
- if (chatNum < 12 && !_flags.isDemo && textEnabled())
- seq_setTextEntry(chatNum, 160, 168, _sequenceStringsDuration[chatNum], 160);
-
- _speechFile = _sequenceSoundList[chatNum];
- _sound->voicePlay(_sequenceSoundList[chatNum]);
-}
-
-void KyraEngine_v2::seq_waitForTextsTimeout() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_waitForTextsTimeout()");
-
- uint32 longest = seq_activeTextsTimeLeft() + _system->getMillis();
- uint32 now = _system->getMillis();
-
- if (textEnabled()) {
- if (longest > now)
- delay(longest - now);
- } else if (speechEnabled()) {
- while (snd_voiceIsPlaying())
- delay(_tickLength);
- }
-
- seq_resetAllTextEntries();
-}
-
-void KyraEngine_v2::seq_resetAllTextEntries() {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_resetAllTextEntries()");
- for (int i = 0; i < 10; i++)
- _activeText[i].duration = -1;
-}
-
-int KyraEngine_v2::seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_setTextEntry(%i, %i, %i, %i, %i)", strIndex, posX, posY, duration, width);
-
- for (int i = 0; i < 10; i++) {
- if (_activeText[i].duration != -1) {
- if (i < 9)
- continue;
- else
- return -1;
- }
-
- _activeText[i].strIndex = strIndex;
- _activeText[i].x = posX;
- _activeText[i].y = posY;
- _activeText[i].duration = duration * _tickLength;
- _activeText[i].width = width;
- _activeText[i].startTime = _system->getMillis();
- _activeText[i].textcolor = -1;
-
- return i;
- }
- return -1;
-}
-
-void KyraEngine_v2::seq_loadNestedSequence(int wsaNum, int seqNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_loadNestedSequence(%i, %i)", wsaNum, seqNum);
-
- if (_activeWSA[wsaNum].flags != -1)
- return;
-
- NestedSequence s = _sequences->seqn[seqNum];
-
- if (!_activeWSA[wsaNum].movie) {
- _activeWSA[wsaNum].movie = new WSAMovieV2(this, _screen);
- assert(_activeWSA[wsaNum].movie);
- }
-
- _activeWSA[wsaNum].movie->close();
-
- _activeWSA[wsaNum].movie->open(s.wsaFile, 0, 0);
-
- if (!_activeWSA[wsaNum].movie->opened()) {
- delete _activeWSA[wsaNum].movie;
- _activeWSA[wsaNum].movie = 0;
- return;
- }
-
- _activeWSA[wsaNum].endFrame = s.endFrame;
- _activeWSA[wsaNum].startFrame = _activeWSA[wsaNum].currentFrame = s.startframe;
- _activeWSA[wsaNum].frameDelay = s.frameDelay;
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- _activeWSA[wsaNum].movie->setDrawPage(_screen->_curPage);
- _activeWSA[wsaNum].callback = _callbackN[seqNum];
- _activeWSA[wsaNum].control = s.wsaControl;
-
- _activeWSA[wsaNum].flags = s.flags | 1;
- _activeWSA[wsaNum].x = s.x;
- _activeWSA[wsaNum].y = s.y;
- _activeWSA[wsaNum].startupCommand = s.startupCommand;
- _activeWSA[wsaNum].finalCommand = s.finalCommand;
- _activeWSA[wsaNum].lastFrame = 0xffff;
-
- seq_nestedSequenceFrame(s.startupCommand, wsaNum);
-
- if (!s.startupCommand)
- seq_processNextSubFrame(wsaNum);
-
- _activeWSA[wsaNum].nextFrame = _system->getMillis();
-}
-
-void KyraEngine_v2::seq_nestedSequenceFrame(int command, int wsaNum) {
- int xa = 0, ya = 0;
- command--;
- if (!_activeWSA[wsaNum].movie || skipFlag() || _quitFlag || _abortIntroFlag)
- return;
-
- switch (command) {
- case 0:
- _activeWSA[wsaNum].movie->setDrawPage(8);
- xa = -_activeWSA[wsaNum].movie->xAdd();
- ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->setX(xa);
- _activeWSA[wsaNum].movie->setY(ya);
- _activeWSA[wsaNum].movie->displayFrame(0, 0);
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
- _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 2);
- break;
-
- case 1:
- _activeWSA[wsaNum].movie->setDrawPage(8);
- xa = -_activeWSA[wsaNum].movie->xAdd();
- ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->setX(xa);
- _activeWSA[wsaNum].movie->setY(ya);
- _activeWSA[wsaNum].movie->displayFrame(0, 0);
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
- _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 1);
- break;
+ if (!_emc->load(filename, &_animationScriptData, &_opcodesAnimation))
+ error("Couldn't load temporary script '%s'", filename);
- case 2:
- seq_waitForTextsTimeout();
- _activeWSA[wsaNum].movie->setDrawPage(8);
- xa = -_activeWSA[wsaNum].movie->xAdd();
- ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->setX(xa);
- _activeWSA[wsaNum].movie->setY(ya);
- _activeWSA[wsaNum].movie->displayFrame(0x15, 0);
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
- _activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 0, 2);
- break;
+ _emc->init(&_animationScriptState, &_animationScriptData);
+ _emc->start(&_animationScriptState, 0);
- case 3:
- _screen->copyPage(2, 10);
- _activeWSA[wsaNum].movie->setDrawPage(2);
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- _activeWSA[wsaNum].movie->displayFrame(0, 0);
- _screen->copyPage(2, 12);
- seq_cmpFadeFrame("scene2.cmp");
- break;
+ _animResetFrame = -1;
- case 4:
- _screen->copyPage(2, 10);
- _activeWSA[wsaNum].movie->setDrawPage(2);
- _activeWSA[wsaNum].movie->setX(0);
- _activeWSA[wsaNum].movie->setY(0);
- _activeWSA[wsaNum].movie->displayFrame(0, 0);
- _screen->copyPage(2, 12);
- seq_cmpFadeFrame("scene3.cmp");
- break;
-
- default:
- break;
+ if (_animShapeFiledata && newShapes) {
+ uninitAnimationShapes(_animShapeCount, _animShapeFiledata);
+ _animShapeFiledata = 0;
+ _animShapeCount = 0;
}
-}
-
-void KyraEngine_v2::seq_animatedSubFrame(int srcPage, int dstPage, int delaytime, int steps,
- int x, int y, int w, int h, int openClose, int directionFlags) {
- if (openClose) {
- for (int i = 1; i < steps; i++) {
- uint32 endtime = _system->getMillis() + delaytime * _tickLength;
-
- int w2 = (((w * 256) / steps) * i) / 256;
- int h2 = (((h * 256) / steps) * i) / 256;
-
- int ym = (directionFlags & 2) ? (h - h2) : 0;
- int xm = (directionFlags & 1) ? (w - w2) : 0;
-
- _screen->wsaFrameAnimationStep(0, 0, x + xm, y + ym, w, h, w2, h2, srcPage, dstPage, 0);
-
- _screen->copyPage(dstPage, 6);
- _screen->copyPage(dstPage, 0);
- _screen->updateScreen();
-
- _screen->copyPage(12, dstPage);
- delayUntil(endtime);
- }
-
- _screen->wsaFrameAnimationStep(0, 0, x, y, w, h, w, h, srcPage, dstPage, 0);
- _screen->copyPage(dstPage, 6);
- _screen->copyPage(dstPage, 0);
- _screen->updateScreen();
- } else {
- _screen->copyPage(12, dstPage);
- for (int i = steps; i; i--) {
- uint32 endtime = _system->getMillis() + delaytime * _tickLength;
- int w2 = (((w * 256) / steps) * i) / 256;
- int h2 = (((h * 256) / steps) * i) / 256;
+ while (_emc->isValid(&_animationScriptState))
+ _emc->run(&_animationScriptState);
- int ym = (directionFlags & 2) ? (h - h2) : 0;
- int xm = (directionFlags & 1) ? (w - w2) : 0;
+ uint8 *fileData = 0;
- _screen->wsaFrameAnimationStep(0, 0, x + xm, y + ym, w, h, w2, h2, srcPage, dstPage, 0);
+ if (newShapes)
+ _animShapeFiledata = _res->fileData(_animShapeFilename, 0);
- _screen->copyPage(dstPage, 6);
- _screen->copyPage(dstPage, 0);
- _screen->updateScreen();
+ fileData = _animShapeFiledata;
- _screen->copyPage(12, dstPage);
- delayUntil(endtime);
- }
- }
-}
-
-void KyraEngine_v2::seq_resetActiveWSA(int wsaNum) {
- if (_activeWSA[wsaNum].flags == -1)
+ if (!fileData) {
+ _emc->unload(&_animationScriptData);
return;
-
- _activeWSA[wsaNum].flags = -1;
- seq_nestedSequenceFrame(_activeWSA[wsaNum].finalCommand, wsaNum);
- _activeWSA[wsaNum].movie->close();
-}
-
-void KyraEngine_v2::seq_unloadWSA(int wsaNum) {
- if (_activeWSA[wsaNum].movie) {
- _activeWSA[wsaNum].movie->close();
- delete _activeWSA[wsaNum].movie;
- _activeWSA[wsaNum].movie = 0;
}
-}
-bool KyraEngine_v2::seq_processNextSubFrame(int wsaNum) {
- uint32 currentFrame = _activeWSA[wsaNum].currentFrame;
- uint32 currentTime = _system->getMillis();
+ if (newShapes)
+ _animShapeCount = initAnimationShapes(fileData);
- if (_activeWSA[wsaNum].callback && currentFrame != _activeWSA[wsaNum].lastFrame) {
- _activeWSA[wsaNum].lastFrame = currentFrame;
- currentFrame = (this->*_activeWSA[wsaNum].callback)(_activeWSA[wsaNum].movie, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, currentFrame);
- }
+ processAnimationScript(allowSkip, resetChar);
- if (_activeWSA[wsaNum].movie) {
- _activeWSA[wsaNum].movie->setDrawPage(2);
- _activeWSA[wsaNum].movie->setX(_activeWSA[wsaNum].x);
- _activeWSA[wsaNum].movie->setY(_activeWSA[wsaNum].y);
-
- if (_activeWSA[wsaNum].flags & 0x20) {
- _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].index, 0x4000);
- _activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame].delay;
- } else {
- _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 0x4000);
- }
- }
-
- if (_activeWSA[wsaNum].flags & 0x10) {
- currentFrame = (currentTime - _activeWSA[wsaNum].nextFrame) / (_activeWSA[wsaNum].frameDelay * _tickLength);
- } else {
- if (((int32)(currentTime - _activeWSA[wsaNum].nextFrame) / (int32)(_activeWSA[wsaNum].frameDelay * _tickLength)) > 0) {
- currentFrame++;
- _activeWSA[wsaNum].nextFrame = currentTime;
- }
- }
-
- bool res = false;
-
- if (currentFrame >= _activeWSA[wsaNum].endFrame) {
- int sw = ((_activeWSA[wsaNum].flags & 0x1e) - 2);
- switch (sw) {
- case 0:
- res = true;
- currentFrame = _activeWSA[wsaNum].endFrame;
- _screen->copyPage(2, 12);
- break;
-
- case 6:
- case 8:
- currentFrame = _activeWSA[wsaNum].endFrame - 1;
- break;
-
- case 2:
- case 10:
- currentFrame = _activeWSA[wsaNum].startFrame;
- break;
-
- default:
- currentFrame = _activeWSA[wsaNum].endFrame - 1;
- res = true;
- break;
- }
+ if (shapeUnload) {
+ uninitAnimationShapes(_animShapeCount, fileData);
+ _animShapeCount = 0;
+ _animShapeFiledata = 0;
}
- _activeWSA[wsaNum].currentFrame = currentFrame & 0xffff;
- return res;
+ _emc->unload(&_animationScriptData);
}
-void KyraEngine_v2::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {
- uint8 colormap[16];
- if (skipFlag() || _quitFlag || _abortIntroFlag || _menuChoice)
- return;
-
- memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6);
- _screen->getPalette(0)[0x2f6] = 0x3f;
- _screen->getPalette(0)[0x2f5] = 0x20;
- _screen->getPalette(0)[0x2f4] = 0x30;
- colormap[0] = colorMap[0];
- colormap[1] = 0xfd;
- memcpy(&colormap[2], &colorMap[2], 14);
- uint8 seqTextColor0 = _seqTextColor[0];
-
- _seqTextColor[0] = 0xfd;
- _screen->setTextColorMap(colormap);
- seq_resetAllTextEntries();
- seq_setTextEntry(strIndex, x, y, 0x80, 0x78);
- seq_processText();
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- _screen->getPalette(0)[0x2f7] = _screen->getPalette(0)[textcolor * 3];
- _screen->getPalette(0)[0x2f8] = _screen->getPalette(0)[textcolor * 3 + 1];
- _screen->getPalette(0)[0x2f9] = _screen->getPalette(0)[textcolor * 3 + 2];
- _screen->fadePalette(_screen->getPalette(0), 0x18);
-
- _seqTextColor[0] = textcolor;
- _screen->setTextColorMap(colorMap);
- seq_resetAllTextEntries();
- seq_setTextEntry(strIndex, x, y, 0x80, 0x78);
- seq_processText();
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- _screen->getPalette(0)[0x2f7] = _screen->getPalette(0)[0x2f8] = _screen->getPalette(0)[0x2f9] = 0;
- _screen->fadePalette(_screen->getPalette(0), 1);
- _screen->copyPage(2, 12);
- seq_resetAllTextEntries();
-
- _seqTextColor[0] = seqTextColor0;
-}
-
-void KyraEngine_v2::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) {
- int dur = int(strlen(_sequenceStrings[strIndex])) * (_flags.isTalkie ? 7 : 15);
- int entry = textEnabled() ? seq_setTextEntry(strIndex, x, y, dur, width) : strIndex;
- _activeText[entry].textcolor = textColor;
- uint32 chatTimeout = _system->getMillis() + dur * _tickLength;
- int curframe = firstframe;
-
- if (vocIndex && speechEnabled())
- seq_playTalkText(vocIndex);
-
- while (_system->getMillis() < chatTimeout && !(_abortIntroFlag || skipFlag())) {
- if (lastframe < 0) {
- int t = ABS(lastframe);
- if (t < curframe)
- curframe = t;
- }
-
- if (ABS(lastframe) < curframe)
- curframe = firstframe;
-
- uint32 frameTimeout = _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
- if (wsa) {
- wsa->setDrawPage(2);
- wsa->setX(wsaXpos);
- wsa->setY(wsaYpos);
- wsa->displayFrame(curframe % wsa->frames(), 0);
- }
-
- _screen->copyPage(2, 12);
-
- seq_processText();
-
- uint32 tm = _system->getMillis();
- if (frameTimeout > tm && chatTimeout > tm)
- delay(MIN(frameTimeout - tm, chatTimeout - tm));
-
- if (speechEnabled() && !textEnabled() && !snd_voiceIsPlaying())
- break;
-
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- curframe++;
- }
-
- if (_abortIntroFlag || skipFlag())
- _sound->voiceStop();
-
- if (lastframe < 0) {
- int t = ABS(lastframe);
- if (t < curframe)
- curframe = t;
- }
-
- if (curframe == firstframe)
- curframe++;
-
- _seqWsaCurrentFrame = curframe;
-}
-
-void KyraEngine_v2::seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed,
- int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData, const char *const *specialData) {
-
- if (!data)
- return;
-
- static const char mark[] = { 5, 13, 0};
-
- _screen->clearPage(tempPage1);
- _screen->clearPage(tempPage2);
- _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, 0, tempPage1);
-
- uint8 *tmp = new uint8[397];
- memset(tmp, 0, 397);
- uint8 **tmpStringTable = new uint8*[35];
- uint8 *ptr = data;
- int strTblIndex = 0;
-
- bool loop = true;
- int cnt = 0;
-
- while (loop) {
- uint32 endTime = _system->getMillis() + speed * _tickLength;
-
- while (cnt < 35 && *ptr) {
- int m = cnt * 11;
- uint16 cH = cnt ? READ_LE_UINT16(&tmp[m + 2]) + tmp[m + 9] + (tmp[m + 9] >> 3) : d->h;
-
- char *str = (char*)ptr;
-
- ptr = (uint8*)strpbrk(str, mark);
- if (!ptr)
- ptr = (uint8*)strchr(str, 0);
-
- tmp[m + 19] = *ptr;
- *ptr = 0;
- if (tmp[m + 19])
- ptr++;
-
- tmp[m + 21] = (*str == 3 || *str == 4) ? tmp[m + 21] = *str++ : 0;
-
- _screen->setFont(fid1);
-
- if (*str == 1) {
- _screen->setFont(fid2);
- str++;
- } else if (*str == 2) {
- str++;
- }
-
- tmp[m + 20] = _screen->getFontHeight();
+void KyraEngine_v2::processAnimationScript(int allowSkip, int resetChar) {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_v2::processAnimationScript(%d, %d)", allowSkip, resetChar);
+ setCharacterAnimDim(_animShapeWidth, _animShapeHeight);
- WRITE_LE_UINT16(&tmp[m + 11], (tmp[m + 21] == 3) ? 157 - _screen->getTextWidth(str) :
- ((tmp[m + 21] == 4) ? 161 : (((d->w << 3) - _screen->getTextWidth(str)) >> 1) + 1));
+ _emc->init(&_animationScriptState, &_animationScriptData);
+ _emc->start(&_animationScriptState, 1);
- if (tmp[m + 8] == 5)
- cH -= (tmp[m + 9] + (tmp[m + 9] >> 3));
-
- WRITE_LE_UINT16(&tmp[m + 13], cH);
- WRITE_LE_UINT32(&tmp[m + 15], strTblIndex);
- tmpStringTable[strTblIndex] = (uint8*) str;
- strTblIndex = (strTblIndex + 1) % 35;
- cnt++;
- }
-
- _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, tempPage1, tempPage2);
-
- int cnt2 = 0;
- bool palCycle = 0;
-
- while (cnt2 < cnt) {
- int m = cnt2 * 11;
- const char *str = (const char*)tmpStringTable[READ_LE_UINT32(&tmp[m + 15])];
- const char *str2 = str;
- uint16 cW = READ_LE_UINT16(&tmp[m + 11]) - 10;
- uint16 cH = READ_LE_UINT16(&tmp[m + 13]);
- int x = (d->sx << 3) + cW;
- int y = d->sy + cH;
- int col1 = 255;
-
- if (cH < d->h) {
- _screen->setCurPage(tempPage2);
- _screen->setFont(fid1);
- if (tmp[m + 20] != _screen->getFontHeight())
- _screen->setFont(fid2);
-
- if (specialData) {
- if (!strcmp(str, specialData[0])) {
- col1 = 112;
- char cChar[2] = " ";
- while (*str2) {
- cChar[0] = *str2;
- _screen->printText(cChar, x, y, col1++, 0);
- x += _screen->getCharWidth(*str2++);
- }
- palCycle = true;
- } else if (!strcmp(str, specialData[1])) {
- col1 = 133;
- char cChar[2] = " ";
- while (*str2) {
- cChar[0] = *str2;
- _screen->printText(cChar, x, y, col1--, 0);
- x += _screen->getCharWidth(*str2++);
- }
- palCycle = true;
- } else {
- _screen->printText(str, x, y, col1, 0);
- }
- } else {
- _screen->printText(str, x, y, col1, 0);
- }
- _screen->setCurPage(0);
- }
-
- WRITE_LE_UINT16(&tmp[m + 13], READ_LE_UINT16(&tmp[m + 13]) - step);
- cnt2++;
- }
-
- _screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, tempPage2, 0);
- _screen->updateScreen();
-
- if ((int16)READ_LE_UINT16(&tmp[13]) < -10) {
- tmpStringTable[tmp[15]] += strlen((char*)tmpStringTable[tmp[15]]);
- tmpStringTable[tmp[15]][0] = tmp[19];
- cnt--;
- memcpy(&tmp[11], &tmp[22], cnt * 11);
- }
-
- if (palCycle) {
- for (int col = 133; col > 112; col--)
- memcpy(_screen->_currentPalette + (col * 3), _screen->_currentPalette + ((col - 1) * 3), 3);
- memcpy(_screen->_currentPalette + 336, _screen->_currentPalette + 399, 3);
- _screen->setScreenPalette(_screen->_currentPalette);
- }
-
- delayUntil(endTime);
-
- if ((cnt < 36) && ((d->sy + d->h) > (READ_LE_UINT16(&tmp[cnt * 11 + 2]) + tmp[cnt * 11 + 9])) && !skipFlag()) {
- resetSkipFlag();
- delay(_tickLength * 500);
- cnt = 0;
- }
-
- if (!cnt || skipFlag())
- loop = false;
- }
-
- _sound->beginFadeOut();
- _screen->fadeToBlack();
-
- _abortIntroFlag= false;
resetSkipFlag();
- delete [] tmp;
- delete [] tmpStringTable;
-}
+ while (_emc->isValid(&_animationScriptState)) {
+ _animNeedUpdate = false;
+ while (_emc->isValid(&_animationScriptState) && !_animNeedUpdate)
+ _emc->run(&_animationScriptState);
-void KyraEngine_v2::seq_scrollPage() {
- int dstY, dstH, srcH;
+ if (_animNewFrame < 0)
+ continue;
- static const ScreenDim d = { 0x00, 0x00, 0x28, 0x320, 0xFF, 0xFE, 0x00, 0x00 };
+ _mainCharacter.animFrame = _animNewFrame + _desc.animScriptFrameAdd;
+ updateCharacterAnim(0);
+ if (_chatText)
+ updateWithText();
+ else
+ update();
- if (_seqScrollTextCounter - 143 < 0) {
- dstY = 144 - _seqScrollTextCounter;
- dstH = _seqScrollTextCounter;
- srcH = 0;
- } else {
- dstY = 0;
- srcH = _seqScrollTextCounter - 144;
- dstH = (400 - srcH <= 144) ? 400 - srcH : 144;
- }
+ uint32 delayEnd = _system->getMillis() + _animDelayTime * _tickLength;
- if (dstH > 0) {
- for (int i = 0; i < 4; i++) {
- const ItemAnimData_v1 *def = &_demoAnimData[i];
- ActiveItemAnim *a = &_activeItemAnim[i];
+ while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
+ if (_chatText)
+ updateWithText();
+ else
+ update();
- _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4);
- _screen->drawShape(4, _defaultShapeTable[def->itemIndex + def->frames[a->currentFrame]], 12, def->y - 8, 0, 0);
- if(_seqFrameCounter % 2 == 0)
- a->currentFrame = ++a->currentFrame % 20;
+ delay(10);
}
- _screen->copyRegionEx(4, 0, srcH, 2, 2, dstY + 24, 320, dstH, &d);
- }
-}
-void KyraEngine_v2::seq_showStarcraftLogo() {
- WSAMovieV2 *ci = new WSAMovieV2(this, _screen);
- assert(ci);
- _screen->clearPage(2);
- _res->loadPakFile("INTROGEN.PAK");
- int endframe = ci->open("ci.wsa", 0, _screen->_currentPalette);
- _res->unloadPakFile("INTROGEN.PAK");
- if (!ci->opened()) {
- delete ci;
- return;
- }
- _screen->hideMouse();
- ci->setX(0);
- ci->setY(0);
- ci->setDrawPage(2);
- ci->displayFrame(0, 0);
- _screen->copyPage(2, 0);
- _screen->fadeFromBlack();
- for (int i = 1; i < endframe; i++) {
- uint32 endTime = _system->getMillis() + 50;
if (skipFlag())
- break;
- ci->displayFrame(i, 0);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- delay(endTime - _system->getMillis());
- }
- if(!skipFlag()) {
- uint32 endTime = _system->getMillis() + 50;
- ci->displayFrame(0, 0);
- _screen->copyPage(2, 0);
- _screen->updateScreen();
- delay(endTime - _system->getMillis());
- }
- _screen->fadeToBlack();
- _screen->showMouse();
-
- _eventList.clear();
- delete ci;
-}
-
-void KyraEngine_v2::seq_init() {
- _seqProcessedString = new char[200];
- _seqWsa = new WSAMovieV2(this, _screen);
- _activeWSA = new ActiveWSA[8];
- _activeText = new ActiveText[10];
-
- _res->unloadAllPakFiles();
- _res->loadPakFile(StaticResource::staticDataFilename());
- _res->loadFileList(_sequencePakList, _sequencePakListSize);
-
- int numShp = -1;
- if (_flags.isDemo && !_flags.isTalkie) {
- _demoAnimData = _staticres->loadHofShapeAnimDataV1(k2SeqplayShapeAnimData, _itemAnimDataSize);
- uint8 *shp = _res->fileData("icons.shp", 0);
- uint32 outsize = READ_LE_UINT16(shp + 4);
- _newShapeFiledata = new uint8[outsize];
- Screen::decodeFrame4(shp + 10, _newShapeFiledata, outsize);
- delete [] shp;
-
- do {
- numShp++;
- _defaultShapeTable[numShp] = _screen->getPtrToShape(_newShapeFiledata, numShp);
- } while (_defaultShapeTable[numShp]);
- } else {
- MainMenu::StaticData data = {
- { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98] },
- { 0x01, 0x04, 0x0C, 0x04, 0x00, 0xd7, 0xd6, 0x00, 0x01, 0x02, 0x03 },
- { 0xd8, 0xda, 0xd9, 0xd8 },
- 0xd7, 0xd6
- };
- _menu = new MainMenu(this);
- _menu->init(data, MainMenu::Animation());
- }
-}
-
-void KyraEngine_v2::seq_uninit() {
- delete [] _seqProcessedString;
- _seqProcessedString = NULL;
-
- delete [] _activeWSA;
- _activeWSA = NULL;
-
- delete [] _activeText;
- _activeText = NULL;
-
- delete _seqWsa;
- _seqWsa = NULL;
-
- delete [] _newShapeFiledata;
- _newShapeFiledata = 0;
-
- if (_flags.isDemo && !_flags.isTalkie)
- _staticres->unloadId(k2SeqplayShapeAnimData);
-
- memset(&_defaultShapeTable, 0, sizeof(_defaultShapeTable));
-
- delete _menu;
- _menu = 0;
-}
-
-#pragma mark -
-#pragma mark - Ingame sequences
-#pragma mark -
-
-void KyraEngine_v2::seq_makeBookOrCauldronAppear(int type) {
- _screen->hideMouse();
- showMessage(0, 0xCF);
-
- if (type == 1)
- seq_makeBookAppear();
- else if (type == 2)
- loadInvWsa("CAULDRON.WSA", 1, 6, 0, -2, -2, 1);
-
- _screen->copyRegionToBuffer(2, 0, 0, 320, 200, _screenBuffer);
- _screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
-
- static const uint8 bookCauldronRects[] = {
- 0x46, 0x90, 0x7F, 0x2B, // unknown rect (maybe unused?)
- 0xCE, 0x90, 0x2C, 0x2C, // book rect
- 0xFA, 0x90, 0x46, 0x2C // cauldron rect
- };
-
- int x = bookCauldronRects[type*4+0];
- int y = bookCauldronRects[type*4+1];
- int w = bookCauldronRects[type*4+2];
- int h = bookCauldronRects[type*4+3];
- _screen->copyRegion(x, y, x, y, w, h, 2, 0, Screen::CR_NO_P_CHECK);
-
- _screen->copyBlockToPage(2, 0, 0, 320, 200, _screenBuffer);
-
- if (type == 2) {
- int32 countdown = _rnd.getRandomNumberRng(45, 80);
- _timer->setCountdown(2, countdown * 60);
+ resetSkipFlag();
}
- _screen->showMouse();
-}
-
-void KyraEngine_v2::seq_makeBookAppear() {
- _screen->hideMouse();
-
- displayInvWsaLastFrame();
-
- showMessage(0, 0xCF);
-
- loadInvWsa("BOOK2.WSA", 0, 4, 2, -1, -1, 0);
-
- uint8 *rect = new uint8[_screen->getRectSize(_invWsa.w, _invWsa.h)];
- assert(rect);
-
- _screen->copyRegionToBuffer(_invWsa.page, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, rect);
-
- _invWsa.running = false;
- snd_playSoundEffect(0xAF);
-
- _invWsa.wsa->setX(0);
- _invWsa.wsa->setY(0);
- _invWsa.wsa->setDrawPage(_invWsa.page);
-
- while (true) {
- _invWsa.timer = _system->getMillis() + _invWsa.delay * _tickLength;
-
- _screen->copyBlockToPage(_invWsa.page, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, rect);
-
- _invWsa.wsa->displayFrame(_invWsa.curFrame, 0x4000, 0, 0);
-
- if (_invWsa.page)
- _screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
-
- ++_invWsa.curFrame;
-
- if (_invWsa.curFrame >= _invWsa.lastFrame && !_quitFlag)
- break;
-
- switch (_invWsa.curFrame) {
- case 39:
- snd_playSoundEffect(0xCA);
- break;
-
- case 50:
- snd_playSoundEffect(0x6A);
- break;
-
- case 72:
- snd_playSoundEffect(0xCB);
- break;
-
- case 85:
- snd_playSoundEffect(0x38);
- break;
-
- default:
- break;
+ if (resetChar) {
+ if (_animResetFrame >= 0) {
+ _mainCharacter.animFrame = _animResetFrame + _desc.animScriptFrameAdd;
+ updateCharacterAnim(0);
+ if (_chatText)
+ updateWithText();
+ else
+ update();
}
- do {
- update();
- } while (_invWsa.timer > _system->getMillis() && !skipFlag());
+ _mainCharacter.animFrame = _desc.characterFrameTable[_mainCharacter.facing];
+ updateCharacterAnim(0);
}
- closeInvWsa();
- delete [] rect;
- _invWsa.running = false;
-
- _screen->showMouse();
+ _animResetFrame = -1;
+ resetCharacterAnimDim();
}
} // end of namespace Kyra
diff --git a/engines/kyra/sequences_v3.cpp b/engines/kyra/sequences_v3.cpp
deleted file mode 100644
index 16fd991022..0000000000
--- a/engines/kyra/sequences_v3.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "kyra/kyra_v3.h"
-
-namespace Kyra {
-
-void KyraEngine_v3::showBadConscience() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::showBadConscience()");
- if (_badConscienceShown)
- return;
-
- _badConscienceShown = true;
- _badConscienceAnim = _rnd.getRandomNumberRng(0, 2);
- if (_curChapter == 2)
- _badConscienceAnim = 5;
- else if (_curChapter == 3)
- _badConscienceAnim = 3;
- else if (_curChapter == 4 && _rnd.getRandomNumberRng(1, 100) <= 25)
- _badConscienceAnim = 6;
- else if (_curChapter == 5 && _rnd.getRandomNumberRng(1, 100) <= 25)
- _badConscienceAnim = 7;
- else if (_malcolmShapes == 9)
- _badConscienceAnim = 4;
-
- _badConsciencePosition = (_mainCharacter.x1 <= 160);
-
- //if (_goodConscienceShown)
- // _badConsciencePosition = !_goodConsciencePosition;
-
- int anim = _badConscienceAnim + (_badConsciencePosition ? 0 : 8);
- TalkObject &talkObject = _talkObjectList[1];
-
- if (_badConsciencePosition)
- talkObject.x = 290;
- else
- talkObject.x = 30;
- talkObject.y = 30;
-
- static const char *animFilenames[] = {
- "GUNFL00.WSA", "GUNFL01.WSA", "GUNFL02.WSA", "GUNFL03.WSA", "GUNFL04.WSA", "GUNFL05.WSA", "GUNFL06.WSA", "GUNFL07.WSA",
- "GUNFR00.WSA", "GUNFR01.WSA", "GUNFR02.WSA", "GUNFR03.WSA", "GUNFR04.WSA", "GUNFR05.WSA", "GUNFR06.WSA", "GUNFR07.WSA"
- };
-
- setupSceneAnimObject(0x0E, 9, 0, 187, -1, -1, -1, -1, 0, 0, 0, -1, animFilenames[anim]);
- for (uint i = 0; i <= _badConscienceFrameTable[_badConscienceAnim]; ++i) {
- if (i == 8)
- playSoundEffect(0x1B, 0xC8);
- updateSceneAnim(0x0E, i);
- delay(3*_tickLength, true);
- }
-
- if (_mainCharacter.animFrame < 50 || _mainCharacter.animFrame > 87)
- return;
-
- if (_mainCharacter.y1 == -1 || (_mainCharacter.x1 != -1 && _mainCharacter.animFrame == 87) || _mainCharacter.animFrame == 87) {
- _mainCharacter.animFrame = 87;
- } else {
- if (_badConsciencePosition)
- _mainCharacter.facing = 3;
- else
- _mainCharacter.facing = 5;
- _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
- }
-
- updateCharacterAnim(0);
- refreshAnimObjectsIfNeed();
-}
-
-void KyraEngine_v3::hideBadConscience() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::hideBadConscience()");
- if (!_badConscienceShown)
- return;
-
- _badConscienceShown = false;
- for (int frame = _badConscienceFrameTable[_badConscienceAnim+8]; frame >= 0; --frame) {
- if (frame == 15)
- playSoundEffect(0x31, 0xC8);
- updateSceneAnim(0x0E, frame);
- delay(1*_tickLength, true);
- }
-
- updateSceneAnim(0x0E, -1);
- update();
- removeSceneAnimObject(0x0E, 1);
- //setNextIdleAnimTimer();
-}
-
-} // end of namespace Kyra
-
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 694ea14404..887e9c7267 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -478,8 +478,8 @@ void KyraEngine::snd_playTheme(int file, int track) {
_sound->playTrack(track);
}
-void KyraEngine::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d)", track);
+void KyraEngine::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d, %d)", track, volume);
_sound->playSoundEffect(track);
}
diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp
index 24a33e5539..f8c6fbdb04 100644
--- a/engines/kyra/sound_digital.cpp
+++ b/engines/kyra/sound_digital.cpp
@@ -366,8 +366,10 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
}
Common::SeekableReadStream *stream = _vm->resource()->getFileStream(filename);
- if (!stream)
+ if (!stream) {
+ warning("Couldn't find soundfile '%s'", filename);
return -1;
+ }
strncpy(use->filename, filename, sizeof(use->filename));
use->priority = priority;
@@ -401,6 +403,9 @@ bool SoundDigital::isPlaying(int channel) {
}
void SoundDigital::stopSound(int channel) {
+ if (channel == -1)
+ return;
+
assert(channel >= 0 && channel < ARRAYSIZE(_sounds));
_mixer->stopHandle(_sounds[channel].handle);
_sounds[channel].stream = 0;
diff --git a/engines/kyra/sound_v1.cpp b/engines/kyra/sound_v1.cpp
index 9cb135983d..8293eb7508 100644
--- a/engines/kyra/sound_v1.cpp
+++ b/engines/kyra/sound_v1.cpp
@@ -28,8 +28,8 @@
namespace Kyra {
-void KyraEngine_v1::snd_playSoundEffect(int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d)", track);
+void KyraEngine_v1::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d, %d)", track, volume);
if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && track == 49) {
snd_playWanderScoreViaMap(56, 1);
return;
diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp
index 531033f5c4..b54192abae 100644
--- a/engines/kyra/sprites.cpp
+++ b/engines/kyra/sprites.cpp
@@ -554,7 +554,7 @@ void Sprites::loadSceneShapes() {
void Sprites::refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, uint16 y, bool flipX, bool unkFlag) {
debugC(9, kDebugLevelSprites, "Sprites::refreshSceneAnimObject(%i, %i, %i, %i, %i, %i", animNum, shapeNum, x, y, flipX, unkFlag);
- AnimObject &anim = _vm->animator()->sprites()[animNum];
+ Animator_v1::AnimObject &anim = _vm->animator()->sprites()[animNum];
anim.refreshFlag = 1;
anim.bkgdChangeFlag = 1;
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index abafeceeb4..16d7ca4d9b 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -28,14 +28,16 @@
#include "common/md5.h"
#include "kyra/kyra.h"
#include "kyra/kyra_v1.h"
-#include "kyra/kyra_v2.h"
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_hof.h"
+#include "kyra/kyra_mr.h"
#include "kyra/screen.h"
#include "kyra/screen_v1.h"
-#include "kyra/screen_v2.h"
-#include "kyra/screen_v3.h"
+#include "kyra/screen_hof.h"
+#include "kyra/screen_mr.h"
#include "kyra/resource.h"
#include "kyra/gui_v1.h"
+#include "kyra/gui_hof.h"
+#include "kyra/gui_mr.h"
#include "gui/message.h"
@@ -1177,7 +1179,7 @@ void KyraEngine_v1::loadMainScreen(int page) {
_screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0);
}
-void KyraEngine_v2::initStaticResource() {
+void KyraEngine_HoF::initStaticResource() {
int tmpSize = 0;
_sequencePakList = _staticres->loadStrings(k2SeqplayPakFiles, _sequencePakListSize);
@@ -1250,37 +1252,37 @@ void KyraEngine_v2::initStaticResource() {
_sequences = _staticres->loadHofSequenceData(k2SeqplaySeqData, tmpSize);
static const SeqProc hofSequenceCallbacks[] = { 0,
- &KyraEngine_v2::seq_introWestwood,
- &KyraEngine_v2::seq_introTitle, &KyraEngine_v2::seq_introOverview,
- &KyraEngine_v2::seq_introLibrary, &KyraEngine_v2::seq_introHand,
- &KyraEngine_v2::seq_introPoint, &KyraEngine_v2::seq_introZanfaun,
- &KyraEngine_v2::seq_finaleFunters, &KyraEngine_v2::seq_finaleFerb,
- &KyraEngine_v2::seq_finaleFish, &KyraEngine_v2::seq_finaleFheep,
- &KyraEngine_v2::seq_finaleFarmer, &KyraEngine_v2::seq_finaleFuards,
- &KyraEngine_v2::seq_finaleFirates, &KyraEngine_v2::seq_finaleFrash
+ &KyraEngine_HoF::seq_introWestwood,
+ &KyraEngine_HoF::seq_introTitle, &KyraEngine_HoF::seq_introOverview,
+ &KyraEngine_HoF::seq_introLibrary, &KyraEngine_HoF::seq_introHand,
+ &KyraEngine_HoF::seq_introPoint, &KyraEngine_HoF::seq_introZanfaun,
+ &KyraEngine_HoF::seq_finaleFunters, &KyraEngine_HoF::seq_finaleFerb,
+ &KyraEngine_HoF::seq_finaleFish, &KyraEngine_HoF::seq_finaleFheep,
+ &KyraEngine_HoF::seq_finaleFarmer, &KyraEngine_HoF::seq_finaleFuards,
+ &KyraEngine_HoF::seq_finaleFirates, &KyraEngine_HoF::seq_finaleFrash
};
static const SeqProc hofNestedSequenceCallbacks[] = {
- &KyraEngine_v2::seq_finaleFiggle, &KyraEngine_v2::seq_introOver1,
- &KyraEngine_v2::seq_introOver2, &KyraEngine_v2::seq_introForest,
- &KyraEngine_v2::seq_introDragon, &KyraEngine_v2::seq_introDarm,
- &KyraEngine_v2::seq_introLibrary2, &KyraEngine_v2::seq_introLibrary2,
- &KyraEngine_v2::seq_introMarco, &KyraEngine_v2::seq_introHand1a,
- &KyraEngine_v2::seq_introHand1b, &KyraEngine_v2::seq_introHand1c,
- &KyraEngine_v2::seq_introHand2, &KyraEngine_v2::seq_introHand3, 0
+ &KyraEngine_HoF::seq_finaleFiggle, &KyraEngine_HoF::seq_introOver1,
+ &KyraEngine_HoF::seq_introOver2, &KyraEngine_HoF::seq_introForest,
+ &KyraEngine_HoF::seq_introDragon, &KyraEngine_HoF::seq_introDarm,
+ &KyraEngine_HoF::seq_introLibrary2, &KyraEngine_HoF::seq_introLibrary2,
+ &KyraEngine_HoF::seq_introMarco, &KyraEngine_HoF::seq_introHand1a,
+ &KyraEngine_HoF::seq_introHand1b, &KyraEngine_HoF::seq_introHand1c,
+ &KyraEngine_HoF::seq_introHand2, &KyraEngine_HoF::seq_introHand3, 0
};
static const SeqProc hofDemoSequenceCallbacks[] = {
- &KyraEngine_v2::seq_demoVirgin, &KyraEngine_v2::seq_demoWestwood,
- &KyraEngine_v2::seq_demoTitle, &KyraEngine_v2::seq_demoHill,
- &KyraEngine_v2::seq_demoOuthome, &KyraEngine_v2::seq_demoWharf,
- &KyraEngine_v2::seq_demoDinob, &KyraEngine_v2::seq_demoFisher, 0
+ &KyraEngine_HoF::seq_demoVirgin, &KyraEngine_HoF::seq_demoWestwood,
+ &KyraEngine_HoF::seq_demoTitle, &KyraEngine_HoF::seq_demoHill,
+ &KyraEngine_HoF::seq_demoOuthome, &KyraEngine_HoF::seq_demoWharf,
+ &KyraEngine_HoF::seq_demoDinob, &KyraEngine_HoF::seq_demoFisher, 0
};
static const SeqProc hofDemoNestedSequenceCallbacks[] = {
- &KyraEngine_v2::seq_demoWharf2, &KyraEngine_v2::seq_demoDinob2,
- &KyraEngine_v2::seq_demoWater, &KyraEngine_v2::seq_demoBail,
- &KyraEngine_v2::seq_demoDig, 0
+ &KyraEngine_HoF::seq_demoWharf2, &KyraEngine_HoF::seq_demoDinob2,
+ &KyraEngine_HoF::seq_demoWater, &KyraEngine_HoF::seq_demoBail,
+ &KyraEngine_HoF::seq_demoDig, 0
};
_callbackS = (_flags.isDemo && !_flags.isTalkie) ? hofDemoSequenceCallbacks : hofSequenceCallbacks;
@@ -1303,7 +1305,7 @@ const ScreenDim Screen_v1::_screenDimTable[] = {
const int Screen_v1::_screenDimTableCount = ARRAYSIZE(Screen_v1::_screenDimTable);
-const ScreenDim Screen_v2::_screenDimTable[] = {
+const ScreenDim Screen_HoF::_screenDimTable[] = {
{ 0x00, 0x00, 0x28, 0xC8, 0xC7, 0xCF, 0x00, 0x00 },
{ 0x08, 0x48, 0x18, 0x38, 0xC7, 0xCF, 0x00, 0x00 },
{ 0x00, 0x00, 0x28, 0x90, 0xC7, 0xCF, 0x00, 0x00 },
@@ -1318,16 +1320,16 @@ const ScreenDim Screen_v2::_screenDimTable[] = {
{ 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 } // menu, just present for current menu code
};
-const int Screen_v2::_screenDimTableCount = ARRAYSIZE(Screen_v2::_screenDimTable);
+const int Screen_HoF::_screenDimTableCount = ARRAYSIZE(Screen_HoF::_screenDimTable);
-const ScreenDim Screen_v3::_screenDimTable[] = {
+const ScreenDim Screen_MR::_screenDimTable[] = {
{ 0x00, 0x00, 0x28, 0xC8, 0xFF, 0xF0, 0x00, 0x00 },
{ 0x08, 0x48, 0x18, 0x38, 0xFF, 0xF0, 0x00, 0x00 },
{ 0x00, 0x00, 0x28, 0xBC, 0xFF, 0xF0, 0x00, 0x00 },
{ 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 }
};
-const int Screen_v3::_screenDimTableCount = ARRAYSIZE(Screen_v3::_screenDimTable);
+const int Screen_MR::_screenDimTableCount = ARRAYSIZE(Screen_MR::_screenDimTable);
const int8 KyraEngine::_addXPosTable[] = {
4, 4, 0, -4, -4, -4, 0, 4
@@ -1506,29 +1508,25 @@ const int8 KyraEngine_v1::_dosTrackMap[] = {
const int KyraEngine_v1::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v1::_dosTrackMap);
-// Kyra 2 and 3 main menu
+// kyra engine v2 static data
-const char *KyraEngine_v3::_mainMenuStrings[] = {
- "Start a new game",
- "Introduction",
- "Load a game",
- "Exit the game",
- "Nouvelle Partie",
- "Introduction",
- "Charger une partie",
- "Quitter le jeu",
- "Neues Spiel starten",
- "Intro",
- "Spielstand laden",
- "Spiel beenden",
- 0
+const int8 KyraEngine_v2::_updateCharPosXTable[] = {
+ 0, 4, 4, 4, 0, -4, -4, -4
+};
+
+const int8 KyraEngine_v2::_updateCharPosYTable[] = {
+ -2, -2, 0, 2, 2, 2, 0, -2
+};
+
+const int GUI_v2::_sliderBarsPosition[] = {
+ 0x92, 0x1F, 0x92, 0x30, 0x92, 0x41, 0x92, 0x52
};
// kyra 2 static res
-const uint8 KyraEngine_v2::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f };
+const uint8 KyraEngine_HoF::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f };
-const char *KyraEngine_v2::_languageExtension[] = {
+const char *KyraEngine_HoF::_languageExtension[] = {
"ENG",
"FRE",
"GER",/*,
@@ -1537,7 +1535,7 @@ const char *KyraEngine_v2::_languageExtension[] = {
"JPN"
};
-const char *KyraEngine_v2::_scriptLangExt[] = {
+const char *KyraEngine_HoF::_scriptLangExt[] = {
"EMC",
"FMC",
"GMC",/*,
@@ -1546,19 +1544,19 @@ const char *KyraEngine_v2::_scriptLangExt[] = {
"JMC"
};
-const int KyraEngine_v2::_characterFrameTable[] = {
+const uint8 KyraEngine_HoF::_characterFrameTable[] = {
0x19, 0x09, 0x09, 0x12, 0x12, 0x12, 0x09, 0x09
};
-const int KyraEngine_v2::_inventoryX[] = {
+const int KyraEngine_HoF::_inventoryX[] = {
0x4F, 0x63, 0x77, 0x8B, 0x9F, 0x4F, 0x63, 0x77, 0x8B, 0x9F
};
-const int KyraEngine_v2::_inventoryY[] = {
+const int KyraEngine_HoF::_inventoryY[] = {
0x95, 0x95, 0x95, 0x95, 0x95, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA
};
-const byte KyraEngine_v2::_itemStringMap[] = {
+const byte KyraEngine_HoF::_itemStringMap[] = {
2, 2, 0, 0, 2, 2, 2, 0,
2, 2, 0, 0, 0, 2, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0,
@@ -1583,9 +1581,9 @@ const byte KyraEngine_v2::_itemStringMap[] = {
0, 2, 0, 0, 0, 0, 0, 0
};
-const int KyraEngine_v2::_itemStringMapSize = ARRAYSIZE(KyraEngine_v2::_itemStringMap);
+const int KyraEngine_HoF::_itemStringMapSize = ARRAYSIZE(KyraEngine_HoF::_itemStringMap);
-const int8 KyraEngine_v2::_dosTrackMap[] = {
+const int8 KyraEngine_HoF::_dosTrackMap[] = {
-1, 0, -1, 1, 9, 6, 5, 4,
8, 3, -2, 0, -2, 0, 2, 3,
-2, 0, -2, 0, -2, 0, -2, 0,
@@ -1610,30 +1608,30 @@ const int8 KyraEngine_v2::_dosTrackMap[] = {
4, 3, 4, 4, 4, 5, 4, 6
};
-const int KyraEngine_v2::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v2::_dosTrackMap);
+const int KyraEngine_HoF::_dosTrackMapSize = ARRAYSIZE(KyraEngine_HoF::_dosTrackMap);
-void KyraEngine_v2::initInventoryButtonList() {
+void KyraEngine_HoF::initInventoryButtonList() {
delete [] _inventoryButtons;
_inventoryButtons = new Button[15];
assert(_inventoryButtons);
GUI_V2_BUTTON(_inventoryButtons[0], 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_v2, _gui, &GUI_v2::optionsButton);
+ _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_HoF, _gui, &GUI_HoF::optionsButton);
GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronButton);
+ _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronButton);
GUI_V2_BUTTON(_inventoryButtons[2], 0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronClearButton);
+ _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronClearButton);
GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookButton);
+ _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookButton);
GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::scrollInventory);
+ _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::scrollInventory);
- Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::buttonInventory);
+ Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::buttonInventory);
GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
@@ -1653,7 +1651,7 @@ void KyraEngine_v2::initInventoryButtonList() {
_buttonList = _gui->addButtonToList(_buttonList, &_inventoryButtons[i]);
}
-void GUI_v2::initStaticData() {
+void GUI_HoF::initStaticData() {
GUI_V2_BUTTON(_scrollUpButton, 0x17, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
GUI_V2_BUTTON(_scrollDownButton, 0x18, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
@@ -1671,11 +1669,11 @@ void GUI_v2::initStaticData() {
GUI_V2_BUTTON(_menuButtons[i], 0x10+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
}
- Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::clickLoadSlot);
- Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::clickSaveSlot);
- Button::Callback clickLoadMenuFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::loadMenu);
- Button::Callback clickQuitGameFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::quitGame);
- Button::Callback clickQuitOptionsFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::quitOptionsMenu);
+ Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickLoadSlot);
+ Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickSaveSlot);
+ Button::Callback clickLoadMenuFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::loadMenu);
+ Button::Callback clickQuitGameFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::quitGame);
+ Button::Callback clickQuitOptionsFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::quitOptionsMenu);
const uint16 *menuStr = _vm->gameFlags().isTalkie ? _menuStringsTalkie : _menuStringsOther;
@@ -1683,17 +1681,17 @@ void GUI_v2::initStaticData() {
GUI_V2_MENU_ITEM(_mainMenu.item[0], 1, 0x02, -1, 0x1E, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
_mainMenu.item[0].callback = clickLoadMenuFunctor;
GUI_V2_MENU_ITEM(_mainMenu.item[1], 1, 0x03, -1, 0x2F, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _mainMenu.item[1].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::saveMenu);
+ _mainMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::saveMenu);
GUI_V2_MENU_ITEM(_mainMenu.item[2], 1, 0x23, -1, 0x40, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _mainMenu.item[2].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::deleteMenu);
+ _mainMenu.item[2].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::deleteMenu);
GUI_V2_MENU_ITEM(_mainMenu.item[3], 1, 0x04, -1, 0x51, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::gameOptionsTalkie);
+ _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::gameOptionsTalkie);
GUI_V2_MENU_ITEM(_mainMenu.item[4], 1, 0x25, -1, 0x62, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _mainMenu.item[4].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::audioOptions);
+ _mainMenu.item[4].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::audioOptions);
GUI_V2_MENU_ITEM(_mainMenu.item[5], 1, 0x05, -1, 0x73, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
_mainMenu.item[5].callback = clickQuitGameFunctor;
GUI_V2_MENU_ITEM(_mainMenu.item[6], 1, 0x06, -1, 0x90, 0xDC, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _mainMenu.item[6].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::resumeGame);
+ _mainMenu.item[6].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::resumeGame);
for (int i = 0; i < 7; ++i)
_mainMenu.item[i].itemId = menuStr[0 * 8 + i + 1];
@@ -1703,7 +1701,7 @@ void GUI_v2::initStaticData() {
_mainMenu.item[6].enabled = false;
for (int i = 4; i < 6; ++i)
_mainMenu.item[i].callback = _mainMenu.item[i+1].callback;
- _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::gameOptions);
+ _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::gameOptions);
_mainMenu.item[6].callback = Button::Callback();
_mainMenu.item[5].y = 0x7F;
}
@@ -1711,11 +1709,11 @@ void GUI_v2::initStaticData() {
GUI_V2_MENU(_gameOptions, -1, -1, 0x120, 0x88, 0xF8, 0xF9, 0xFA, menuStr[1 * 8], 0xFB, -1, 8, 4, 4, -1, -1, -1, -1);
if (_vm->gameFlags().isTalkie) {
GUI_V2_MENU_ITEM(_gameOptions.item[0], 1, 0, 0xA0, 0x1E, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x15, 8, 0x20, 0);
- _gameOptions.item[0].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::toggleWalkspeed);
+ _gameOptions.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::toggleWalkspeed);
GUI_V2_MENU_ITEM(_gameOptions.item[1], 1, 0, 0xA0, 0x2F, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x26, 8, 0x31, 0);
- _gameOptions.item[1].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::changeLanguage);
+ _gameOptions.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::changeLanguage);
GUI_V2_MENU_ITEM(_gameOptions.item[2], 1, 0, 0xA0, 0x40, 0x74, 0x0F, 0xFC, 0xFD, 5, 0xF8, 0xF9, 0xFA, -1, 0x16, 8, 0x42, 0);
- _gameOptions.item[2].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::toggleText);
+ _gameOptions.item[2].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::toggleText);
GUI_V2_MENU_ITEM(_gameOptions.item[3], 1, 0x10, -1, 0x6E, 0x6C, 0x0F, 0xFD, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
_gameOptions.item[3].callback = clickQuitOptionsFunctor;
} else {
@@ -1746,9 +1744,9 @@ void GUI_v2::initStaticData() {
GUI_V2_MENU(_choiceMenu, -1, -1, 0x140, 0x38, 0xF8, 0xF9, 0xFA, 0, 0xFE, -1, 8, 0, 2, -1, -1, -1, -1);
GUI_V2_MENU_ITEM(_choiceMenu.item[0], 1, 0x14, 0x18, 0x1E, 0x48, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _choiceMenu.item[0].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::choiceYes);
+ _choiceMenu.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::choiceYes);
GUI_V2_MENU_ITEM(_choiceMenu.item[1], 1, 0x13, 0xD8, 0x1E, 0x48, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _choiceMenu.item[1].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::choiceNo);
+ _choiceMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::choiceNo);
for (int i = 2; i <= 6; ++i)
_choiceMenu.item[i].enabled = false;
for (int i = 0; i < 7; ++i)
@@ -1763,7 +1761,7 @@ void GUI_v2::initStaticData() {
for (int i = 0; i <= 4; ++i)
_loadMenu.item[i].callback = clickLoadSlotFunctor;
GUI_V2_MENU_ITEM(_loadMenu.item[5], 1, 0x0B, 0xB8, 0x86, 0x58, 0xF, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _loadMenu.item[5].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::cancelLoadMenu);
+ _loadMenu.item[5].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelLoadMenu);
_loadMenu.item[6].enabled = false;
for (int i = 0; i < 7; ++i)
_loadMenu.item[i].itemId = menuStr[4 * 8 + i + 1];
@@ -1777,16 +1775,16 @@ void GUI_v2::initStaticData() {
for (int i = 0; i <= 4; ++i)
_saveMenu.item[i].callback = clickSaveSlotFunctor;
GUI_V2_MENU_ITEM(_saveMenu.item[5], 1, 0x0B, 0xB8, 0x86, 0x58, 0xF, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _saveMenu.item[5].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::cancelSaveMenu);
+ _saveMenu.item[5].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelSaveMenu);
_saveMenu.item[6].enabled = false;
for (int i = 0; i < 7; ++i)
_saveMenu.item[i].itemId = menuStr[5 * 8 + i + 1];
GUI_V2_MENU(_savenameMenu, -1, -1, 0x140, 0x43, 0xF8, 0xF9, 0xFA, menuStr[6 * 8], 0xFB, -1, 8, 0, 2, -1, -1, -1, -1);
GUI_V2_MENU_ITEM(_savenameMenu.item[0], 1, 0xD, 0x18, 0x2C, 0x58, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _savenameMenu.item[0].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::finishSavename);
+ _savenameMenu.item[0].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::finishSavename);
GUI_V2_MENU_ITEM(_savenameMenu.item[1], 1, 0xB, 0xD0, 0x2C, 0x58, 0x0F, 0xFC, 0xFD, -1, 0xF8, 0xF9, 0xFA, -1, 0, 0, 0, 0);
- _savenameMenu.item[1].callback = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::cancelSavename);
+ _savenameMenu.item[1].callback = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::cancelSavename);
for (int i = 2; i <= 6; ++i)
_savenameMenu.item[i].enabled = false;
for (int i = 0; i < 7; ++i)
@@ -1803,7 +1801,7 @@ void GUI_v2::initStaticData() {
_deathMenu.item[i].itemId = menuStr[7 * 8 + i + 1];
}
-const uint16 GUI_v2::_menuStringsTalkie[] = {
+const uint16 GUI_HoF::_menuStringsTalkie[] = {
0x001, 0x002, 0x003, 0x023, 0x004, 0x025, 0x005, 0x006, // Main Menu String IDs
0x025, 0x000, 0x000, 0x000, 0x010, 0x000, 0x000, 0x000, // Options Menu String IDs
0x007, 0x000, 0x000, 0x000, 0x010, 0x000, 0x000, 0x000, // Audio Menu String IDs
@@ -1814,7 +1812,7 @@ const uint16 GUI_v2::_menuStringsTalkie[] = {
0x00E, 0x002, 0x005, 0x000, 0x000, 0x000, 0x000, 0x000 // Death Menu String IDs
};
-const uint16 GUI_v2::_menuStringsOther[] = {
+const uint16 GUI_HoF::_menuStringsOther[] = {
0x009, 0x00A, 0x00B, 0x001, 0x00C, 0x00D, 0x00E, 0x000, // Main Menu String IDs
0x00F, 0x02B, 0x02C, 0x02D, 0x02E, 0x018, 0x000, 0x000, // Options Menu String IDs
0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, // Dummy
@@ -1825,11 +1823,7 @@ const uint16 GUI_v2::_menuStringsOther[] = {
0x016, 0x00A, 0x00D, 0x000, 0x000, 0x000, 0x000, 0x000 // Death Menu String IDs
};
-const int GUI_v2::_sliderBarsPosition[] = {
- 0x92, 0x1F, 0x92, 0x30, 0x92, 0x41, 0x92, 0x52
-};
-
-const uint16 KyraEngine_v2::_itemMagicTable[] = {
+const uint16 KyraEngine_HoF::_itemMagicTable[] = {
0x0D, 0x0A, 0x0B, 0,
0x0D, 0x0B, 0x0A, 0,
0x0D, 0x38, 0x37, 0,
@@ -1861,17 +1855,17 @@ const uint16 KyraEngine_v2::_itemMagicTable[] = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
};
-const int KyraEngine_v2::_bookPageYOffset[] = {
+const int KyraEngine_HoF::_bookPageYOffset[] = {
0, 0, 2, 2,
0, 0, 2, 2,
0, 0, 2, 2
};
-const byte KyraEngine_v2::_bookTextColorMap[] = {
+const byte KyraEngine_HoF::_bookTextColorMap[] = {
0x00, 0xC7, 0xCF, 0x00
};
-const int16 KyraEngine_v2::_cauldronProtectedItems[] = {
+const int16 KyraEngine_HoF::_cauldronProtectedItems[] = {
0x07, 0x0D, 0x47, 0x48,
0x29, 0x1A, 0x1C, 0x6D,
0x4D, 0x3A, 0x0E, 0x0F,
@@ -1882,7 +1876,7 @@ const int16 KyraEngine_v2::_cauldronProtectedItems[] = {
0x8A, 0x79, 0x61, -1
};
-const int16 KyraEngine_v2::_cauldronBowlTable[] = {
+const int16 KyraEngine_HoF::_cauldronBowlTable[] = {
0x0027, 0x0029,
0x0028, 0x0029,
0x0033, 0x0029,
@@ -1895,7 +1889,7 @@ const int16 KyraEngine_v2::_cauldronBowlTable[] = {
-1, -1
};
-const int16 KyraEngine_v2::_cauldronMagicTable[] = {
+const int16 KyraEngine_HoF::_cauldronMagicTable[] = {
0x0, 0x16, 0x2, 0x1A,
0x7, 0xA4, 0x5, 0x4D,
0x1, 0xA5, 0x3, 0xA6,
@@ -1904,7 +1898,7 @@ const int16 KyraEngine_v2::_cauldronMagicTable[] = {
0x9, 0xAC, -1, -1
};
-const int16 KyraEngine_v2::_cauldronMagicTableScene77[] = {
+const int16 KyraEngine_HoF::_cauldronMagicTableScene77[] = {
0x0, 0x16, 0x2, 0x1A,
0x7, 0xAB, 0x5, 0x4D,
0x1, 0xAE, 0x3, 0xAF,
@@ -1913,18 +1907,18 @@ const int16 KyraEngine_v2::_cauldronMagicTableScene77[] = {
0x9, 0xAC, -1, -1
};
-const uint8 KyraEngine_v2::_cauldronStateTable[] = {
+const uint8 KyraEngine_HoF::_cauldronStateTable[] = {
3, 1, 3, 1, 1, 4, 4, 2,
3, 1, 1, 3, 1, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3
};
-const int16 KyraEngine_v2::_flaskTable[] = {
+const int16 KyraEngine_HoF::_flaskTable[] = {
0x19, 0x14, 0x15, 0x16, 0x17, 0x18, 0x34,
0x1B, 0x39, 0x1A, 0x3A, 0x4D, 0x72, -1
};
-const uint8 KyraEngine_v2::_rainbowRoomData[] = {
+const uint8 KyraEngine_HoF::_rainbowRoomData[] = {
0x02, 0xA9, 0x9E, 0x75, 0x73, 0x17, 0x00, 0xA0,
0x08, 0x01, 0x19, 0x9F, 0x66, 0x05, 0x22, 0x7D,
0x20, 0x25, 0x1D, 0x64, 0xA0, 0x78, 0x85, 0x3B,
@@ -1938,7 +1932,23 @@ const uint8 KyraEngine_v2::_rainbowRoomData[] = {
// kyra 3 static res
-const char *KyraEngine_v3::_soundList[] = {
+const char *KyraEngine_MR::_mainMenuStrings[] = {
+ "Start a new game",
+ "Introduction",
+ "Load a game",
+ "Exit the game",
+ "Nouvelle Partie",
+ "Introduction",
+ "Charger une partie",
+ "Quitter le jeu",
+ "Neues Spiel starten",
+ "Intro",
+ "Spielstand laden",
+ "Spiel beenden",
+ 0
+};
+
+const char *KyraEngine_MR::_soundList[] = {
"ARREST1.AUD",
"BATH1.AUD",
"OCEAN1.AUD",
@@ -1983,9 +1993,9 @@ const char *KyraEngine_v3::_soundList[] = {
"SQUIRL1.AUD"
};
-const int KyraEngine_v3::_soundListSize = ARRAYSIZE(KyraEngine_v3::_soundList);
+const int KyraEngine_MR::_soundListSize = ARRAYSIZE(KyraEngine_MR::_soundList);
-const char *KyraEngine_v3::_languageExtension[] = {
+const char *KyraEngine_MR::_languageExtension[] = {
"TRE",
"TRF",
"TRG"/*,
@@ -1993,9 +2003,9 @@ const char *KyraEngine_v3::_languageExtension[] = {
"TRS"*/
};
-const int KyraEngine_v3::_languageExtensionSize = ARRAYSIZE(KyraEngine_v3::_languageExtension);
+const int KyraEngine_MR::_languageExtensionSize = ARRAYSIZE(KyraEngine_MR::_languageExtension);
-const KyraEngine_v3::ShapeDesc KyraEngine_v3::_shapeDescs[] = {
+const KyraEngine_MR::ShapeDesc KyraEngine_MR::_shapeDescs[] = {
{ 57, 91, -31, -82 },
{ 57, 91, -31, -82 },
{ 57, 91, -31, -82 },
@@ -2010,21 +2020,13 @@ const KyraEngine_v3::ShapeDesc KyraEngine_v3::_shapeDescs[] = {
{ 57, 91, -31, -82 }
};
-const int KyraEngine_v3::_shapeDescsSize = ARRAYSIZE(KyraEngine_v3::_shapeDescs);
-
-const int8 KyraEngine_v3::_updateCharPosXTable[] = {
- 0, 4, 4, 4, 0, -4, -4, -4
-};
-
-const int8 KyraEngine_v3::_updateCharPosYTable[] = {
- -2, -2, 0, 2, 2, 2, 0, -2
-};
+const int KyraEngine_MR::_shapeDescsSize = ARRAYSIZE(KyraEngine_MR::_shapeDescs);
-const uint8 KyraEngine_v3::_characterFrameTable[] = {
+const uint8 KyraEngine_MR::_characterFrameTable[] = {
0x36, 0x35, 0x35, 0x33, 0x32, 0x32, 0x34, 0x34
};
-const uint8 KyraEngine_v3::_sfxFileMap[] = {
+const uint8 KyraEngine_MR::_sfxFileMap[] = {
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x99, 0x00,
@@ -2103,9 +2105,9 @@ const uint8 KyraEngine_v3::_sfxFileMap[] = {
0x23, 0x00, 0x97, 0x00, 0x73, 0x00
};
-const int KyraEngine_v3::_sfxFileMapSize = ARRAYSIZE(KyraEngine_v3::_sfxFileMap);
+const int KyraEngine_MR::_sfxFileMapSize = ARRAYSIZE(KyraEngine_MR::_sfxFileMap);
-const char *KyraEngine_v3::_sfxFileList[] = {
+const char *KyraEngine_MR::_sfxFileList[] = {
"ALARM1",
"ARMOIRE1",
"ARROW1",
@@ -2332,9 +2334,9 @@ const char *KyraEngine_v3::_sfxFileList[] = {
"ZIPPER1"
};
-const int KyraEngine_v3::_sfxFileListSize = ARRAYSIZE(KyraEngine_v3::_sfxFileList);
+const int KyraEngine_MR::_sfxFileListSize = ARRAYSIZE(KyraEngine_MR::_sfxFileList);
-const uint8 KyraEngine_v3::_badConscienceFrameTable[] = {
+const uint8 KyraEngine_MR::_badConscienceFrameTable[] = {
0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
0x13, 0x13, 0x13, 0x10, 0x13, 0x13, 0x13, 0x13,
0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
@@ -2342,31 +2344,39 @@ const uint8 KyraEngine_v3::_badConscienceFrameTable[] = {
0x24, 0x24, 0x24, 0x24, 0x24, 0x1D, 0x1D, 0x1D
};
-const uint8 KyraEngine_v3::_chapterLowestScene[] = {
+const uint8 KyraEngine_MR::_goodConscienceFrameTable[] = {
+ 0x13, 0x13, 0x13, 0x13, 0x13,
+ 0x13, 0x13, 0x13, 0x13, 0x13,
+ 0x13, 0x13, 0x13, 0x13, 0x13,
+ 0x15, 0x15, 0x15, 0x15, 0x15,
+ 0x1E, 0x1E, 0x1E, 0x1E, 0x1E
+};
+
+const uint8 KyraEngine_MR::_chapterLowestScene[] = {
0x00, 0x00, 0x19, 0x2B, 0x33, 0x3B
};
-const uint8 KyraEngine_v3::_vocHighTable[] = {
+const uint8 KyraEngine_MR::_vocHighTable[] = {
0x64, 0x76, 0x82, 0x83, 0x92
};
-const uint8 KyraEngine_v3::_inventoryX[] = {
+const uint8 KyraEngine_MR::_inventoryX[] = {
0x45, 0x61, 0x7D, 0x99, 0xB5,
0x45, 0x61, 0x7D, 0x99, 0xB5
};
-const uint8 KyraEngine_v3::_inventoryY[] = {
+const uint8 KyraEngine_MR::_inventoryY[] = {
0x9C, 0x9C, 0x9C, 0x9C, 0x9C,
0xB2, 0xB2, 0xB2, 0xB2, 0xB2
};
-const uint8 KyraEngine_v3::_trashItemList[] = {
+const uint8 KyraEngine_MR::_trashItemList[] = {
0x1E, 0x1D, 0x1C, 0x1F, 0x0F, 0x05, 0x04, 0x00,
0x03, 0x22, 0x0B, 0x20, 0x21, 0x10, 0x11, 0x3A,
0x39, 0x40, 0x3E, 0x3D, 0x3C, 0x3F, 0xFF
};
-const uint8 KyraEngine_v3::_itemMagicTable[] = {
+const uint8 KyraEngine_MR::_itemMagicTable[] = {
0x06, 0x05, 0x07, 0xFE, 0x05, 0x06, 0x07, 0xFE,
0x03, 0x00, 0x22, 0xFE, 0x00, 0x03, 0x22, 0xFE,
0x10, 0x00, 0x20, 0x0F, 0x00, 0x10, 0x0F, 0x20,
@@ -2374,7 +2384,7 @@ const uint8 KyraEngine_v3::_itemMagicTable[] = {
0xFF, 0xFF, 0xFF, 0xFF
};
-const uint8 KyraEngine_v3::_itemStringMap[] = {
+const uint8 KyraEngine_MR::_itemStringMap[] = {
1, 0, 2, 0, 2, 2, 0, 0,
2, 2, 2, 2, 2, 2, 2, 0,
0, 0, 0, 0, 0, 0, 3, 1,
@@ -2386,19 +2396,201 @@ const uint8 KyraEngine_v3::_itemStringMap[] = {
0, 0, 0, 0, 2, 0, 0, 2
};
-const uint KyraEngine_v3::_itemStringMapSize = ARRAYSIZE(KyraEngine_v3::_itemStringMap);
+const uint KyraEngine_MR::_itemStringMapSize = ARRAYSIZE(KyraEngine_MR::_itemStringMap);
-const uint8 KyraEngine_v3::_itemStringPickUp[] = {
+const uint8 KyraEngine_MR::_itemStringPickUp[] = {
0x4, 0x7, 0x0, 0xA
};
-const uint8 KyraEngine_v3::_itemStringDrop[] = {
+const uint8 KyraEngine_MR::_itemStringDrop[] = {
0x5, 0x8, 0x1, 0xB
};
-const uint8 KyraEngine_v3::_itemStringInv[] = {
+const uint8 KyraEngine_MR::_itemStringInv[] = {
0x6, 0x9, 0x2, 0xC
};
+const int8 KyraEngine_MR::_scoreTable[] = {
+ 10, 8, 5, 9, 10, 10, 7, 8,
+ 9, 9, 8, 8, 7, 8, 5, 9,
+ 6, 10, 7, 8, 5, 9, 6, 6,
+ 7, 8, 5, 9, 6, 8, 7, 8,
+ 5, 9, 6, 10, 7, 8, 5, 5,
+ 5, 7, 5, 7, 10, 5, 10, 5,
+ 5, 8, 6, 8, 7, 5, 5, 8,
+ 6, 9, 5, 7, 6, 5, 5, 7,
+ 7, 7, 6, 5, 8, 6, 10, 5,
+ 7, 5, 10, 5, 5, 5, 5, 7,
+ 5, 8, 9, 7, 7, 6, 10, 6,
+ 5, 10, 8, 5, 8, 6, 10, 5,
+ 5, 8, 8, 5, 7, 7, 7, 6,
+ 8, 9, 8, 8, 6, 5, 7, 6,
+ 5, 8, 15, 7, 9, 6, 6, 8,
+ 5, 8, 15, 15, 5, 15, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+const int KyraEngine_MR::_scoreTableSize = ARRAYSIZE(KyraEngine_MR::_scoreTable);
+
+void KyraEngine_MR::initMainButtonList(bool disable) {
+ if (!_mainButtonListInitialized) {
+ _mainButtonData = new Button[14];
+ assert(_mainButtonData);
+
+ GUI_V2_BUTTON(_mainButtonData[0], 1, 0, 0, 4, 4, 4, 0x4487, 0, 5, 162, 50, 25, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[0].buttonCallback = BUTTON_FUNCTOR(GUI_MR, _gui, &GUI_MR::optionsButton);
+ GUI_V2_BUTTON(_mainButtonData[1], 2, 0, 0, 1, 1, 1, 0x4487, 0, 245, 156, 69, 33, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonMoodChange);
+ GUI_V2_BUTTON(_mainButtonData[2], 3, 0, 0, 1, 1, 1, 0x4487, 0, 215, 191, 24, 9, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonShowScore);
+ GUI_V2_BUTTON(_mainButtonData[3], 4, 0, 0, 1, 1, 1, 0x4487, 0, 215, 155, 25, 36, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonJesterStaff);
+
+ Button::Callback buttonInventoryFunctor = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonInventory);
+ for (int i = 0; i < 5; ++i) {
+ GUI_V2_BUTTON(_mainButtonData[i+4], i+5, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 155, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[i+4].buttonCallback = buttonInventoryFunctor;
+ }
+
+ for (int i = 0; i < 5; ++i) {
+ GUI_V2_BUTTON(_mainButtonData[i+9], i+10, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 177, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ _mainButtonData[i+9].buttonCallback = buttonInventoryFunctor;
+ }
+
+ for (int i = 0; i < 14; ++i)
+ _mainButtonList = _gui->addButtonToList(_mainButtonList, &_mainButtonData[i]);
+
+ _mainButtonListInitialized = true;
+ }
+
+ for (int i = 0; i < 14; ++i) {
+ if (disable)
+ _gui->flagButtonDisable(&_mainButtonData[i]);
+ else
+ _gui->flagButtonEnable(&_mainButtonData[i]);
+ }
+}
+
+void GUI_MR::initStaticData() {
+ GUI_V2_BUTTON(_scrollUpButton, 22, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ GUI_V2_BUTTON(_scrollDownButton, 23, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+
+ for (int i = 0; i < 4; ++i) {
+ GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ }
+ for (int i = 0; i < 4; ++i) {
+ GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ }
+ for (int i = 0; i < 4; ++i) {
+ GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ }
+
+ for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
+ GUI_V2_BUTTON(_menuButtons[i], 0x0F+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ }
+
+ Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickLoadSlot);
+ Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickSaveSlot);
+ Button::Callback clickLoadMenuFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::loadMenu);
+ Button::Callback clickQuitOptionsFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::quitOptionsMenu);
+
+ GUI_V2_MENU(_mainMenu, -1, -1, 256, 172, 0xD0, 0xD1, 0xCF, 1, 0xBD, -1, 8, 0, 7, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_mainMenu.item[0], 1, 2, -1, 30, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[0].callback = clickLoadMenuFunctor;
+ GUI_V2_MENU_ITEM(_mainMenu.item[1], 1, 3, -1, 47, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::saveMenu);
+ GUI_V2_MENU_ITEM(_mainMenu.item[2], 1, 35, -1, 64, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[2].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::deleteMenu);
+ GUI_V2_MENU_ITEM(_mainMenu.item[3], 1, 4, -1, 81, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::gameOptions);
+ GUI_V2_MENU_ITEM(_mainMenu.item[4], 1, 37, -1, 98, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[4].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::audioOptions);
+ GUI_V2_MENU_ITEM(_mainMenu.item[5], 1, 5, -1, 115, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::quitGame);
+ GUI_V2_MENU_ITEM(_mainMenu.item[6], 1, 6, -1, 144, 220, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _mainMenu.item[6].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::resumeGame);
+
+ GUI_V2_MENU(_audioOptions, -1, -1, 288, 136, 0xD0, 0xD1, 0xCF, 37, 0xBD, -1, 8, 4, 5, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_audioOptions.item[0], 0, 0, 160, 30, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 23, 8, 32, 0x0000);
+ GUI_V2_MENU_ITEM(_audioOptions.item[1], 0, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 24, 8, 49, 0x0000);
+ GUI_V2_MENU_ITEM(_audioOptions.item[2], 0, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 39, 8, 66, 0x0000);
+ GUI_V2_MENU_ITEM(_audioOptions.item[3], 1, 0, 152, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 47, 8, 83, 0x0000);
+ GUI_V2_MENU_ITEM(_audioOptions.item[4], 1, 16, -1, 110, 92, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _audioOptions.item[4].callback = clickQuitOptionsFunctor;
+ for (int i = 5; i < 7; ++i)
+ _audioOptions.item[i].enabled = false;
+
+ GUI_V2_MENU(_gameOptions, -1, -1, 288, 154, 0xD0, 0xD1, 0xCF, 7, 0xBD, -1, 8, 0, 6, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_gameOptions.item[0], 1, 0, 160, 30, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 21, 8, 32, 0x0000);
+ _gameOptions.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleWalkspeed);
+ GUI_V2_MENU_ITEM(_gameOptions.item[1], 1, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 26, 8, 49, 0x0000);
+ _gameOptions.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::changeLanguage);
+ GUI_V2_MENU_ITEM(_gameOptions.item[2], 1, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 40, 8, 66, 0x0000);
+ _gameOptions.item[2].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleStudioSFX);
+ GUI_V2_MENU_ITEM(_gameOptions.item[3], 1, 0, 160, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 46, 8, 83, 0x0000);
+ _gameOptions.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleSkipSupport);
+ GUI_V2_MENU_ITEM(_gameOptions.item[4], 1, 0, 160, 98, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 22, 8, 100, 0x0000);
+ _gameOptions.item[4].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleText);
+ GUI_V2_MENU_ITEM(_gameOptions.item[5], 1, 16, -1, 127, 125, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _gameOptions.item[5].callback = clickQuitOptionsFunctor;
+ _gameOptions.item[6].enabled = false;
+
+ GUI_V2_MENU(_choiceMenu, -1, -1, 320, 56, 0xD0, 0xD1, 0xCF, 0, 0xBA, -1, 8, 0, 2, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_choiceMenu.item[0], 1, 20, 24, 30, 72, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _choiceMenu.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::choiceYes);
+ GUI_V2_MENU_ITEM(_choiceMenu.item[1], 1, 19, 216, 30, 72, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _choiceMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::choiceNo);
+ for (int i = 2; i < 7; ++i)
+ _choiceMenu.item[i].enabled = false;
+
+ GUI_V2_MENU(_loadMenu, -1, -1, 288, 160, 0xD0, 0xD1, 0xCF, 8, 0xBD, -1, 8, 0, 6, 132, 22, 132, 124);
+ GUI_V2_MENU_ITEM(_loadMenu.item[0], 1, 41, -1, 39, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_loadMenu.item[1], 1, 42, -1, 56, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_loadMenu.item[2], 1, 43, -1, 73, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_loadMenu.item[3], 1, 44, -1, 90, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_loadMenu.item[4], 1, 45, -1, 107, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ for (int i = 0; i <= 4; ++i)
+ _loadMenu.item[i].callback = clickLoadSlotFunctor;
+ GUI_V2_MENU_ITEM(_loadMenu.item[5], 1, 11, 184, 134, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _loadMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelLoadMenu);
+ _loadMenu.item[6].enabled = false;
+
+ GUI_V2_MENU(_saveMenu, -1, -1, 288, 160, 0xD0, 0xD1, 0xCF, 9, 0xBD, -1, 8, 0, 6, 132, 22, 132, 124);
+ GUI_V2_MENU_ITEM(_saveMenu.item[0], 1, 41, -1, 39, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_saveMenu.item[1], 1, 42, -1, 56, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_saveMenu.item[2], 1, 43, -1, 73, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_saveMenu.item[3], 1, 44, -1, 90, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ GUI_V2_MENU_ITEM(_saveMenu.item[4], 1, 45, -1, 107, 256, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ for (int i = 0; i <= 4; ++i)
+ _saveMenu.item[i].callback = clickSaveSlotFunctor;
+ GUI_V2_MENU_ITEM(_saveMenu.item[5], 1, 11, 184, 134, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _saveMenu.item[5].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelSaveMenu);
+ _saveMenu.item[6].enabled = false;
+
+ GUI_V2_MENU(_savenameMenu, -1, -1, 320, 67, 0xD0, 0xD1, 0xCF, 12, 0xBD, -1, 8, 0, 2, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_savenameMenu.item[0], 1, 13, 24, 44, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _savenameMenu.item[0].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::finishSavename);
+ GUI_V2_MENU_ITEM(_savenameMenu.item[1], 1, 11, 208, 44, 88, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _savenameMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::cancelSavename);
+ for (int i = 2; i < 7; ++i)
+ _savenameMenu.item[i].enabled = false;
+
+ GUI_V2_MENU(_deathMenu, -1, -1, 208, 76, 0xD0, 0xD1, 0xCF, 14, 0xBD, -1, 8, 0, 2, -1, -1, -1, -1);
+ GUI_V2_MENU_ITEM(_deathMenu.item[0], 1, 2, -1, 30, 180, 15, 0xFA, 0xFF, 8, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _deathMenu.item[0].callback = clickLoadMenuFunctor;
+ GUI_V2_MENU_ITEM(_deathMenu.item[1], 1, 38, -1, 47, 180, 15, 0xFA, 0xFF, 8, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
+ _deathMenu.item[1].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::loadSecondChance);
+ for (int i = 2; i < 7; ++i)
+ _deathMenu.item[i].enabled = false;
+}
+
} // End of namespace Kyra
diff --git a/engines/kyra/text_v2.cpp b/engines/kyra/text_hof.cpp
index 3dbcd8b4cc..dd1796dd02 100644
--- a/engines/kyra/text_v2.cpp
+++ b/engines/kyra/text_hof.cpp
@@ -23,8 +23,8 @@
*
*/
-#include "kyra/text_v2.h"
-#include "kyra/kyra_v2.h"
+#include "kyra/text_hof.h"
+#include "kyra/kyra_hof.h"
#include "kyra/script_tim.h"
#include "kyra/resource.h"
@@ -32,19 +32,19 @@
namespace Kyra {
-TextDisplayer_v2::TextDisplayer_v2(KyraEngine_v2 *vm, Screen_v2 *screen)
+TextDisplayer_HoF::TextDisplayer_HoF(KyraEngine_HoF *vm, Screen_v2 *screen)
: TextDisplayer(vm, screen), _vm(vm) {
}
-void TextDisplayer_v2::backupTalkTextMessageBkgd(int srcPage, int dstPage) {
+void TextDisplayer_HoF::backupTalkTextMessageBkgd(int srcPage, int dstPage) {
_screen->copyRegion(_talkCoords.x, _talkMessageY, 0, 144, _talkCoords.w, _talkMessageH, srcPage, dstPage);
}
-void TextDisplayer_v2::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
+void TextDisplayer_HoF::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
_screen->copyRegion(0, 144, _talkCoords.x, _talkMessageY, _talkCoords.w, _talkMessageH, srcPage, dstPage);
}
-void TextDisplayer_v2::restoreScreen() {
+void TextDisplayer_HoF::restoreScreen() {
_vm->restorePage3();
_vm->drawAnimObjects();
_screen->hideMouse();
@@ -54,7 +54,7 @@ void TextDisplayer_v2::restoreScreen() {
_vm->refreshAnimObjects(0);
}
-void TextDisplayer_v2::printCustomCharacterText(const char *text, int x, int y, uint8 c1, int srcPage, int dstPage) {
+void TextDisplayer_HoF::printCustomCharacterText(const char *text, int x, int y, uint8 c1, int srcPage, int dstPage) {
text = preprocessString(text);
int lineCount = buildMessageSubstrings(text);
int w = getWidestLineWidth(lineCount);
@@ -86,8 +86,8 @@ void TextDisplayer_v2::printCustomCharacterText(const char *text, int x, int y,
_screen->showMouse();
}
-char *TextDisplayer_v2::preprocessString(const char *str) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v2::preprocessString('%s')", str);
+char *TextDisplayer_HoF::preprocessString(const char *str) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_HoF::preprocessString('%s')", str);
if (str != _talkBuffer) {
assert(strlen(str) < sizeof(_talkBuffer) - 1);
@@ -129,8 +129,8 @@ char *TextDisplayer_v2::preprocessString(const char *str) {
return _talkBuffer;
}
-void TextDisplayer_v2::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v2::calcWidestLineBounds(%d, %d)", w, x);
+void TextDisplayer_HoF::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_HoF::calcWidestLineBounds(%d, %d)", w, x);
x1 = x;
x1 -= (w >> 1);
x2 = x1 + w + 1;
@@ -146,7 +146,7 @@ void TextDisplayer_v2::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
#pragma mark -
-int KyraEngine_v2::chatGetType(const char *str) {
+int KyraEngine_HoF::chatGetType(const char *str) {
str += strlen(str);
--str;
switch (*str) {
@@ -164,7 +164,7 @@ int KyraEngine_v2::chatGetType(const char *str) {
}
}
-int KyraEngine_v2::chatCalcDuration(const char *str) {
+int KyraEngine_HoF::chatCalcDuration(const char *str) {
static const uint8 durationMultiplicator[] = { 16, 14, 12, 10, 8, 8, 7, 6, 5, 4 };
int duration = strlen(str);
@@ -172,7 +172,7 @@ int KyraEngine_v2::chatCalcDuration(const char *str) {
return MAX<int>(duration, 120);
}
-void KyraEngine_v2::objectChat(const char *str, int object, int vocHigh, int vocLow) {
+void KyraEngine_HoF::objectChat(const char *str, int object, int vocHigh, int vocLow) {
setNextIdleAnimTimer();
_chatVocHigh = _chatVocLow = -1;
@@ -229,7 +229,7 @@ void KyraEngine_v2::objectChat(const char *str, int object, int vocHigh, int voc
setNextIdleAnimTimer();
}
-void KyraEngine_v2::objectChatInit(const char *str, int object, int vocHigh, int vocLow) {
+void KyraEngine_HoF::objectChatInit(const char *str, int object, int vocHigh, int vocLow) {
str = _text->preprocessString(str);
int lineNum = _text->buildMessageSubstrings(str);
@@ -276,7 +276,7 @@ void KyraEngine_v2::objectChatInit(const char *str, int object, int vocHigh, int
_screen->showMouse();
}
-void KyraEngine_v2::objectChatPrintText(const char *str, int object) {
+void KyraEngine_HoF::objectChatPrintText(const char *str, int object) {
int c1 = _talkObjectList[object].color;
str = _text->preprocessString(str);
int lineNum = _text->buildMessageSubstrings(str);
@@ -295,20 +295,20 @@ void KyraEngine_v2::objectChatPrintText(const char *str, int object) {
}
}
-void KyraEngine_v2::objectChatProcess(const char *script) {
+void KyraEngine_HoF::objectChatProcess(const char *script) {
memset(&_chatScriptData, 0, sizeof(_chatScriptData));
memset(&_chatScriptState, 0, sizeof(_chatScriptState));
- _scriptInterpreter->loadScript(script, &_chatScriptData, &_opcodesTemporary);
- _scriptInterpreter->initScript(&_chatScriptState, &_chatScriptData);
- _scriptInterpreter->startScript(&_chatScriptState, 0);
- while (_scriptInterpreter->validScript(&_chatScriptState))
- _scriptInterpreter->runScript(&_chatScriptState);
+ _emc->load(script, &_chatScriptData, &_opcodesAnimation);
+ _emc->init(&_chatScriptState, &_chatScriptData);
+ _emc->start(&_chatScriptState, 0);
+ while (_emc->isValid(&_chatScriptState))
+ _emc->run(&_chatScriptState);
- _newShapeFilename[2] = _loadedZTable + '0';
- uint8 *shapeBuffer = _res->fileData(_newShapeFilename, 0);
+ _animShapeFilename[2] = _characterShapeFile + '0';
+ uint8 *shapeBuffer = _res->fileData(_animShapeFilename, 0);
if (shapeBuffer) {
- int shapeCount = initNewShapes(shapeBuffer);
+ int shapeCount = initAnimationShapes(shapeBuffer);
if (_chatVocHigh >= 0) {
playVoice(_chatVocHigh, _chatVocLow);
@@ -317,35 +317,35 @@ void KyraEngine_v2::objectChatProcess(const char *script) {
objectChatWaitToFinish();
- resetNewShapes(shapeCount, shapeBuffer);
+ uninitAnimationShapes(shapeCount, shapeBuffer);
} else {
- warning("couldn't load file '%s'", _newShapeFilename);
+ warning("couldn't load file '%s'", _animShapeFilename);
}
- _scriptInterpreter->unloadScript(&_chatScriptData);
+ _emc->unload(&_chatScriptData);
}
-void KyraEngine_v2::objectChatWaitToFinish() {
+void KyraEngine_HoF::objectChatWaitToFinish() {
int charAnimFrame = _mainCharacter.animFrame;
- setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
+ setCharacterAnimDim(_animShapeWidth, _animShapeHeight);
- _scriptInterpreter->initScript(&_chatScriptState, &_chatScriptData);
- _scriptInterpreter->startScript(&_chatScriptState, 1);
+ _emc->init(&_chatScriptState, &_chatScriptData);
+ _emc->start(&_chatScriptState, 1);
bool running = true;
const uint32 endTime = _chatEndTime;
resetSkipFlag();
while (running && !_quitFlag) {
- if (!_scriptInterpreter->validScript(&_chatScriptState))
- _scriptInterpreter->startScript(&_chatScriptState, 1);
+ if (!_emc->isValid(&_chatScriptState))
+ _emc->start(&_chatScriptState, 1);
- _temporaryScriptExecBit = false;
- while (!_temporaryScriptExecBit && _scriptInterpreter->validScript(&_chatScriptState))
- _scriptInterpreter->runScript(&_chatScriptState);
+ _animNeedUpdate = false;
+ while (!_animNeedUpdate && _emc->isValid(&_chatScriptState))
+ _emc->run(&_chatScriptState);
- int curFrame = _newShapeAnimFrame;
- uint32 delayTime = _newShapeDelay;
+ int curFrame = _animNewFrame;
+ uint32 delayTime = _animDelayTime;
if (!_chatIsNote)
_mainCharacter.animFrame = 33 + curFrame;
@@ -373,7 +373,7 @@ void KyraEngine_v2::objectChatWaitToFinish() {
resetCharacterAnimDim();
}
-void KyraEngine_v2::startDialogue(int dlgIndex) {
+void KyraEngine_HoF::startDialogue(int dlgIndex) {
updateDlgBuffer();
int csEntry, vocH, unused1, unused2;
loadDlgHeader(csEntry, vocH, unused1, unused2);
@@ -395,7 +395,7 @@ void KyraEngine_v2::startDialogue(int dlgIndex) {
processDialogue(offs, vocH, csEntry);
}
-void KyraEngine_v2::zanthSceneStartupChat() {
+void KyraEngine_HoF::zanthSceneStartupChat() {
int lowest = _flags.isTalkie ? 6 : 5;
int tableIndex = _mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile]);
if (queryGameFlag(0x159) || _newSceneDlgState[tableIndex])
@@ -412,7 +412,7 @@ void KyraEngine_v2::zanthSceneStartupChat() {
_newSceneDlgState[tableIndex] = 1;
}
-void KyraEngine_v2::zanthRandomIdleChat() {
+void KyraEngine_HoF::randomSceneChat() {
int lowest = _flags.isTalkie ? 6 : 5;
int tableIndex = (_mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile])) << 2;
if (queryGameFlag(0x164))
@@ -434,7 +434,7 @@ void KyraEngine_v2::zanthRandomIdleChat() {
processDialogue(offs, vocH, csEntry);
}
-void KyraEngine_v2::updateDlgBuffer() {
+void KyraEngine_HoF::updateDlgBuffer() {
static const char suffixTalkie[] = "EFG";
static const char suffixTowns[] = "G J";
@@ -457,14 +457,14 @@ void KyraEngine_v2::updateDlgBuffer() {
_dlgBuffer = _res->fileData(filename, 0);
}
-void KyraEngine_v2::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) {
+void KyraEngine_HoF::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) {
csEntry = READ_LE_UINT16(_dlgBuffer);
vocH = READ_LE_UINT16(_dlgBuffer + 2);
scIndex1 = READ_LE_UINT16(_dlgBuffer + 4);
scIndex2 = READ_LE_UINT16(_dlgBuffer + 6);
}
-void KyraEngine_v2::processDialogue(int dlgOffset, int vocH, int csEntry) {
+void KyraEngine_HoF::processDialogue(int dlgOffset, int vocH, int csEntry) {
int activeTimSequence = -1;
int nextTimSequence = -1;
int cmd = 0;
@@ -512,7 +512,7 @@ void KyraEngine_v2::processDialogue(int dlgOffset, int vocH, int csEntry) {
} else if (cmd == 4) {
csEntry = READ_LE_UINT16(_dlgBuffer + offs);
- setNewDlgIndex(csEntry);
+ setDlgIndex(csEntry);
offs += 2;
} else {
@@ -569,7 +569,7 @@ void KyraEngine_v2::processDialogue(int dlgOffset, int vocH, int csEntry) {
_screen->showMouse();
}
-void KyraEngine_v2::initTalkObject(int index) {
+void KyraEngine_HoF::initTalkObject(int index) {
TalkObject &object = _talkObjectList[index];
char STAFilename[13];
@@ -605,7 +605,7 @@ void KyraEngine_v2::initTalkObject(int index) {
}
}
-void KyraEngine_v2::deinitTalkObject(int index) {
+void KyraEngine_HoF::deinitTalkObject(int index) {
TalkObject &object = _talkObjectList[index];
if (_currentTalkSections.ENDTim) {
@@ -628,7 +628,7 @@ void KyraEngine_v2::deinitTalkObject(int index) {
_tim->unload(_currentTalkSections.ENDTim);
}
-void KyraEngine_v2::npcChatSequence(const char *str, int objectId, int vocHigh, int vocLow) {
+void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh, int vocLow) {
_chatText = str;
_chatObject = objectId;
objectChatInit(str, objectId, vocHigh, vocLow);
@@ -677,7 +677,7 @@ void KyraEngine_v2::npcChatSequence(const char *str, int objectId, int vocHigh,
setNextIdleAnimTimer();
}
-void KyraEngine_v2::setNewDlgIndex(int dlgIndex) {
+void KyraEngine_HoF::setDlgIndex(int dlgIndex) {
if (dlgIndex == _mainCharacter.dlgIndex)
return;
memset(_newSceneDlgState, 0, 32);
diff --git a/engines/kyra/text_v2.h b/engines/kyra/text_hof.h
index 6b8cf5d38e..ef1f481c19 100644
--- a/engines/kyra/text_v2.h
+++ b/engines/kyra/text_hof.h
@@ -31,12 +31,12 @@
namespace Kyra {
class Screen_v2;
-class KyraEngine_v2;
+class KyraEngine_HoF;
-class TextDisplayer_v2 : public TextDisplayer {
-friend class KyraEngine_v2;
+class TextDisplayer_HoF : public TextDisplayer {
+friend class KyraEngine_HoF;
public:
- TextDisplayer_v2(KyraEngine_v2 *vm, Screen_v2 *screen);
+ TextDisplayer_HoF(KyraEngine_HoF *vm, Screen_v2 *screen);
void backupTalkTextMessageBkgd(int srcPage, int dstPage);
void restoreTalkTextMessageBkgd(int srcPage, int dstPage);
@@ -47,7 +47,7 @@ public:
char *preprocessString(const char *str);
void calcWidestLineBounds(int &x1, int &x2, int w, int x);
private:
- KyraEngine_v2 *_vm;
+ KyraEngine_HoF *_vm;
};
} // end of namespace Kyra
diff --git a/engines/kyra/text_v3.cpp b/engines/kyra/text_mr.cpp
index 3b8c69177f..35f91c1ccc 100644
--- a/engines/kyra/text_v3.cpp
+++ b/engines/kyra/text_mr.cpp
@@ -23,18 +23,18 @@
*
*/
-#include "kyra/text_v3.h"
-#include "kyra/screen_v3.h"
+#include "kyra/text_mr.h"
+#include "kyra/screen_mr.h"
#include "kyra/resource.h"
namespace Kyra {
-TextDisplayer_v3::TextDisplayer_v3(KyraEngine_v3 *vm, Screen_v3 *screen)
+TextDisplayer_MR::TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen)
: TextDisplayer(vm, screen), _vm(vm), _screen(screen) {
}
-char *TextDisplayer_v3::preprocessString(const char *str) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v3::preprocessString('%s')", str);
+char *TextDisplayer_MR::preprocessString(const char *str) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_MR::preprocessString('%s')", str);
if (_talkBuffer != str)
strncpy(_talkBuffer, str, sizeof(_talkBuffer));
@@ -81,8 +81,8 @@ char *TextDisplayer_v3::preprocessString(const char *str) {
return _talkBuffer;
}
-int TextDisplayer_v3::dropCRIntoString(char *str, int minOffs, int maxOffs) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v3::dropCRIntoString('%s', %d, %d)", str, maxOffs, minOffs);
+int TextDisplayer_MR::dropCRIntoString(char *str, int minOffs, int maxOffs) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_MR::dropCRIntoString('%s', %d, %d)", str, maxOffs, minOffs);
int offset = 0;
char *proc = str + minOffs;
@@ -129,8 +129,8 @@ int TextDisplayer_v3::dropCRIntoString(char *str, int minOffs, int maxOffs) {
return 0;
}
-void TextDisplayer_v3::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v3::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
+void TextDisplayer_MR::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_MR::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
uint8 colorMap[] = { 0, 255, 240, 240 };
colorMap[3] = c1;
_screen->setTextColor(colorMap, 0, 3);
@@ -141,8 +141,8 @@ void TextDisplayer_v3::printText(const char *str, int x, int y, uint8 c0, uint8
_screen->setFont(curFont);
}
-void TextDisplayer_v3::restoreScreen() {
- debugC(9, kDebugLevelMain, "TextDisplayer_v3::restoreScreen()");
+void TextDisplayer_MR::restoreScreen() {
+ debugC(9, kDebugLevelMain, "TextDisplayer_MR::restoreScreen()");
_vm->restorePage3();
_vm->drawAnimObjects();
_screen->hideMouse();
@@ -152,8 +152,8 @@ void TextDisplayer_v3::restoreScreen() {
_vm->refreshAnimObjects(0);
}
-void TextDisplayer_v3::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
- debugC(9, kDebugLevelMain, "TextDisplayer_v3::calcWidestLineBounds(%d, %d)", w, x);
+void TextDisplayer_MR::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
+ debugC(9, kDebugLevelMain, "TextDisplayer_MR::calcWidestLineBounds(%d, %d)", w, x);
x1 = x;
x1 -= (w >> 1);
x2 = x1 + w + 1;
@@ -169,8 +169,8 @@ void TextDisplayer_v3::calcWidestLineBounds(int &x1, int &x2, int w, int x) {
#pragma mark -
-int KyraEngine_v3::chatGetType(const char *str) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::chatGetType('%s')", str);
+int KyraEngine_MR::chatGetType(const char *str) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::chatGetType('%s')", str);
while (*str)
++str;
--str;
@@ -190,13 +190,13 @@ int KyraEngine_v3::chatGetType(const char *str) {
}
}
-int KyraEngine_v3::chatCalcDuration(const char *str) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::chatCalcDuration('%s')", str);
+int KyraEngine_MR::chatCalcDuration(const char *str) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::chatCalcDuration('%s')", str);
return MAX<int>(120, strlen(str)*6);
}
-void KyraEngine_v3::objectChat(const char *str, int object, int vocHigh, int vocLow) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChat('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
+void KyraEngine_MR::objectChat(const char *str, int object, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChat('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
if (_mainCharacter.animFrame == 87 || _mainCharacter.animFrame == 0xFFFF || _mainCharacter.x1 <= 0 || _mainCharacter.y1 <= 0)
return;
@@ -223,7 +223,7 @@ void KyraEngine_v3::objectChat(const char *str, int object, int vocHigh, int voc
static const char *talkFilenameTable[] = {
"MTFL00S.EMC", "MTFL00Q.EMC", "MTFL00E.EMC", "MTFL00T.EMC",
- "MTFR00S.EMC", "MTFR00Q.EMC", "MTFR00E.EMC", "MTRF00T.EMC",
+ "MTFR00S.EMC", "MTFR00Q.EMC", "MTFR00E.EMC", "MTFR00T.EMC",
"MTL00S.EMC", "MTL00Q.EMC", "MTL00E.EMC", "MTL00T.EMC",
"MTR00S.EMC", "MTR00Q.EMC", "MTR00E.EMC", "MTR00T.EMC",
"MTA00S.EMC", "MTA00Q.EMC", "MTA00Q.EMC", "MTA00T.EMC"
@@ -239,8 +239,8 @@ void KyraEngine_v3::objectChat(const char *str, int object, int vocHigh, int voc
setNextIdleAnimTimer();
}
-void KyraEngine_v3::objectChatInit(const char *str, int object, int vocHigh, int vocLow) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatInit('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
+void KyraEngine_MR::objectChatInit(const char *str, int object, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatInit('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
str = _text->preprocessString(str);
int lineNum = _text->buildMessageSubstrings(str);
@@ -286,8 +286,8 @@ void KyraEngine_v3::objectChatInit(const char *str, int object, int vocHigh, int
_screen->showMouse();
}
-void KyraEngine_v3::objectChatPrintText(const char *str, int object) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatPrintText('%s', %d)", str, object);
+void KyraEngine_MR::objectChatPrintText(const char *str, int object) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatPrintText('%s', %d)", str, object);
int c1 = _talkObjectList[object].color;
str = _text->preprocessString(str);
int lineNum = _text->buildMessageSubstrings(str);
@@ -306,17 +306,17 @@ void KyraEngine_v3::objectChatPrintText(const char *str, int object) {
}
}
-void KyraEngine_v3::objectChatProcess(const char *script) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatProcess('%s')", script);
+void KyraEngine_MR::objectChatProcess(const char *script) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatProcess('%s')", script);
memset(&_chatScriptData, 0, sizeof(_chatScriptData));
memset(&_chatScriptState, 0, sizeof(_chatScriptState));
- _scriptInterpreter->loadScript(script, &_chatScriptData, &_opcodesTemporary);
- _scriptInterpreter->initScript(&_chatScriptState, &_chatScriptData);
- _scriptInterpreter->startScript(&_chatScriptState, 0);
- while (_scriptInterpreter->validScript(&_chatScriptState))
- _scriptInterpreter->runScript(&_chatScriptState);
+ _emc->load(script, &_chatScriptData, &_opcodesAnimation);
+ _emc->init(&_chatScriptState, &_chatScriptData);
+ _emc->start(&_chatScriptState, 0);
+ while (_emc->isValid(&_chatScriptState))
+ _emc->run(&_chatScriptState);
if (_chatVocHigh >= 0) {
playVoice(_chatVocHigh, _chatVocLow);
@@ -327,33 +327,33 @@ void KyraEngine_v3::objectChatProcess(const char *script) {
objectChatWaitToFinish();
_useFrameTable = false;
- _scriptInterpreter->unloadScript(&_chatScriptData);
+ _emc->unload(&_chatScriptData);
}
-void KyraEngine_v3::objectChatWaitToFinish() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatWaitToFinish()");
+void KyraEngine_MR::objectChatWaitToFinish() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatWaitToFinish()");
int charAnimFrame = _mainCharacter.animFrame;
- setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
+ setCharacterAnimDim(_animShapeWidth, _animShapeHeight);
- _scriptInterpreter->initScript(&_chatScriptState, &_chatScriptData);
- _scriptInterpreter->startScript(&_chatScriptState, 1);
+ _emc->init(&_chatScriptState, &_chatScriptData);
+ _emc->start(&_chatScriptState, 1);
bool running = true;
const uint32 endTime = _chatEndTime;
resetSkipFlag();
while (running && !_quitFlag) {
- if (!_scriptInterpreter->validScript(&_chatScriptState))
- _scriptInterpreter->startScript(&_chatScriptState, 1);
+ if (!_emc->isValid(&_chatScriptState))
+ _emc->start(&_chatScriptState, 1);
- _temporaryScriptExecBit = false;
- while (!_temporaryScriptExecBit && _scriptInterpreter->validScript(&_chatScriptState)) {
+ _animNeedUpdate = false;
+ while (!_animNeedUpdate && _emc->isValid(&_chatScriptState)) {
musicUpdate(0);
- _scriptInterpreter->runScript(&_chatScriptState);
+ _emc->run(&_chatScriptState);
}
- int curFrame = _newShapeAnimFrame;
- uint32 delayTime = _newShapeDelay;
+ int curFrame = _animNewFrame;
+ uint32 delayTime = _animDelayTime;
_mainCharacter.animFrame = curFrame;
updateCharacterAnim(0);
@@ -380,8 +380,8 @@ void KyraEngine_v3::objectChatWaitToFinish() {
resetCharacterAnimDim();
}
-void KyraEngine_v3::badConscienceChat(const char *str, int vocHigh, int vocLow) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::badConscienceChat('%s', %d, %d)", str, vocHigh, vocLow);
+void KyraEngine_MR::badConscienceChat(const char *str, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::badConscienceChat('%s', %d, %d)", str, vocHigh, vocLow);
if (!_badConscienceShown)
return;
@@ -398,8 +398,8 @@ void KyraEngine_v3::badConscienceChat(const char *str, int vocHigh, int vocLow)
_chatObject = -1;
}
-void KyraEngine_v3::badConscienceChatWaitToFinish() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::badConscienceChatWaitToFinish()");
+void KyraEngine_MR::badConscienceChatWaitToFinish() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::badConscienceChatWaitToFinish()");
if (_chatVocHigh) {
playVoice(_chatVocHigh, _chatVocLow);
_chatVocHigh = _chatVocLow = -1;
@@ -438,13 +438,71 @@ void KyraEngine_v3::badConscienceChatWaitToFinish() {
}
}
-void KyraEngine_v3::malcolmSceneStartupChat() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::malcolmSceneStartupChat()");
+void KyraEngine_MR::goodConscienceChat(const char *str, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::goodConscienceChat('%s', %d, %d)", str, vocHigh, vocLow);
+ if (!_goodConscienceShown)
+ return;
+
+ setNextIdleAnimTimer();
+ _chatVocHigh = _chatVocLow = -1;
+ objectChatInit(str, 87, vocHigh, vocLow);
+ _chatText = str;
+ _chatObject = 87;
+ goodConscienceChatWaitToFinish();
+ updateSceneAnim(0x0F, _goodConscienceFrameTable[_goodConscienceAnim+10]);
+ _text->restoreScreen();
+ update();
+ _chatText = 0;
+ _chatObject = -1;
+}
+
+void KyraEngine_MR::goodConscienceChatWaitToFinish() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::goodConscienceChatWaitToFinish()");
+ if (_chatVocHigh) {
+ playVoice(_chatVocHigh, _chatVocLow);
+ _chatVocHigh = _chatVocLow = -1;
+ }
+
+ bool running = true;
+ const uint32 endTime = _chatEndTime;
+ resetSkipFlag();
+
+ uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;
+
+ int frame = _goodConscienceFrameTable[_goodConscienceAnim+15];
+ while (running && !_quitFlag) {
+ if (nextFrame < _system->getMillis()) {
+ ++frame;
+ if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame)
+ frame = _goodConscienceFrameTable[_goodConscienceAnim+15];
+
+ updateSceneAnim(0x0F, frame);
+ updateWithText();
+
+ nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;
+ }
+
+ updateWithText();
+
+ const uint32 curTime = _system->getMillis();
+ if ((textEnabled() && !speechEnabled() && curTime > endTime) || (speechEnabled() && !snd_voiceIsPlaying()) || skipFlag()) {
+ snd_stopVoice();
+ resetSkipFlag();
+ nextFrame = curTime;
+ running = false;
+ }
+
+ delay(10);
+ }
+}
+
+void KyraEngine_MR::malcolmSceneStartupChat() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::malcolmSceneStartupChat()");
if (_noStartupChat)
return;
- int index = _mainCharacter.sceneId - _chapterLowestScene[_curChapter];
+ int index = _mainCharacter.sceneId - _chapterLowestScene[_currentChapter];
if (_newSceneDlgState[index])
return;
@@ -463,20 +521,20 @@ void KyraEngine_v3::malcolmSceneStartupChat() {
_newSceneDlgState[index] = true;
}
-void KyraEngine_v3::updateDlgBuffer() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::updateDlgBuffer()");
+void KyraEngine_MR::updateDlgBuffer() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateDlgBuffer()");
char dlgFile[16];
char cnvFile[16];
if (_cnvFile)
_cnvFile->seek(0, SEEK_SET);
- if (_curDlgIndex == _mainCharacter.dlgIndex && _curDlgChapter == _curChapter && _curDlgLang == _lang)
+ if (_curDlgIndex == _mainCharacter.dlgIndex && _curDlgChapter == _currentChapter && _curDlgLang == _lang)
return;
- snprintf(dlgFile, 16, "CH%.02d-S%.02d.", _curChapter, _mainCharacter.dlgIndex);
+ snprintf(dlgFile, 16, "CH%.02d-S%.02d.", _currentChapter, _mainCharacter.dlgIndex);
appendLanguage(dlgFile, _lang, 16);
- snprintf(cnvFile, 16, "CH%.02d-S%.02d.CNV", _curChapter, _mainCharacter.dlgIndex);
+ snprintf(cnvFile, 16, "CH%.02d-S%.02d.CNV", _currentChapter, _mainCharacter.dlgIndex);
delete _cnvFile;
delete _dlgBuffer;
@@ -489,8 +547,8 @@ void KyraEngine_v3::updateDlgBuffer() {
assert(_dlgBuffer);
}
-void KyraEngine_v3::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::loadDlgHeader(-, -, -, -)");
+void KyraEngine_MR::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadDlgHeader(-, -, -, -)");
assert(_cnvFile);
vocHighIndex = _cnvFile->readSint16LE();
vocHighBase = _cnvFile->readSint16LE();
@@ -498,18 +556,58 @@ void KyraEngine_v3::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &inde
index2 = _cnvFile->readSint16LE();
}
-void KyraEngine_v3::setDlgIndex(uint16 index) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::setDlgIndex(%d)", index);
+void KyraEngine_MR::setDlgIndex(int index) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::setDlgIndex(%d)", index);
if (_mainCharacter.dlgIndex != index) {
- Common::set_to(_newSceneDlgState, _newSceneDlgState+ARRAYSIZE(_newSceneDlgState), false);
+ memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
memset(_conversationState, -1, sizeof(_conversationState));
_chatAltFlag = false;
_mainCharacter.dlgIndex = index;
}
}
-void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum);
+void KyraEngine_MR::updateDlgIndex() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::updateDlgIndex()");
+ uint16 dlgIndex = _mainCharacter.dlgIndex;
+
+ if (_currentChapter == 1) {
+ static const uint8 dlgIndexMoodNice[] = { 0x0C, 0x0E, 0x10, 0x0F, 0x11 };
+ static const uint8 dlgIndexMoodNormal[] = { 0x00, 0x02, 0x04, 0x03, 0x05 };
+ static const uint8 dlgIndexMoodEvil[] = { 0x06, 0x08, 0x0A, 0x09, 0x0B };
+
+ if (_malcolmsMood == 0)
+ dlgIndex = dlgIndexMoodNice[_characterShapeFile];
+ else if (_malcolmsMood == 1)
+ dlgIndex = dlgIndexMoodNormal[_characterShapeFile];
+ else if (_malcolmsMood == 2)
+ dlgIndex = dlgIndexMoodEvil[_characterShapeFile];
+ } else if (_currentChapter == 2) {
+ if (dlgIndex >= 8)
+ dlgIndex -= 4;
+ if (dlgIndex >= 4)
+ dlgIndex -= 4;
+
+ if (_malcolmsMood == 0)
+ dlgIndex += 8;
+ else if (_malcolmsMood == 2)
+ dlgIndex += 4;
+ } else if (_currentChapter == 4) {
+ if (dlgIndex >= 10)
+ dlgIndex -= 5;
+ if (dlgIndex >= 5)
+ dlgIndex -= 5;
+
+ if (_malcolmsMood == 0)
+ dlgIndex += 10;
+ else if (_malcolmsMood == 2)
+ dlgIndex += 5;
+ }
+
+ _mainCharacter.dlgIndex = dlgIndex;
+}
+
+void KyraEngine_MR::processDialog(int vocHighIndex, int vocHighBase, int funcNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum);
bool running = true;
int script = -1;
int vocHigh = -1, vocLow = -1;
@@ -546,10 +644,10 @@ void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum
if (script >= 0) {
dialogEndScript(script);
script = -1;
- } else {
- dialogStartScript(object, funcNum);
- script = object;
}
+
+ dialogStartScript(object, funcNum);
+ script = object;
}
npcChatSequence(_stringBuffer, object, vocHigh, vocLow);
@@ -569,8 +667,8 @@ void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum
dialogEndScript(script);
}
-void KyraEngine_v3::dialogStartScript(int object, int funcNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::dialogStartScript(%d, %d)", object, funcNum);
+void KyraEngine_MR::dialogStartScript(int object, int funcNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::dialogStartScript(%d, %d)", object, funcNum);
_dialogSceneAnim = _talkObjectList[object].sceneAnim;
_dialogSceneScript = _talkObjectList[object].sceneScript;
if (_dialogSceneAnim >= 0 && _dialogSceneScript >= 0) {
@@ -578,37 +676,37 @@ void KyraEngine_v3::dialogStartScript(int object, int funcNum) {
_specialSceneScriptState[_dialogSceneScript] = true;
}
- _scriptInterpreter->initScript(&_dialogScriptState, &_dialogScriptData);
- _scriptInterpreter->loadScript(_talkObjectList[object].filename, &_dialogScriptData, &_opcodesDialog);
+ _emc->init(&_dialogScriptState, &_dialogScriptData);
+ _emc->load(_talkObjectList[object].filename, &_dialogScriptData, &_opcodesDialog);
_dialogScriptFuncStart = funcNum * 3 + 0;
_dialogScriptFuncProc = funcNum * 3 + 1;
_dialogScriptFuncEnd = funcNum * 3 + 2;
- _scriptInterpreter->startScript(&_dialogScriptState, _dialogScriptFuncStart);
- while (_scriptInterpreter->validScript(&_dialogScriptState))
- _scriptInterpreter->runScript(&_dialogScriptState);
+ _emc->start(&_dialogScriptState, _dialogScriptFuncStart);
+ while (_emc->isValid(&_dialogScriptState))
+ _emc->run(&_dialogScriptState);
}
-void KyraEngine_v3::dialogEndScript(int object) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::dialogEndScript(%d)", object);
+void KyraEngine_MR::dialogEndScript(int object) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::dialogEndScript(%d)", object);
- _scriptInterpreter->initScript(&_dialogScriptState, &_dialogScriptData);
- _scriptInterpreter->startScript(&_dialogScriptState, _dialogScriptFuncEnd);
+ _emc->init(&_dialogScriptState, &_dialogScriptData);
+ _emc->start(&_dialogScriptState, _dialogScriptFuncEnd);
- while (_scriptInterpreter->validScript(&_dialogScriptState))
- _scriptInterpreter->runScript(&_dialogScriptState);
+ while (_emc->isValid(&_dialogScriptState))
+ _emc->run(&_dialogScriptState);
if (_dialogSceneAnim >= 0 && _dialogSceneScript >= 0) {
_specialSceneScriptState[_dialogSceneScript] = _specialSceneScriptStateBackup[_dialogSceneScript];
_dialogSceneScript = _dialogSceneAnim = -1;
}
- _scriptInterpreter->unloadScript(&_dialogScriptData);
+ _emc->unload(&_dialogScriptData);
}
-void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, int vocLow) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::npcChatSequence('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
+void KyraEngine_MR::npcChatSequence(const char *str, int object, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::npcChatSequence('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
_chatText = str;
_chatObject = object;
@@ -621,17 +719,17 @@ void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, in
_chatVocHigh = _chatVocLow = -1;
}
- _scriptInterpreter->initScript(&_dialogScriptState, &_dialogScriptData);
- _scriptInterpreter->startScript(&_dialogScriptState, _dialogScriptFuncProc);
+ _emc->init(&_dialogScriptState, &_dialogScriptData);
+ _emc->start(&_dialogScriptState, _dialogScriptFuncProc);
resetSkipFlag();
uint32 endTime = _chatEndTime;
bool running = true;
while (running) {
- if (!_scriptInterpreter->runScript(&_dialogScriptState)) {
- _scriptInterpreter->initScript(&_dialogScriptState, &_dialogScriptData);
- _scriptInterpreter->startScript(&_dialogScriptState, _dialogScriptFuncProc);
+ if (!_emc->run(&_dialogScriptState)) {
+ _emc->init(&_dialogScriptState, &_dialogScriptData);
+ _emc->start(&_dialogScriptState, _dialogScriptFuncProc);
}
const uint32 curTime = _system->getMillis();
@@ -640,19 +738,17 @@ void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, in
resetSkipFlag();
running = false;
}
-
- delay(10);
}
_text->restoreScreen();
_chatText = 0;
_chatObject= - 1;
}
-void KyraEngine_v3::malcolmRandomChat() {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::malcolmRandomChat()");
+void KyraEngine_MR::randomSceneChat() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::randomSceneChat()");
updateDlgBuffer();
- int index = (_mainCharacter.sceneId - _chapterLowestScene[_curChapter]) * 2;
+ int index = (_mainCharacter.sceneId - _chapterLowestScene[_currentChapter]) * 2;
int vocHighBase = 0, vocHighIndex = 0, index1 = 0, index2 = 0;
loadDlgHeader(vocHighBase, vocHighIndex, index1, index2);
@@ -668,10 +764,10 @@ void KyraEngine_v3::malcolmRandomChat() {
processDialog(vocHighIndex, vocHighBase, 0);
}
-void KyraEngine_v3::runDialog(int dlgIndex, int funcNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runDialog(%d, %d)", dlgIndex, funcNum);
+void KyraEngine_MR::runDialog(int dlgIndex, int funcNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::runDialog(%d, %d)", dlgIndex, funcNum);
- switch (_curChapter-2) {
+ switch (_currentChapter-2) {
case 0:
dlgIndex -= 34;
break;
diff --git a/engines/kyra/text_v3.h b/engines/kyra/text_mr.h
index 9271c6b520..d96b0964ba 100644
--- a/engines/kyra/text_v3.h
+++ b/engines/kyra/text_mr.h
@@ -23,19 +23,19 @@
*
*/
-#ifndef KYRA_TEXT_V3_H
-#define KYRA_TEXT_V3_H
+#ifndef KYRA_TEXT_MR_H
+#define KYRA_TEXT_MR_H
#include "kyra/text.h"
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_mr.h"
namespace Kyra {
-class TextDisplayer_v3 : public TextDisplayer {
-friend class KyraEngine_v3;
+class TextDisplayer_MR : public TextDisplayer {
+friend class KyraEngine_MR;
public:
- TextDisplayer_v3(KyraEngine_v3 *vm, Screen_v3 *screen);
+ TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen);
char *preprocessString(const char *str);
int dropCRIntoString(char *str, int minOffs, int maxOffs);
@@ -46,8 +46,8 @@ public:
void calcWidestLineBounds(int &x1, int &x2, int w, int x);
protected:
- KyraEngine_v3 *_vm;
- Screen_v3 *_screen;
+ KyraEngine_MR *_vm;
+ Screen_MR *_screen;
};
} // end of namespace Kyra
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp
index f275867516..1f25f88c97 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -99,17 +99,23 @@ void TimerManager::update() {
_nextRun += 99999;
for (Iterator pos = _timers.begin(); pos != _timers.end(); ++pos) {
- if (pos->enabled && pos->countdown >= 0 && pos->nextRun <= _system->getMillis()) {
- if (pos->func && pos->func->isValid())
- (*pos->func)(pos->id);
+ if (pos->enabled)
- uint32 curTime = _system->getMillis();
- pos->lastUpdate = curTime;
- pos->nextRun = curTime + pos->countdown * _vm->tickLength();
+ if (pos->enabled && pos->countdown >= 0) {
+ if (pos->nextRun <= _system->getMillis()) {
+ if (pos->func && pos->func->isValid()) {
+ (*pos->func)(pos->id);
+ }
+
+ uint32 curTime = _system->getMillis();
+ pos->lastUpdate = curTime;
+ pos->nextRun = curTime + pos->countdown * _vm->tickLength();
+ }
_nextRun = MIN(_nextRun, pos->nextRun);
}
}
+
}
void TimerManager::resync() {
diff --git a/engines/kyra/timer_v2.cpp b/engines/kyra/timer_hof.cpp
index 4c97a6dd2d..2643ae9b45 100644
--- a/engines/kyra/timer_v2.cpp
+++ b/engines/kyra/timer_hof.cpp
@@ -23,15 +23,15 @@
*
*/
-#include "kyra/kyra_v2.h"
+#include "kyra/kyra_hof.h"
#include "kyra/timer.h"
namespace Kyra {
-#define TimerV2(x) new Common::Functor1Mem<int, void, KyraEngine_v2>(this, &KyraEngine_v2::x)
+#define TimerV2(x) new Common::Functor1Mem<int, void, KyraEngine_HoF>(this, &KyraEngine_HoF::x)
-void KyraEngine_v2::setupTimers() {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setupTimers()");
+void KyraEngine_HoF::setupTimers() {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setupTimers()");
_timer->addTimer(0, 0, 5, 1);
_timer->addTimer(1, TimerV2(timerFadeOutMessage), -1, 1);
@@ -41,14 +41,14 @@ void KyraEngine_v2::setupTimers() {
_timer->addTimer(5, TimerV2(timerBurnZanthia), 1, 0);
}
-void KyraEngine_v2::timerFadeOutMessage(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFadeOutMessage(%d)", arg);
+void KyraEngine_HoF::timerFadeOutMessage(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFadeOutMessage(%d)", arg);
if (_shownMessage)
_fadeMessagePalette = 1;
}
-void KyraEngine_v2::timerCauldronAnimation(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerCauldronAnimation(%d)", arg);
+void KyraEngine_HoF::timerCauldronAnimation(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerCauldronAnimation(%d)", arg);
int animation = -1;
// HACK: We don't allow inventory animations while the inventory is backed off, which means not shown usually.
@@ -68,14 +68,14 @@ void KyraEngine_v2::timerCauldronAnimation(int arg) {
}
}
-void KyraEngine_v2::timerFunc4(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFunc4(%d)", arg);
+void KyraEngine_HoF::timerFunc4(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFunc4(%d)", arg);
_timer->disable(3);
setGameFlag(0xD8);
}
-void KyraEngine_v2::timerFunc5(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFunc5(%d)", arg);
+void KyraEngine_HoF::timerFunc5(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFunc5(%d)", arg);
_timer->disable(4);
_screen->hideMouse();
_specialSceneScriptState[5] = 1;
@@ -86,18 +86,18 @@ void KyraEngine_v2::timerFunc5(int arg) {
_deathHandler = 4;
}
-void KyraEngine_v2::timerBurnZanthia(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerBurnZanthia(%d)", arg);
+void KyraEngine_HoF::timerBurnZanthia(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerBurnZanthia(%d)", arg);
_timer->disable(5);
_screen->hideMouse();
snd_playSoundEffect(0x2D);
- runTemporaryScript("_ZANBURN.EMC", 0, 1, 1, 0);
+ runAnimationScript("_ZANBURN.EMC", 0, 1, 1, 0);
_deathHandler = 7;
snd_playWanderScoreViaMap(0x53, 1);
}
-void KyraEngine_v2::setTimer1DelaySecs(int secs) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setTimer1DelaySecs(%d)", secs);
+void KyraEngine_HoF::setTimer1DelaySecs(int secs) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setTimer1DelaySecs(%d)", secs);
if (secs == -1)
secs = 32000;
@@ -105,8 +105,8 @@ void KyraEngine_v2::setTimer1DelaySecs(int secs) {
_timer->setCountdown(1, secs * 60);
}
-void KyraEngine_v2::setWalkspeed(uint8 newSpeed) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setWalkspeed(%i)", newSpeed);
+void KyraEngine_HoF::setWalkspeed(uint8 newSpeed) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setWalkspeed(%i)", newSpeed);
if (newSpeed < 5)
newSpeed = 3;
diff --git a/engines/kyra/timer_v3.cpp b/engines/kyra/timer_mr.cpp
index 4ce73ceaec..53865ba0e3 100644
--- a/engines/kyra/timer_v3.cpp
+++ b/engines/kyra/timer_mr.cpp
@@ -23,15 +23,15 @@
*
*/
-#include "kyra/kyra_v3.h"
+#include "kyra/kyra_mr.h"
#include "kyra/timer.h"
namespace Kyra {
-#define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_v3>(this, &KyraEngine_v3::x)
+#define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_MR>(this, &KyraEngine_MR::x)
-void KyraEngine_v3::setupTimers() {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setupTimers()");
+void KyraEngine_MR::setupTimers() {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setupTimers()");
_timer->addTimer(0, TimerV3(timerRestoreCommandLine), -1, 1);
for (int i = 1; i <= 3; ++i)
@@ -43,31 +43,32 @@ void KyraEngine_v3::setupTimers() {
_timer->addTimer(i, TimerV3(timerRunSceneScript7), 0, 0);
}
-void KyraEngine_v3::timerRestoreCommandLine(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerRestoreCommandLine(%d)", arg);
+void KyraEngine_MR::timerRestoreCommandLine(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerRestoreCommandLine(%d)", arg);
if (_shownMessage)
_restoreCommandLine = true;
}
-void KyraEngine_v3::timerRunSceneScript7(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerRunSceneScript7(%d)", arg);
+void KyraEngine_MR::timerRunSceneScript7(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerRunSceneScript7(%d)", arg);
+ _emc->init(&_sceneScriptState, &_sceneScriptData);
_sceneScriptState.regs[1] = _mouseX;
_sceneScriptState.regs[2] = _mouseY;
_sceneScriptState.regs[3] = 0;
_sceneScriptState.regs[4] = _itemInHand;
- _scriptInterpreter->startScript(&_sceneScriptState, 7);
+ _emc->start(&_sceneScriptState, 7);
- while (_scriptInterpreter->validScript(&_sceneScriptState))
- _scriptInterpreter->runScript(&_sceneScriptState);
+ while (_emc->isValid(&_sceneScriptState))
+ _emc->run(&_sceneScriptState);
}
-void KyraEngine_v3::timerFleaDeath(int arg) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerFleaDeath(%d)", arg);
+void KyraEngine_MR::timerFleaDeath(int arg) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerFleaDeath(%d)", arg);
warning("STUB timerFleaDeath");
}
-void KyraEngine_v3::setWalkspeed(uint8 speed) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setWalkspeed(%d)", speed);
+void KyraEngine_MR::setWalkspeed(uint8 speed) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setWalkspeed(%d)", speed);
if (speed < 5)
speed = 3;
@@ -77,15 +78,15 @@ void KyraEngine_v3::setWalkspeed(uint8 speed) {
_mainCharacter.walkspeed = speed;
}
-void KyraEngine_v3::setCommandLineRestoreTimer(int secs) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setCommandLineRestoreTimer(%d)", secs);
+void KyraEngine_MR::setCommandLineRestoreTimer(int secs) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setCommandLineRestoreTimer(%d)", secs);
if (secs == -1)
secs = 32000;
_timer->setCountdown(0, secs*60);
}
-void KyraEngine_v3::setNextIdleAnimTimer() {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setNextIdleAnimTimer()");
+void KyraEngine_MR::setNextIdleAnimTimer() {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setNextIdleAnimTimer()");
_nextIdleAnim = _system->getMillis() + _rnd.getRandomNumberRng(10, 15) * 1000;
}
diff --git a/engines/kyra/timer_v1.cpp b/engines/kyra/timer_v1.cpp
index f2a31da554..f5e7c52ba1 100644
--- a/engines/kyra/timer_v1.cpp
+++ b/engines/kyra/timer_v1.cpp
@@ -170,7 +170,7 @@ void KyraEngine_v1::timerRedrawAmulet(int timerNum) {
void KyraEngine_v1::setWalkspeed(uint8 newSpeed) {
debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::setWalkspeed(%i)", newSpeed);
- static const uint8 speeds[] = {11, 9, 6, 5, 3};
+ static const uint8 speeds[] = { 11, 9, 6, 5, 3 };
assert(newSpeed < ARRAYSIZE(speeds));
_timer->setDelay(5, speeds[newSpeed]);
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index 9da75ed20c..764327d701 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -32,6 +32,7 @@
#include "kyra/screen.h"
#include "kyra/screen_v2.h"
#include "kyra/wsamovie.h"
+#include "kyra/resource.h"
namespace Kyra {
WSAMovieV1::WSAMovieV1(KyraEngine *vm) : Movie(vm) {}
@@ -341,7 +342,7 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
#pragma mark -
-WSAMovieV2::WSAMovieV2(KyraEngine *vm, ScreenEx *screen) : WSAMovieV1(vm), _screen(screen), _xAdd(0), _yAdd(0) {}
+WSAMovieV2::WSAMovieV2(KyraEngine *vm, Screen_v2 *screen) : WSAMovieV1(vm), _screen(screen), _xAdd(0), _yAdd(0) {}
int WSAMovieV2::open(const char *filename, int unk1, uint8 *palBuf) {
debugC(9, kDebugLevelMovie, "WSAMovieV2::open('%s', %d, %p)", filename, unk1, (const void *)palBuf);
diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h
index ad577f7029..d1f3465c07 100644
--- a/engines/kyra/wsamovie.h
+++ b/engines/kyra/wsamovie.h
@@ -26,8 +26,6 @@
#ifndef KYRA_WSAMOVIE_H
#define KYRA_WSAMOVIE_H
-#include "kyra/resource.h"
-
namespace Audio {
class AppendableAudioStream;
class SoundHandle;
@@ -35,7 +33,7 @@ class SoundHandle;
namespace Kyra {
class KyraEngine;
-class ScreenEx;
+class Screen_v2;
class Movie {
public:
@@ -111,7 +109,7 @@ private:
class WSAMovieV2 : public WSAMovieV1 {
public:
- WSAMovieV2(KyraEngine *vm, ScreenEx *scren);
+ WSAMovieV2(KyraEngine *vm, Screen_v2 *scren);
int open(const char *filename, int unk1, uint8 *palette);
@@ -129,7 +127,7 @@ public:
void setWidth(int w) { _width = w; }
void setHeight(int h) { _height = h; }
protected:
- ScreenEx *_screen;
+ Screen_v2 *_screen;
int16 _xAdd;
int16 _yAdd;
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index b498ec7f61..7dd1c77348 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -195,4 +195,8 @@ bool LureMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return gd != 0;
}
-REGISTER_PLUGIN(LURE, PLUGIN_TYPE_ENGINE, LureMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(LURE)
+ REGISTER_PLUGIN_DYNAMIC(LURE, PLUGIN_TYPE_ENGINE, LureMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(LURE, PLUGIN_TYPE_ENGINE, LureMetaEngine);
+#endif
diff --git a/engines/lure/module.mk b/engines/lure/module.mk
index 6b8bf35b77..ba158756b4 100644
--- a/engines/lure/module.mk
+++ b/engines/lure/module.mk
@@ -25,7 +25,7 @@ MODULE_OBJS := \
surface.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_LURE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp
index ff440e5d28..259c18f6a7 100644
--- a/engines/m4/detection.cpp
+++ b/engines/m4/detection.cpp
@@ -387,4 +387,8 @@ bool M4MetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::
return gd != 0;
}
-REGISTER_PLUGIN(M4, PLUGIN_TYPE_ENGINE, M4MetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(M4)
+ REGISTER_PLUGIN_DYNAMIC(M4, PLUGIN_TYPE_ENGINE, M4MetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(M4, PLUGIN_TYPE_ENGINE, M4MetaEngine);
+#endif
diff --git a/engines/m4/module.mk b/engines/m4/module.mk
index 9791f66a58..eea75cab24 100644
--- a/engines/m4/module.mk
+++ b/engines/m4/module.mk
@@ -34,7 +34,7 @@ MODULE_OBJS = \
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_M4), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/made/database.cpp b/engines/made/database.cpp
index 816df58510..a7970a2e27 100644
--- a/engines/made/database.cpp
+++ b/engines/made/database.cpp
@@ -23,8 +23,10 @@
*
*/
+#include "common/system.h"
#include "common/endian.h"
#include "common/util.h"
+#include "common/savefile.h"
#include "made/database.h"
@@ -45,13 +47,30 @@ Object::~Object() {
delete[] _objData;
}
-void Object::load(Common::SeekableReadStream &source) {
-
+int Object::loadVersion2(Common::SeekableReadStream &source) {
_freeData = true;
+ uint16 type = source.readUint16LE();
+ if (type == 0x7FFF) {
+ _objSize = source.readUint16LE();
+ } else if (type == 0x7FFE) {
+ _objSize = source.readUint16LE() * 2;
+ } else if (type < 0x7FFE) {
+ byte count1 = source.readByte();
+ byte count2 = source.readByte();
+ _objSize = (count1 + count2) * 2;
+ }
+ source.seek(-4, SEEK_CUR);
+ _objSize += 6;
+ _objData = new byte[_objSize];
+ WRITE_LE_UINT16(_objData, 1);
+ source.read(_objData + 2, _objSize - 2);
+ return _objSize - 2;
+}
+int Object::loadVersion3(Common::SeekableReadStream &source) {
+ _freeData = true;
source.readUint16LE(); // skip flags
uint16 type = source.readUint16LE();
-
if (type == 0x7FFF) {
_objSize = source.readUint16LE();
} else if (type == 0x7FFE) {
@@ -61,29 +80,23 @@ void Object::load(Common::SeekableReadStream &source) {
byte count2 = source.readByte();
_objSize = (count1 + count2) * 2;
}
-
source.seek(-6, SEEK_CUR);
-
_objSize += 6;
-
_objData = new byte[_objSize];
source.read(_objData, _objSize);
-
+ return _objSize;
}
-void Object::load(byte *source) {
-
+int Object::loadVersion3(byte *source) {
_objData = source;
_freeData = false;
-
if (getClass() < 0x7FFE) {
_objSize = (getCount1() + getCount2()) * 2;
} else {
_objSize = getSize();
}
-
_objSize += 6;
-
+ return _objSize;
}
uint16 Object::getFlags() const {
@@ -182,12 +195,15 @@ void Object::dump(const char *filename) {
*/
}
-GameDatabase::GameDatabase() {
+GameDatabase::GameDatabase(MadeEngine *vm) : _vm(vm) {
+ _gameText = NULL;
}
GameDatabase::~GameDatabase() {
if (_gameState)
delete[] _gameState;
+ if (_gameText)
+ delete[] _gameText;
}
void GameDatabase::open(const char *filename) {
@@ -209,11 +225,66 @@ void GameDatabase::openFromRed(const char *redFilename, const char *filename) {
}
void GameDatabase::load(Common::SeekableReadStream &sourceS) {
+
+ if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2) {
+ debug(2, "loading version 2 dat");
+ loadVersion2(sourceS);
+ } else if (_vm->getGameID() == GID_RTZ) {
+ debug(2, "loading version 3 dat");
+ loadVersion3(sourceS);
+ }
+
+}
+
+void GameDatabase::loadVersion2(Common::SeekableReadStream &sourceS) {
// TODO: Read/verifiy header
- sourceS.seek(0x1E);
+ sourceS.seek(0x1C);
+ uint32 textOffs = sourceS.readUint16LE() * 512;
+ uint16 objectCount = sourceS.readUint16LE();
+ uint16 varObjectCount = sourceS.readUint16LE();
+ _gameStateSize = sourceS.readUint16LE() * 2;
+ sourceS.readUint16LE(); // unknown
+ uint32 objectsOffs = sourceS.readUint16LE() * 512;
+ sourceS.readUint16LE(); // unknown
+ _mainCodeObjectIndex = sourceS.readUint16LE();
+ sourceS.readUint16LE(); // unknown
+ uint32 objectsSize = sourceS.readUint32LE() * 2;
+ uint32 textSize = objectsOffs - textOffs;
+
+ debug(2, "textOffs = %08X; textSize = %08X; objectCount = %d; varObjectCount = %d; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", textOffs, textSize, objectCount, varObjectCount, _gameStateSize, objectsOffs, objectsSize);
+
+ _gameState = new byte[_gameStateSize];
+ memset(_gameState, 0, _gameStateSize);
+
+ sourceS.seek(textOffs);
+ _gameText = new char[textSize];
+ sourceS.read(_gameText, textSize);
+ // "Decrypt" the text data
+ for (uint32 i = 0; i < textSize; i++)
+ _gameText[i] += 0x1E;
+
+ sourceS.seek(objectsOffs);
+
+ for (uint32 i = 0; i < objectCount; i++) {
+ Object *obj = new Object();
+ int objSize = obj->loadVersion2(sourceS);
+ objSize = objSize % 2;
+ // objects are aligned on 2-byte-boundaries, skip unused bytes
+ sourceS.skip(objSize);
+ _objects.push_back(obj);
+ }
+
+}
+
+void GameDatabase::loadVersion3(Common::SeekableReadStream &sourceS) {
+
+ // TODO: Read/verifiy header
+
+ sourceS.seek(0x1E);
+
uint32 objectIndexOffs = sourceS.readUint32LE();
uint16 objectCount = sourceS.readUint16LE();
uint32 gameStateOffs = sourceS.readUint32LE();
@@ -221,9 +292,8 @@ void GameDatabase::load(Common::SeekableReadStream &sourceS) {
uint32 objectsOffs = sourceS.readUint32LE();
uint32 objectsSize = sourceS.readUint32LE();
_mainCodeObjectIndex = sourceS.readUint16LE();
-
- debug(2, "objectIndexOffs = %08X; objectCount = %d; gameStateOffs = %08X; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n",
- objectIndexOffs, objectCount, gameStateOffs, _gameStateSize, objectsOffs, objectsSize);
+
+ debug(2, "objectIndexOffs = %08X; objectCount = %d; gameStateOffs = %08X; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", objectIndexOffs, objectCount, gameStateOffs, _gameStateSize, objectsOffs, objectsSize);
_gameState = new byte[_gameStateSize];
sourceS.seek(gameStateOffs);
@@ -240,22 +310,95 @@ void GameDatabase::load(Common::SeekableReadStream &sourceS) {
// The LSB indicates if it's a constant or variable object.
// Constant objects are loaded from disk, while variable objects exist
// in the _gameState buffer.
-
+
debug(2, "obj(%04X) ofs = %08X\n", i, objectOffsets[i]);
-
+
if (objectOffsets[i] & 1) {
debug(2, "-> const %08X\n", objectsOffs + objectOffsets[i] - 1);
sourceS.seek(objectsOffs + objectOffsets[i] - 1);
- obj->load(sourceS);
+ obj->loadVersion3(sourceS);
} else {
debug(2, "-> var\n");
- obj->load(_gameState + objectOffsets[i]);
+ obj->loadVersion3(_gameState + objectOffsets[i]);
}
_objects.push_back(obj);
}
}
+bool GameDatabase::getSavegameDescription(const char *filename, Common::String &description) {
+
+ Common::InSaveFile *in;
+
+ if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
+ return false;
+ }
+
+ char desc[64];
+
+ in->skip(4); // TODO: Verify marker 'SGAM'
+ in->skip(4); // TODO: Verify size
+ in->skip(2); // TODO: Verify version
+ in->read(desc, 64);
+ description = desc;
+
+ printf("description = %s\n", description.c_str()); fflush(stdout);
+
+ delete in;
+
+ return true;
+
+}
+
+int16 GameDatabase::savegame(const char *filename, const char *description, int16 version) {
+
+ Common::OutSaveFile *out;
+
+ if (!(out = g_system->getSavefileManager()->openForSaving(filename))) {
+ warning("Can't create file '%s', game not saved", filename);
+ return 6;
+ }
+
+ uint32 size = 4 + 4 + 2 + _gameStateSize;
+ char desc[64];
+
+ strncpy(desc, description, 64);
+
+ out->writeUint32BE(MKID_BE('SGAM'));
+ out->writeUint32LE(size);
+ out->writeUint16LE(version);
+ out->write(desc, 64);
+ out->write(_gameState, _gameStateSize);
+
+ delete out;
+
+ return 0;
+
+}
+
+int16 GameDatabase::loadgame(const char *filename, int16 version) {
+
+ Common::InSaveFile *in;
+
+ if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
+ warning("Can't open file '%s', game not loaded", filename);
+ return 1;
+ }
+
+ //uint32 expectedSize = 4 + 4 + 2 + _gameStateSize;
+
+ in->skip(4); // TODO: Verify marker 'SGAM'
+ in->skip(4); // TODO: Verify size
+ in->skip(2); // TODO: Verify version
+ in->skip(64); // skip savegame description
+ in->read(_gameState, _gameStateSize);
+
+ delete in;
+
+ return 0;
+
+}
+
int16 GameDatabase::getVar(int16 index) {
return (int16)READ_LE_UINT16(_gameState + index * 2);
}
@@ -264,27 +407,90 @@ void GameDatabase::setVar(int16 index, int16 value) {
WRITE_LE_UINT16(_gameState + index * 2, value);
}
-int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
+int16 *GameDatabase::getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
Object *obj = getObject(objectIndex);
int16 *prop = (int16*)obj->getData();
byte count1 = obj->getCount1();
byte count2 = obj->getCount2();
-
+
int16 *propPtr1 = prop + count1;
int16 *propPtr2 = prop + count2;
- debug(2, "# propertyId = %04X\n", propertyId);
+ // First see if the property exists in the given object
+ while (count2-- > 0) {
+ if ((READ_LE_UINT16(prop) & 0x7FFF) == propertyId) {
+ propertyFlag = obj->getFlags() & 1;
+ return propPtr1;
+ }
+ prop++;
+ propPtr1++;
+ }
+
+ // Now check in the object hierarchy of the given object
+ int16 parentObjectIndex = obj->getClass();
+ if (parentObjectIndex == 0) {
+ //debug(2, "! NULL(np)\n");
+ return NULL;
+ }
+
+ while (parentObjectIndex != 0) {
+
+ //debug(2, "parentObjectIndex = %04X\n", parentObjectIndex);
+
+ obj = getObject(parentObjectIndex);
+
+ prop = (int16*)obj->getData();
+ count1 = obj->getCount1();
+ count2 = obj->getCount2();
+
+ propPtr1 = propPtr2 + count1 - count2;
+ int16 *propertyPtr = prop + count1;
+
+ while (count2-- > 0) {
+ if (!(READ_LE_UINT16(prop) & 0x8000)) {
+ if ((READ_LE_UINT16(prop) & 0x7FFF) == propertyId) {
+ propertyFlag = obj->getFlags() & 1;
+ return propPtr1;
+ } else {
+ propPtr1++;
+ }
+ } else {
+ if ((READ_LE_UINT16(prop) & 0x7FFF) == propertyId) {
+ propertyFlag = obj->getFlags() & 1;
+ return propertyPtr;
+ }
+ }
+ prop++;
+ propertyPtr++;
+ }
+
+ parentObjectIndex = obj->getClass();
+
+ }
+
+ //debug(2, "! NULL(nf)\n");
+ return NULL;
+
+}
+
+int16 *GameDatabase::getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
+ Object *obj = getObject(objectIndex);
+
+ int16 *prop = (int16*)obj->getData();
+ byte count1 = obj->getCount1();
+ byte count2 = obj->getCount2();
+
+ int16 *propPtr1 = prop + count1;
+ int16 *propPtr2 = prop + count2;
// First see if the property exists in the given object
while (count2-- > 0) {
if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) {
if (READ_LE_UINT16(prop) & 0x4000) {
- //debug(2, "! L1.1\n");
propertyFlag = 1;
return (int16*)_gameState + READ_LE_UINT16(propPtr1);
} else {
- //debug(2, "! L1.2\n");
propertyFlag = obj->getFlags() & 1;
return propPtr1;
}
@@ -292,36 +498,34 @@ int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, i
prop++;
propPtr1++;
}
-
+
// Now check in the object hierarchy of the given object
int16 parentObjectIndex = obj->getClass();
if (parentObjectIndex == 0) {
//debug(2, "! NULL(np)\n");
return NULL;
}
-
+
while (parentObjectIndex != 0) {
-
+
//debug(2, "parentObjectIndex = %04X\n", parentObjectIndex);
obj = getObject(parentObjectIndex);
-
+
prop = (int16*)obj->getData();
count1 = obj->getCount1();
count2 = obj->getCount2();
propPtr1 = propPtr2 + count1 - count2;
int16 *propertyPtr = prop + count1;
-
+
while (count2-- > 0) {
if (!(READ_LE_UINT16(prop) & 0x8000)) {
if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) {
- if (*prop & 0x4000) {
- //debug(2, "! L2.1\n");
+ if (READ_LE_UINT16(prop) & 0x4000) {
propertyFlag = 1;
return (int16*)_gameState + READ_LE_UINT16(propPtr1);
} else {
- //debug(2, "! L2.2\n");
propertyFlag = obj->getFlags() & 1;
return propPtr1;
}
@@ -330,12 +534,10 @@ int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, i
}
} else {
if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) {
- if (*prop & 0x4000) {
- //debug(2, "! L3.1\n");
+ if (READ_LE_UINT16(prop) & 0x4000) {
propertyFlag = 1;
return (int16*)_gameState + READ_LE_UINT16(propertyPtr);
} else {
- //debug(2, "! L3.2\n");
propertyFlag = obj->getFlags() & 1;
return propertyPtr;
}
@@ -344,14 +546,26 @@ int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, i
prop++;
propertyPtr++;
}
-
+
parentObjectIndex = obj->getClass();
-
+
}
//debug(2, "! NULL(nf)\n");
return NULL;
-
+
+}
+
+int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
+ switch (_vm->_engineVersion) {
+ case 2:
+ return getObjectPropertyPtrV2(objectIndex, propertyId, propertyFlag);
+ case 3:
+ return getObjectPropertyPtrV3(objectIndex, propertyId, propertyFlag);
+ default:
+ error("GameDatabase::getObjectPropertyPtr() Unknown engine version");
+ return NULL;
+ }
}
int16 GameDatabase::getObjectProperty(int16 objectIndex, int16 propertyId) {
@@ -361,7 +575,7 @@ int16 GameDatabase::getObjectProperty(int16 objectIndex, int16 propertyId) {
int16 propertyFlag;
int16 *property = getObjectPropertyPtr(objectIndex, propertyId, propertyFlag);
-
+
if (property) {
return (int16)READ_LE_UINT16(property);
} else {
@@ -392,6 +606,10 @@ int16 GameDatabase::setObjectProperty(int16 objectIndex, int16 propertyId, int16
}
+const char *GameDatabase::getString(uint16 offset) {
+ return (const char*)&_gameText[offset * 4];
+}
+
void GameDatabase::dumpObject(int16 index) {
Object *obj = getObject(index);
char fn[512];
diff --git a/engines/made/database.h b/engines/made/database.h
index 5e88b0919f..b92bd8f2dd 100644
--- a/engines/made/database.h
+++ b/engines/made/database.h
@@ -30,7 +30,9 @@
#include "common/util.h"
#include "common/file.h"
#include "common/stream.h"
+#include "common/str.h"
+#include "made/made.h"
#include "made/redreader.h"
namespace Made {
@@ -39,8 +41,9 @@ class Object {
public:
Object();
~Object();
- void load(Common::SeekableReadStream &source);
- void load(byte *source);
+ int loadVersion2(Common::SeekableReadStream &source);
+ int loadVersion3(Common::SeekableReadStream &source);
+ int loadVersion3(byte *source);
uint16 getFlags() const;
uint16 getClass() const;
@@ -72,12 +75,16 @@ protected:
class GameDatabase {
public:
- GameDatabase();
+ GameDatabase(MadeEngine *vm);
~GameDatabase();
void open(const char *filename);
void openFromRed(const char *redFilename, const char *filename);
+ bool getSavegameDescription(const char *filename, Common::String &description);
+ int16 savegame(const char *filename, const char *description, int16 version);
+ int16 loadgame(const char *filename, int16 version);
+
Object *getObject(int16 index) const {
if (index >= 1)
return _objects[index - 1];
@@ -90,18 +97,27 @@ public:
int16 getVar(int16 index);
void setVar(int16 index, int16 value);
+ int16 *getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
+ int16 *getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
int16 *getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
+
int16 getObjectProperty(int16 objectIndex, int16 propertyId);
int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value);
+
+ const char *getString(uint16 offset);
void dumpObject(int16 index);
protected:
+ MadeEngine *_vm;
Common::Array<Object*> _objects;
byte *_gameState;
uint32 _gameStateSize;
+ char *_gameText;
int16 _mainCodeObjectIndex;
void load(Common::SeekableReadStream &sourceS);
+ void loadVersion2(Common::SeekableReadStream &sourceS);
+ void loadVersion3(Common::SeekableReadStream &sourceS);
};
} // End of namespace Made
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index ce31b4077d..6da3189163 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -61,8 +61,10 @@ uint16 MadeEngine::getVersion() const {
}
static const PlainGameDescriptor madeGames[] = {
- {"made", "MADE engine game"},
+ {"made", "MADE engine game"},
+ {"manhole", "The Manhole"},
{"rtz", "Return to Zork"},
+ {"lgop2", "Leather Goddesses of Phobos 2"},
{0, 0}
};
@@ -83,14 +85,14 @@ static const MadeGameDescription gameDescriptions[] = {
Common::kPlatformPC,
Common::ADGF_NO_FLAGS
},
- 0,
+ GID_RTZ,
0,
GF_CD,
0,
},
{
- // Return to Zork - English CD version
+ // Return to Zork - English CD version 1.1 12/7/93
{
"rtz",
"CD",
@@ -99,12 +101,29 @@ static const MadeGameDescription gameDescriptions[] = {
Common::kPlatformPC,
Common::ADGF_NO_FLAGS
},
+ GID_RTZ,
0,
+ GF_CD_COMPRESSED,
+ 0,
+ },
+
+ {
+ // Return to Zork - English CD version 1.2 9/29/94
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
0,
GF_CD_COMPRESSED,
0,
},
+
{
// Return to Zork - English floppy version
{
@@ -115,7 +134,7 @@ static const MadeGameDescription gameDescriptions[] = {
Common::kPlatformPC,
Common::ADGF_NO_FLAGS
},
- 0,
+ GID_RTZ,
0,
GF_FLOPPY,
0,
@@ -131,11 +150,43 @@ static const MadeGameDescription gameDescriptions[] = {
Common::kPlatformPC,
Common::ADGF_DEMO
},
- 0,
+ GID_RTZ,
0,
GF_DEMO,
0,
},
+
+ {
+ // The Manhole: New and Enhanced
+ {
+ "manhole",
+ "",
+ AD_ENTRY1("manhole.dat", "cb21e31ed35c963208343bc995225b73"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_MANHOLE,
+ 0,
+ GF_CD,
+ 0,
+ },
+
+ {
+ // Leather Goddesses of Phobos 2
+ {
+ "lgop2",
+ "",
+ AD_ENTRY1("lgop2.dat", "8137996db200ff67e8f172ff106f2e48"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_LGOP2,
+ 0,
+ GF_FLOPPY,
+ 0,
+ },
{ AD_TABLE_END_MARKER, 0, 0, 0, 0 }
};
@@ -220,4 +271,8 @@ const Common::ADGameDescription *MadeMetaEngine::fallbackDetect(const FSList *fs
return (const Common::ADGameDescription *)&Made::g_fallbackDesc;
}
-REGISTER_PLUGIN(MADE, PLUGIN_TYPE_ENGINE, MadeMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(MADE)
+ REGISTER_PLUGIN_DYNAMIC(MADE, PLUGIN_TYPE_ENGINE, MadeMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(MADE, PLUGIN_TYPE_ENGINE, MadeMetaEngine);
+#endif
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 6eacbd759a..932f5ddcc4 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -86,7 +86,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_pmvPlayer = new PmvPlayer(this, _mixer);
_res = new ProjectReader();
_screen = new Screen(this);
- _dat = new GameDatabase();
+ _dat = new GameDatabase(this);
_script = new ScriptInterpreter(this);
int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI);
@@ -106,6 +106,8 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
if (!_musicVolume) {
debug(1, "Music disabled.");
}
+
+ _soundRate = 8000;
}
@@ -159,21 +161,34 @@ int MadeEngine::go() {
for (int i = 0; i < ARRAYSIZE(_timers); i++)
_timers[i] = -1;
-
- if (getFeatures() & GF_DEMO) {
- _dat->open("demo.dat");
- _res->open("demo.prj");
- } else if (getFeatures() & GF_CD) {
- _dat->open("rtzcd.dat");
- _res->open("rtzcd.prj");
- } else if (getFeatures() & GF_CD_COMPRESSED) {
- _dat->openFromRed("rtzcd.red", "rtzcd.dat");
- _res->open("rtzcd.prj");
- } else if (getFeatures() & GF_FLOPPY) {
- _dat->open("rtz.dat");
- _res->open("rtz.prj");
+
+ if (getGameID() == GID_RTZ) {
+ _engineVersion = 3;
+ if (getFeatures() & GF_DEMO) {
+ _dat->open("demo.dat");
+ _res->open("demo.prj");
+ } else if (getFeatures() & GF_CD) {
+ _dat->open("rtzcd.dat");
+ _res->open("rtzcd.prj");
+ } else if (getFeatures() & GF_CD_COMPRESSED) {
+ _dat->openFromRed("rtzcd.red", "rtzcd.dat");
+ _res->open("rtzcd.prj");
+ } else if (getFeatures() & GF_FLOPPY) {
+ _dat->open("rtz.dat");
+ _res->open("rtz.prj");
+ } else {
+ error("Unknown RTZ game features");
+ }
+ } else if (getGameID() == GID_MANHOLE) {
+ _engineVersion = 2;
+ _dat->open("manhole.dat");
+ _res->open("manhole.prj");
+ } else if (getGameID() == GID_LGOP2) {
+ _engineVersion = 2;
+ _dat->open("lgop2.dat");
+ _res->open("lgop2.prj");
} else {
- error("Unknown game features");
+ error ("Unknown MADE game");
}
_eventMouseX = _eventMouseY = 0;
diff --git a/engines/made/made.h b/engines/made/made.h
index ad4cd78660..b3a25b4e02 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -47,6 +47,12 @@
namespace Made {
+enum MadeGameID {
+ GID_RTZ = 0,
+ GID_MANHOLE = 1,
+ GID_LGOP2 = 2
+};
+
enum MadeGameFeatures {
GF_DEMO = 1 << 0,
GF_CD = 1 << 1,
@@ -100,6 +106,10 @@ public:
uint16 _eventKey;
int _soundRate;
int _musicVolume;
+
+ // 2 = LGOP2, Manhole N&E
+ // 3 = Return to Zork
+ int _engineVersion;
int32 _timers[50];
int16 getTimer(int16 timerNum);
diff --git a/engines/made/module.mk b/engines/made/module.mk
index 9963f19660..164e1bfba4 100644
--- a/engines/made/module.mk
+++ b/engines/made/module.mk
@@ -11,12 +11,14 @@ MODULE_OBJS = \
resource.o \
screen.o \
script.o \
- scriptfuncs.o \
+ scriptfuncs_lgop2.o \
+ scriptfuncs_mhne.o \
+ scriptfuncs_rtz.o \
sound.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_MADE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 1b51fb3b80..c3b36d3b8c 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -42,6 +42,7 @@ MusicPlayer::MusicPlayer(MidiDriver *driver) : _parser(0), _driver(driver), _loo
_masterVolume = 0;
this->open();
_xmidiParser = MidiParser::createParser_XMIDI();
+ _smfParser = MidiParser::createParser_SMF();
}
MusicPlayer::~MusicPlayer() {
@@ -49,7 +50,9 @@ MusicPlayer::~MusicPlayer() {
stop();
this->close();
_xmidiParser->setMidiDriver(NULL);
+ _smfParser->setMidiDriver(NULL);
delete _xmidiParser;
+ delete _smfParser;
}
void MusicPlayer::setVolume(int volume) {
@@ -140,13 +143,13 @@ void MusicPlayer::onTimer(void *refCon) {
music->_parser->onTimer();
}
-void MusicPlayer::play(XmidiResource *midiResource, MusicFlags flags) {
+void MusicPlayer::playXMIDI(GenericResource *midiResource, MusicFlags flags) {
if (_isPlaying)
return;
stop();
- // Load MIDI/XMI resource data
+ // Load XMID resource data
_isGM = true;
@@ -166,6 +169,32 @@ void MusicPlayer::play(XmidiResource *midiResource, MusicFlags flags) {
}
}
+void MusicPlayer::playSMF(GenericResource *midiResource, MusicFlags flags) {
+ if (_isPlaying)
+ return;
+
+ stop();
+
+ // Load MIDI resource data
+
+ _isGM = true;
+
+ if (_smfParser->loadMusic(midiResource->getData(), midiResource->getSize())) {
+ MidiParser *parser = _smfParser;
+ parser->setTrack(0);
+ parser->setMidiDriver(this);
+ parser->setTimerRate(getBaseTempo());
+ parser->property(MidiParser::mpCenterPitchWheelOnUnload, 1);
+
+ _parser = parser;
+
+ setVolume(255);
+
+ _looping = flags & MUSIC_LOOP;
+ _isPlaying = true;
+ }
+}
+
void MusicPlayer::stop() {
Common::StackLock lock(_mutex);
diff --git a/engines/made/music.h b/engines/made/music.h
index b9fa1004d5..8ef39b4fd3 100644
--- a/engines/made/music.h
+++ b/engines/made/music.h
@@ -54,7 +54,8 @@ public:
void setNativeMT32(bool b) { _nativeMT32 = b; }
bool hasNativeMT32() { return _nativeMT32; }
- void play(XmidiResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
+ void playXMIDI(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
+ void playSMF(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
void stop();
void pause();
void resume();
@@ -86,7 +87,7 @@ protected:
MidiChannel *_channel[16];
MidiDriver *_driver;
- MidiParser *_xmidiParser;
+ MidiParser *_xmidiParser, *_smfParser;
byte _channelVolume[16];
bool _nativeMT32;
bool _isGM;
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index 6faa7f6291..06dc4e5aed 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -160,7 +160,7 @@ void PmvPlayer::play(const char *filename) {
}
_audioStream->finish();
- _mixer->stopAll();
+ _mixer->stopHandle(_audioStreamHandle);
//delete _audioStream;
delete _fd;
@@ -198,7 +198,8 @@ void PmvPlayer::handleEvents() {
}
void PmvPlayer::updateScreen() {
- _vm->_system->copyRectToScreen((const byte*)_surface->pixels, _surface->pitch, 0, 0, _surface->w, _surface->h);
+ _vm->_system->copyRectToScreen((const byte*)_surface->pixels, _surface->pitch,
+ (320 - _surface->w) / 2, (200 - _surface->h) / 2, _surface->w, _surface->h);
_vm->_system->updateScreen();
}
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index f86c6ce371..7151f2424a 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -205,33 +205,69 @@ const char *MenuResource::getString(uint index) const {
return NULL;
}
-/* XmidiResource */
+/* FontResource */
-XmidiResource::XmidiResource() : _data(NULL), _size(0) {
+FontResource::FontResource() : _data(NULL), _size(0) {
}
-XmidiResource::~XmidiResource() {
+FontResource::~FontResource() {
if (_data)
delete[] _data;
}
-void XmidiResource::load(byte *source, int size) {
+void FontResource::load(byte *source, int size) {
_data = new byte[size];
_size = size;
memcpy(_data, source, size);
}
-/* FontResource */
+int FontResource::getHeight() const {
+ return _data[0];
+}
-FontResource::FontResource() : _data(NULL), _size(0) {
+int FontResource::getCharWidth(uint c) const {
+ byte *charData = getCharData(c);
+ if (charData)
+ return charData[0];
+ else
+ return 0;
}
-FontResource::~FontResource() {
+byte *FontResource::getChar(uint c) const {
+ byte *charData = getCharData(c);
+ if (charData)
+ return charData + 1;
+ else
+ return NULL;
+}
+
+int FontResource::getTextWidth(const char *text) {
+ int width = 0;
+ if (text) {
+ int len = strlen(text);
+ for (int pos = 0; pos < len; pos++)
+ width += getCharWidth(text[pos]);
+ }
+ return width;
+}
+
+byte *FontResource::getCharData(uint c) const {
+ if (c < 28 || c > 255)
+ return NULL;
+ return _data + 1 + (c - 28) * (getHeight() + 1);
+}
+
+/* GenericResource */
+
+GenericResource::GenericResource() : _data(NULL), _size(0) {
+}
+
+GenericResource::~GenericResource() {
if (_data)
delete[] _data;
}
-void FontResource::load(byte *source, int size) {
+void GenericResource::load(byte *source, int size) {
_data = new byte[size];
_size = size;
memcpy(_data, source, size);
@@ -301,14 +337,18 @@ MenuResource *ProjectReader::getMenu(int index) {
return createResource<MenuResource>(kResMENU, index);
}
-XmidiResource *ProjectReader::getXmidi(int index) {
- return createResource<XmidiResource>(kResXMID, index);
-}
-
FontResource *ProjectReader::getFont(int index) {
return createResource<FontResource>(kResFONT, index);
}
+GenericResource *ProjectReader::getXmidi(int index) {
+ return createResource<GenericResource>(kResXMID, index);
+}
+
+GenericResource *ProjectReader::getMidi(int index) {
+ return createResource<GenericResource>(kResMIDI, index);
+}
+
void ProjectReader::loadIndex(ResourceSlots *slots) {
_fd->readUint32LE(); // skip INDX
_fd->readUint32LE(); // skip index size
diff --git a/engines/made/resource.h b/engines/made/resource.h
index 4e90673f09..be85561318 100644
--- a/engines/made/resource.h
+++ b/engines/made/resource.h
@@ -35,7 +35,7 @@
namespace Made {
-const int kMaxResourceCacheCount = 100;
+const int kMaxResourceCacheCount = 200;
enum ResourceType {
kResARCH = MKID_BE('ARCH'),
@@ -45,8 +45,9 @@ enum ResourceType {
kResSNDS = MKID_BE('SNDS'),
kResANIM = MKID_BE('ANIM'),
kResMENU = MKID_BE('MENU'),
+ kResFONT = MKID_BE('FONT'),
kResXMID = MKID_BE('XMID'),
- kResFONT = MKID_BE('FONT')
+ kResMIDI = MKID_BE('MIDI')
};
struct ResourceSlot;
@@ -112,23 +113,25 @@ protected:
Common::Array<Common::String> _strings;
};
-class XmidiResource : public Resource {
+class FontResource : public Resource {
public:
- XmidiResource();
- ~XmidiResource();
+ FontResource();
+ ~FontResource();
void load(byte *source, int size);
- byte *getData() const { return _data; }
- int getSize() const { return _size; }
+ int getHeight() const;
+ int getCharWidth(uint c) const;
+ int getTextWidth(const char *text);
+ byte *getChar(uint c) const;
protected:
byte *_data;
int _size;
+ byte *getCharData(uint c) const;
};
-// TODO
-class FontResource : public Resource {
+class GenericResource : public Resource {
public:
- FontResource();
- ~FontResource();
+ GenericResource();
+ ~GenericResource();
void load(byte *source, int size);
byte *getData() const { return _data; }
int getSize() const { return _size; }
@@ -160,8 +163,9 @@ public:
AnimationResource *getAnimation(int index);
SoundResource *getSound(int index);
MenuResource *getMenu(int index);
- XmidiResource *getXmidi(int index);
FontResource *getFont(int index);
+ GenericResource *getXmidi(int index);
+ GenericResource *getMidi(int index);
void freeResource(Resource *resource);
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index ede49e25f4..74053e70a2 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -26,6 +26,7 @@
#include "made/made.h"
#include "made/screen.h"
#include "made/resource.h"
+#include "made/database.h"
namespace Made {
@@ -63,6 +64,21 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
_exclude = 0;
_visualEffectNum = 0;
+
+ _textX = 0;
+ _textY = 0;
+ _textColor = 0;
+ _textRect.left = 0;
+ _textRect.top = 0;
+ _textRect.right = 320;
+ _textRect.bottom = 200;
+ _font = NULL;
+ _currentFontNum = 0;
+ _fontDrawCtx.x = 0;
+ _fontDrawCtx.y = 0;
+ _fontDrawCtx.w = 320;
+ _fontDrawCtx.h = 200;
+ _fontDrawCtx.destSurface = _screen1;
clearChannels();
}
@@ -76,23 +92,41 @@ void Screen::clearScreen() {
_screen1->fillRect(Common::Rect(0, 0, 320, 200), 0);
_screen2->fillRect(Common::Rect(0, 0, 320, 200), 0);
_needPalette = true;
- //_vm->_system->clearScreen();
}
void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, const ClipInfo &clipInfo) {
- byte *source = (byte*)sourceSurface->getBasePtr(0, 0);
- byte *dest = (byte*)clipInfo.destSurface->getBasePtr(x, y);
+ byte *source, *dest;
+ int startX = 0;
+ int startY = 0;
+ int clipWidth = sourceSurface->w;
+ int clipHeight = sourceSurface->h;
+
+ if (x < 0) {
+ startX = -x;
+ clipWidth -= startX;
+ x = 0;
+ }
+
+ if (y < 0) {
+ startY = -y;
+ clipHeight -= startY;
+ y = 0;
+ }
- // FIXME: Implement actual clipping
- if (x + sourceSurface->w > clipInfo.destSurface->w || y + sourceSurface->h > clipInfo.destSurface->h) {
- debug(2, "CLIPPING PROBLEM: x = %d; y = %d; w = %d; h = %d; x+w = %d; y+h = %d\n",
- x, y, sourceSurface->w, sourceSurface->h, x + sourceSurface->w, y + sourceSurface->h);
- return;
+ if (x + clipWidth > clipInfo.x + clipInfo.w) {
+ clipWidth = clipInfo.x + clipInfo.w - x;
}
- for (int16 yc = 0; yc < sourceSurface->h; yc++) {
- for (int16 xc = 0; xc < sourceSurface->w; xc++) {
+ if (y + clipHeight > clipInfo.y + clipInfo.h) {
+ clipHeight = clipInfo.y + clipInfo.h - y;
+ }
+
+ source = (byte*)sourceSurface->getBasePtr(startX, startY);
+ dest = (byte*)clipInfo.destSurface->getBasePtr(x, y);
+
+ for (int16 yc = 0; yc < clipHeight; yc++) {
+ for (int16 xc = 0; xc < clipWidth; xc++) {
if (source[xc])
dest[xc] = source[xc];
}
@@ -117,7 +151,7 @@ void Screen::setRGBPalette(byte *palRGB, int start, int count) {
}
uint16 Screen::updateChannel(uint16 channelIndex) {
- return 0;
+ return channelIndex;
}
void Screen::deleteChannel(uint16 channelIndex) {
@@ -196,7 +230,7 @@ void Screen::drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask
break;
case 2: // drawObjectText
- // TODO
+ printObjectText(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].fontNum, _channels[i].textColor, _channels[i].outlineColor, clipInfo);
break;
case 3: // drawAnimFrame
@@ -287,10 +321,6 @@ void Screen::drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, u
}
uint16 Screen::drawPic(uint16 index, int16 x, int16 y, uint16 flag1, uint16 flag2) {
-
- //HACK (until clipping is implemented)
- if (y > 200) y = 0;
-
drawFlex(index, x, y, flag1, flag2, _clipInfo1);
return 0;
}
@@ -444,7 +474,63 @@ int16 Screen::getAnimFrameCount(uint16 animIndex) {
uint16 Screen::placeText(uint16 channelIndex, uint16 textObjectIndex, int16 x, int16 y, uint16 fontNum, int16 textColor, int16 outlineColor) {
- return 0;
+
+ if (channelIndex < 1 || channelIndex >= 100 || textObjectIndex == 0 || fontNum == 0)
+ return 0;
+
+ channelIndex--;
+
+ Object *obj = _vm->_dat->getObject(textObjectIndex);
+ const char *text = obj->getString();
+
+ int16 x1, y1, x2, y2;
+
+ setFont(fontNum);
+
+ int textWidth = _font->getTextWidth(text);
+ int textHeight = _font->getHeight();
+
+ if (outlineColor != -1) {
+ textWidth += 2;
+ textHeight += 2;
+ x--;
+ y--;
+ }
+
+ x1 = x;
+ y1 = y;
+ x2 = x + textWidth;
+ y2 = y + textHeight;
+ //TODO: clipRect(x1, y1, x2, y2);
+
+ if (textWidth > 0 && outlineColor != -1) {
+ x++;
+ y++;
+ }
+
+ int16 state = 1;
+
+ if (_ground == 0)
+ state |= 2;
+
+ _channels[channelIndex].state = state;
+ _channels[channelIndex].type = 2;
+ _channels[channelIndex].index = textObjectIndex;
+ _channels[channelIndex].x = x;
+ _channels[channelIndex].y = y;
+ _channels[channelIndex].textColor = textColor;
+ _channels[channelIndex].fontNum = fontNum;
+ _channels[channelIndex].outlineColor = outlineColor;
+ _channels[channelIndex].x1 = x1;
+ _channels[channelIndex].y1 = y1;
+ _channels[channelIndex].x2 = x2;
+ _channels[channelIndex].y2 = y2;
+ _channels[channelIndex].area = (x2 - x2) * (y2 - y1);
+
+ if (_channelsUsedCount <= channelIndex)
+ _channelsUsedCount = channelIndex + 1;
+
+ return channelIndex + 1;
}
void Screen::show() {
@@ -488,4 +574,159 @@ void Screen::flash(int flashCount) {
}
}
+void Screen::setFont(int16 fontNum) {
+ if (fontNum == _currentFontNum)
+ return;
+ if (_font)
+ _vm->_res->freeResource(_font);
+ _font = _vm->_res->getFont(fontNum);
+ _currentFontNum = fontNum;
+}
+
+void Screen::printChar(uint c, int16 x, int16 y, byte color) {
+
+ if (!_font)
+ return;
+
+ int height = _font->getHeight();
+ byte *charData = _font->getChar(c);
+
+ if (!charData)
+ return;
+
+ byte p;
+ byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y);
+
+ for (int16 yc = 0; yc < height; yc++) {
+ p = charData[yc];
+ for (int16 xc = 0; xc < 8; xc++) {
+ if (p & 0x80)
+ dest[xc] = color;
+ p <<= 1;
+ }
+ dest += _fontDrawCtx.destSurface->pitch;
+ }
+
+}
+
+void Screen::printText(const char *text) {
+
+ const int tabWidth = 5;
+
+ if (!_font)
+ return;
+
+ int textLen = strlen(text);
+ int textHeight = _font->getHeight();
+ int linePos = 1;
+ int16 x = _textX;
+ int16 y = _textY;
+
+ for (int textPos = 0; textPos < textLen; textPos++) {
+
+ uint c = text[textPos];
+ int charWidth = _font->getCharWidth(c);
+
+ if (c == 9) {
+ linePos = ((linePos / tabWidth) + 1) * tabWidth;
+ x = _textRect.left + linePos * _font->getCharWidth(32);
+ } else if (c == 10) {
+ linePos = 1;
+ x = _textRect.left;
+ y += textHeight;
+ } else if (c == 13) {
+ linePos = 1;
+ x = _textRect.left;
+ } else if (c == 32) {
+ int wrapPos = textPos + 1;
+ int wrapX = x + charWidth;
+ while (wrapPos < textLen && text[wrapPos] != 0 && text[wrapPos] != 32 && text[wrapPos] >= 28) {
+ wrapX += _font->getCharWidth(text[wrapPos]);
+ wrapPos++;
+ }
+ if (wrapX >= _textRect.right) {
+ linePos = 1;
+ x = _textRect.left;
+ y += textHeight;
+ charWidth = 0;
+ // TODO: text[textPos] = '\x01';
+ }
+ }
+
+ if (x + charWidth > _textRect.right) {
+ linePos = 1;
+ x = _textRect.left;
+ y += textHeight;
+ }
+
+ if (y + textHeight > _textRect.bottom) {
+ // TODO
+ }
+
+ if (c >= 28 && c <= 255) {
+ if (_dropShadowColor != -1) {
+ printChar(c, x + 1, y + 1, _dropShadowColor);
+ }
+ if (_outlineColor != -1) {
+ printChar(c, x, y - 1, _outlineColor);
+ printChar(c, x, y + 1, _outlineColor);
+ printChar(c, x - 1, y, _outlineColor);
+ printChar(c, x + 1, y, _outlineColor);
+ printChar(c, x - 1, y - 1, _outlineColor);
+ printChar(c, x - 1, y + 1, _outlineColor);
+ printChar(c, x + 1, y - 1, _outlineColor);
+ printChar(c, x + 1, y + 1, _outlineColor);
+ }
+ printChar(c, x, y, _textColor);
+ x += charWidth;
+ linePos++;
+ }
+
+ }
+
+ _textX = x;
+ _textY = y;
+
+}
+
+void Screen::printTextEx(const char *text, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo) {
+ if (*text == 0 || x == 0 || y == 0)
+ return;
+
+ int16 oldFontNum = _currentFontNum;
+ Common::Rect oldTextRect;
+ ClipInfo oldFontDrawCtx = _fontDrawCtx;
+
+ _fontDrawCtx = clipInfo;
+
+ getTextRect(oldTextRect);
+ setFont(fontNum);
+ setTextColor(textColor);
+ setOutlineColor(outlineColor);
+ setTextXY(x, y);
+ printText(text);
+ setTextRect(oldTextRect);
+ setFont(oldFontNum);
+ _fontDrawCtx = oldFontDrawCtx;
+
+}
+
+void Screen::printObjectText(int16 objectIndex, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo) {
+
+ if (objectIndex == 0)
+ return;
+
+ Object *obj = _vm->_dat->getObject(objectIndex);
+ const char *text = obj->getString();
+
+ printTextEx(text, x, y, fontNum, textColor, outlineColor, clipInfo);
+
+}
+
+int16 Screen::getTextWidth(int16 fontNum, const char *text) {
+ setFont(fontNum);
+ return _font->getTextWidth(text);
+}
+
+
} // End of namespace Made
diff --git a/engines/made/screen.h b/engines/made/screen.h
index 543af81bf8..0ca28086f9 100644
--- a/engines/made/screen.h
+++ b/engines/made/screen.h
@@ -31,6 +31,8 @@
#include "graphics/surface.h"
+#include "made/resource.h"
+
namespace Made {
struct SpriteChannel {
@@ -70,8 +72,33 @@ public:
void setClip(uint16 clip) { _clip = clip; }
void setExclude(uint16 exclude) { _exclude = exclude; }
void setGround(uint16 ground) { _ground = ground; }
- void setFont(uint16 font) { _currentFont = font; }
-
+ void setTextColor(int16 color) { _textColor = color; }
+
+ void setTextRect(const Common::Rect &textRect) {
+ _textRect = textRect;
+ _textX = _textRect.left;
+ _textY = _textRect.top;
+ }
+
+ void getTextRect(Common::Rect &textRect) {
+ textRect = _textRect;
+ }
+
+ void setOutlineColor(int16 color) {
+ _outlineColor = color;
+ _dropShadowColor = -1;
+ }
+
+ void setDropShadowColor(int16 color) {
+ _outlineColor = -1;
+ _dropShadowColor = color;
+ }
+
+ void setTextXY(int16 x, int16 y) {
+ _textX = x;
+ _textY = y;
+ }
+
uint16 updateChannel(uint16 channelIndex);
void deleteChannel(uint16 channelIndex);
int16 getChannelType(uint16 channelIndex);
@@ -105,7 +132,13 @@ public:
void show();
void flash(int count);
- byte _screenPalette[256 * 4];
+ void setFont(int16 fontNum);
+ void printChar(uint c, int16 x, int16 y, byte color);
+ void printText(const char *text);
+ void printTextEx(const char *text, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo);
+ void printObjectText(int16 objectIndex, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo);
+ int16 getTextWidth(int16 fontNum, const char *text);
+
protected:
MadeEngine *_vm;
@@ -113,10 +146,19 @@ protected:
bool _screenLock;
bool _paletteLock;
+ byte _screenPalette[256 * 4];
byte _palette[768], _newPalette[768], _fxPalette[768];
int _paletteColorCount, _oldPaletteColorCount;
bool _paletteInitialized, _needPalette;
- uint16 _currentFont;
+ int16 _textColor;
+ int16 _outlineColor;
+ int16 _dropShadowColor;
+
+ int16 _textX, _textY;
+ Common::Rect _textRect;
+ int16 _currentFontNum;
+ FontResource *_font;
+ ClipInfo _fontDrawCtx;
uint16 _clip, _exclude, _ground;
int _visualEffectNum;
diff --git a/engines/made/script.cpp b/engines/made/script.cpp
index 579abab7c3..74dc9e0d9f 100644
--- a/engines/made/script.cpp
+++ b/engines/made/script.cpp
@@ -33,110 +33,6 @@
namespace Made {
-
-const char *extendFuncNames[] = {
- "SYSTEM",
- "INITGRAF",
- "RESTOREGRAF",
- "DRAWPIC",
- "CLS",
- "SHOWPAGE",
- "EVENT",
- "EVENTX",
- "EVENTY",
- "EVENTKEY",
- "VISUALFX",
- "PLAYSND",
- "PLAYMUS",
- "STOPMUS",
- "ISMUS",
- "TEXTPOS",
- "FLASH",
- "PLAYNOTE",
- "STOPNOTE",
- "PLAYTELE",
- "STOPTELE",
- "HIDECURS",
- "SHOWCURS",
- "MUSICBEAT",
- "SCREENLOCK",
- "ADDSPRITE",
- "FREEANIM",
- "DRAWSPRITE",
- "ERASESPRITES",
- "UPDATESPRITES",
- "GETTIMER",
- "SETTIMER",
- "RESETTIMER",
- "ALLOCTIMER",
- "FREETIMER",
- "PALETTELOCK",
- "FONT",
- "DRAWTEXT",
- "HOMETEXT",
- "TEXTRECT",
- "TEXTXY",
- "DROPSHADOW",
- "TEXTCOLOR",
- "OUTLINE",
- "LOADCURSOR",
- "SETGROUND",
- "RESTEXT",
- "CLIPAREA",
- "SETCLIP",
- "ISSND",
- "STOPSND",
- "PLAYVOICE",
- "CDPLAY",
- "STOPCD",
- "CDSTATUS",
- "CDTIME",
- "CDPLAYSEG",
- "PRINTF",
- "MONOCLS",
- "SNDENERGY",
- "CLEARTEXT",
- "ANIMTEXT",
- "TEXTWIDTH",
- "PLAYMOVIE",
- "LOADSND",
- "LOADMUS",
- "LOADPIC",
- "MUSICVOL",
- "RESTARTEVENTS",
- "PLACESPRITE",
- "PLACETEXT",
- "DELETECHANNEL",
- "CHANNELTYPE",
- "SETSTATE",
- "SETLOCATION",
- "SETCONTENT",
- "EXCLUDEAREA",
- "SETEXCLUDE",
- "GETSTATE",
- "PLACEANIM",
- "SETFRAME",
- "GETFRAME",
- "GETFRAMECOUNT",
- "PICWIDTH",
- "PICHEIGHT",
- "SOUNDRATE",
- "DRAWANIMPIC",
- "LOADANIM",
- "READTEXT",
- "READMENU",
- "DRAWMENU",
- "MENUCOUNT",
- "SAVEGAME",
- "LOADGAME",
- "GAMENAME",
- "SHAKESCREEN",
- "PLACEMENU",
- "SETVOLUME",
- "WHATSYNTH",
- "SLOWSYSTEM"
-};
-
/* ScriptStack */
ScriptStack::ScriptStack() {
@@ -275,8 +171,16 @@ ScriptInterpreter::ScriptInterpreter(MadeEngine *vm) : _vm(vm) {
};
_commands = commandProcs;
_commandsMax = ARRAYSIZE(commandProcs) + 1;
-
- _functions = new ScriptFunctionsRtz(_vm);
+
+ if (_vm->getGameID() == GID_RTZ)
+ _functions = new ScriptFunctionsRtz(_vm);
+ else if (_vm->getGameID() == GID_LGOP2)
+ _functions = new ScriptFunctionsLgop2(_vm);
+ else if (_vm->getGameID() == GID_MANHOLE)
+ _functions = new ScriptFunctionsMhne(_vm);
+ else
+ error("Unsupported GameID");
+
_functions->setupExternalsTable();
#undef COMMAND
@@ -302,7 +206,7 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
debug(4, "opcode = %s\n", _commands[opcode - 1].desc);
(this->*_commands[opcode - 1].proc)();
} else {
- printf("ScriptInterpreter::runScript(%d) Unknown opcode %02X\n", _runningScriptObjectIndex, opcode);
+ warning("ScriptInterpreter::runScript(%d) Unknown opcode %02X\n", _runningScriptObjectIndex, opcode);
}
}
@@ -442,7 +346,6 @@ void ScriptInterpreter::cmd_getObjectProperty() {
int16 objectIndex = _stack.top();
int16 value = _vm->_dat->getObjectProperty(objectIndex, propertyId);
debug(4, "value = %04X(%d)\n", value, value);
- //fflush(stdout); g_system->delayMillis(5000);
_stack.setTop(value);
}
@@ -451,7 +354,6 @@ void ScriptInterpreter::cmd_setObjectProperty() {
int16 propertyId = _stack.pop();
int16 objectIndex = _stack.top();
value = _vm->_dat->setObjectProperty(objectIndex, propertyId, value);
- //fflush(stdout); g_system->delayMillis(5000);
_stack.setTop(value);
}
@@ -481,9 +383,9 @@ void ScriptInterpreter::cmd_printNumber() {
}
void ScriptInterpreter::cmd_vref() {
+ int16 value = 0;
int16 index = _stack.pop();
int16 objectIndex = _stack.top();
- int16 value = 0;
debug(4, "index = %d; objectIndex = %d\n", index, objectIndex); fflush(stdout);
if (objectIndex > 0) {
Object *obj = _vm->_dat->getObject(objectIndex);
@@ -507,9 +409,11 @@ void ScriptInterpreter::cmd_vset() {
void ScriptInterpreter::cmd_vsize() {
int16 objectIndex = _stack.top();
- if (objectIndex < 1) objectIndex = 1; // HACK
- Object *obj = _vm->_dat->getObject(objectIndex);
- int16 size = obj->getVectorSize();
+ int16 size = 0;
+ if (objectIndex > 0) {
+ Object *obj = _vm->_dat->getObject(objectIndex);
+ size = obj->getVectorSize();
+ }
_stack.setTop(size);
}
@@ -522,7 +426,6 @@ void ScriptInterpreter::cmd_return() {
int16 funcResult = _stack.top();
_stack.setStackPos(_localStackPos);
_localStackPos = kScriptStackLimit - _stack.pop();
- //_localStackPos = _stack.pop();
_runningScriptObjectIndex = _stack.pop();
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase + _stack.pop();
@@ -544,7 +447,6 @@ void ScriptInterpreter::cmd_call() {
debug(4, "argc = %d; _runningScriptObjectIndex = %04X\n", argc, _runningScriptObjectIndex); fflush(stdout);
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase;
- //_vm->_dat->dumpObject(_runningScriptObjectIndex);
}
void ScriptInterpreter::cmd_svar() {
@@ -623,12 +525,11 @@ void ScriptInterpreter::cmd_restart() {
}
void ScriptInterpreter::cmd_rand() {
- warning("Unimplemented command: cmd_rand");
+ _stack.setTop(_vm->_rnd->getRandomNumber(_stack.top() - 1));
}
void ScriptInterpreter::cmd_randomize() {
- warning("Unimplemented command: cmd_randomize");
- // TODO
+ _vm->_rnd->setSeed(g_system->getMillis());
_stack.setTop(0);
}
@@ -682,7 +583,8 @@ void ScriptInterpreter::cmd_extend() {
byte argc = readByte();
int16 *argv = _stack.getStackPtr();
- debug(4, "func = %d (%s); argc = %d\n", func, extendFuncNames[func], argc);
+ //debug(4, "func = %d (%s); argc = %d\n", func, extendFuncNames[func], argc);
+ debug(4, "func = %d; argc = %d\n", func, argc);
for (int i = 0; i < argc; i++)
debug(4, "argv[%02d] = %04X (%d)\n", i, argv[i], argv[i]);
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 7a75e4551c..7fc61ee410 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -165,23 +165,22 @@ void ScriptFunctionsRtz::setupExternalsTable() {
#undef External
int16 ScriptFunctionsRtz::o1_SYSTEM(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SYSTEM");
+ // This opcode is empty.
return 0;
}
int16 ScriptFunctionsRtz::o1_INITGRAF(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_INITGRAF");
+ // This opcode is empty.
return 0;
}
int16 ScriptFunctionsRtz::o1_RESTOREGRAF(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTOREGRAF");
+ // This opcode is empty.
return 0;
}
int16 ScriptFunctionsRtz::o1_DRAWPIC(int16 argc, int16 *argv) {
- int16 channel = _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
- return channel;
+ return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
}
int16 ScriptFunctionsRtz::o1_CLS(int16 argc, int16 *argv) {
@@ -219,25 +218,7 @@ int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) {
case Common::EVENT_KEYDOWN:
_vm->_eventKey = event.kbd.ascii;
- switch (_vm->_eventKey) {
- case '1':
- eventNum = 1;
- break;
- case '2':
- eventNum = 2;
- break;
- case '3':
- eventNum = 3;
- break;
- case '4':
- eventNum = 4;
- break;
- case '5':
- eventNum = 5;
- break;
- default:
- break;
- }
+ eventNum = 5;
break;
case Common::EVENT_QUIT:
@@ -252,7 +233,6 @@ int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) {
}
_vm->_system->updateScreen();
- //g_system->delayMillis(10);
return eventNum;
}
@@ -275,18 +255,18 @@ int16 ScriptFunctionsRtz::o1_VISUALFX(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
- int soundId = argv[0];
+ int soundNum = argv[0];
bool loop = false;
if (argc > 1) {
- soundId = argv[1];
+ soundNum = argv[1];
loop = (argv[0] == 1);
}
- if (soundId > 0) {
+ if (soundNum > 0) {
if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
_vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(soundId)->getAudioStream(_vm->_soundRate, loop));
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
}
}
@@ -294,9 +274,9 @@ int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_PLAYMUS(int16 argc, int16 *argv) {
- int16 musicId = argv[0];
- if (musicId > 0) {
- XmidiResource *xmidi = _vm->_res->getXmidi(musicId);
+ int16 musicNum = argv[0];
+ if (musicNum > 0) {
+ XmidiResource *xmidi = _vm->_res->getXmidi(musicNum);
_vm->_music->play(xmidi);
_vm->_res->freeResource(xmidi);
}
@@ -317,6 +297,8 @@ int16 ScriptFunctionsRtz::o1_ISMUS(int16 argc, int16 *argv) {
int16 ScriptFunctionsRtz::o1_TEXTPOS(int16 argc, int16 *argv) {
warning("Unimplemented opcode: o1_TEXTPOS");
+ // This seems to be some kind of low-level opcode.
+ // The original engine calls int 10h to set the VGA cursor position.
return 0;
}
@@ -421,16 +403,14 @@ int16 ScriptFunctionsRtz::o1_PALETTELOCK(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_FONT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_FONT");
-
- uint16 fontID = argv[0];
- printf("Set font to %i\n", fontID);
- _vm->_screen->setFont(fontID);
+ _vm->_screen->setFont(argv[0]);
return 0;
}
int16 ScriptFunctionsRtz::o1_DRAWTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DRAWTEXT");
+ Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+ const char *text = obj->getString();
+ _vm->_screen->printText(text);
return 0;
}
@@ -440,32 +420,39 @@ int16 ScriptFunctionsRtz::o1_HOMETEXT(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_TEXTRECT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTRECT");
+ int16 x1 = CLIP<int16>(argv[4], 1, 318);
+ int16 y1 = CLIP<int16>(argv[3], 1, 198);
+ int16 x2 = CLIP<int16>(argv[2], 1, 318);
+ int16 y2 = CLIP<int16>(argv[1], 1, 198);
+ //int16 textValue = argv[0];
+ // TODO: textValue
+ _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
return 0;
}
int16 ScriptFunctionsRtz::o1_TEXTXY(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTXY");
-
- int16 x = CLIP<int16>(argv[0], 1, 318);
- int16 y = CLIP<int16>(argv[1], 1, 198);
-
- printf("Text: x = %i, y = %i\n", x, y);
+ int16 x = CLIP<int16>(argv[1], 1, 318);
+ int16 y = CLIP<int16>(argv[0], 1, 198);
+ _vm->_screen->setTextXY(x, y);
return 0;
}
int16 ScriptFunctionsRtz::o1_DROPSHADOW(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DROPSHADOW");
+ // if the drop shadow color is -1, then text drop shadow is disabled
+ // when font drop shadow is enabled, outline is disabled
+ _vm->_screen->setDropShadowColor(argv[0]);
return 0;
}
int16 ScriptFunctionsRtz::o1_TEXTCOLOR(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTCOLOR");
+ _vm->_screen->setTextColor(argv[0]);
return 0;
}
int16 ScriptFunctionsRtz::o1_OUTLINE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_OUTLINE");
+ // if the outline color is -1, then text outline is disabled
+ // when font outline is enabled, drop shadow is disabled
+ _vm->_screen->setOutlineColor(argv[0]);
return 0;
}
@@ -548,7 +535,9 @@ int16 ScriptFunctionsRtz::o1_CDPLAYSEG(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_PRINTF(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PRINTF");
+ Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+ const char *text = obj->getString();
+ debug(4, "--> text = %s", text);
return 0;
}
@@ -560,6 +549,7 @@ int16 ScriptFunctionsRtz::o1_MONOCLS(int16 argc, int16 *argv) {
int16 ScriptFunctionsRtz::o1_SNDENERGY(int16 argc, int16 *argv) {
// This is called while in-game voices are played
// Not sure what it's used for
+ // -> It's used to animate mouths when NPCs are talking
// Commented out to reduce spam
//warning("Unimplemented opcode: o1_SNDENERGY");
return 0;
@@ -567,7 +557,7 @@ int16 ScriptFunctionsRtz::o1_SNDENERGY(int16 argc, int16 *argv) {
int16 ScriptFunctionsRtz::o1_CLEARTEXT(int16 argc, int16 *argv) {
warning("Unimplemented opcode: o1_CLEARTEXT");
- return 0;
+ return 1;
}
int16 ScriptFunctionsRtz::o1_ANIMTEXT(int16 argc, int16 *argv) {
@@ -576,11 +566,13 @@ int16 ScriptFunctionsRtz::o1_ANIMTEXT(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_TEXTWIDTH(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[1]);
- const char *text = obj->getString();
- debug(4, "text = %s\n", text);
- // TODO
- return 0;
+ int16 width = 0;
+ if (argv[1] > 0) {
+ Object *obj = _vm->_dat->getObject(argv[1]);
+ const char *text = obj->getString();
+ width = _vm->_screen->getTextWidth(argv[0], text);
+ }
+ return width;
}
int16 ScriptFunctionsRtz::o1_PLAYMOVIE(int16 argc, int16 *argv) {
@@ -631,10 +623,7 @@ int16 ScriptFunctionsRtz::o1_PLACESPRITE(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_PLACETEXT(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[5]);
- const char *text = obj->getString();
- debug(4, "text = %s\n", text); fflush(stdout);
- return 0;
+ return _vm->_screen->placeText(argv[6], argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
}
int16 ScriptFunctionsRtz::o1_DELETECHANNEL(int16 argc, int16 *argv) {
@@ -743,41 +732,104 @@ int16 ScriptFunctionsRtz::o1_READMENU(int16 argc, int16 *argv) {
int16 objectIndex = argv[2];
int16 menuIndex = argv[1];
int16 textIndex = argv[0];
+ int16 length = 0;
MenuResource *menu = _vm->_res->getMenu(menuIndex);
if (menu) {
const char *text = menu->getString(textIndex);
- debug(4, "text = %s\n", text); fflush(stdout);
+ debug(4, "objectIndex = %04X; text = %s\n", objectIndex, text);
Object *obj = _vm->_dat->getObject(objectIndex);
obj->setString(text);
_vm->_res->freeResource(menu);
+ if (text)
+ length = strlen(text);
}
-
- return 0;
+ return length;
}
int16 ScriptFunctionsRtz::o1_DRAWMENU(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DRAWMENU");
+ int16 menuIndex = argv[1];
+ int16 textIndex = argv[0];
+ MenuResource *menu = _vm->_res->getMenu(menuIndex);
+ if (menu) {
+ const char *text = menu->getString(textIndex);
+ if (text)
+ _vm->_screen->printText(text);
+ _vm->_res->freeResource(menu);
+ }
return 0;
}
int16 ScriptFunctionsRtz::o1_MENUCOUNT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MENUCOUNT");
- return 0;
+ int16 menuIndex = argv[0];
+ int16 count = 0;
+ MenuResource *menu = _vm->_res->getMenu(menuIndex);
+ if (menu) {
+ count = menu->getCount();
+ _vm->_res->freeResource(menu);
+ }
+ return count;
}
int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SAVEGAME");
- return 0;
+
+ int16 saveNum = argv[2];
+ int16 descObjectIndex = argv[1];
+ int16 version = argv[0];
+
+ if (saveNum > 999)
+ return 6;
+
+ Object *obj = _vm->_dat->getObject(descObjectIndex);
+ const char *description = obj->getString();
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ return _vm->_dat->savegame(filename, description, version);
+
}
int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_LOADGAME");
- return 0;
+
+ int16 saveNum = argv[1];
+ int16 version = argv[0];
+
+ if (saveNum > 999)
+ return 1;
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ return _vm->_dat->loadgame(filename, version);
+
}
int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_GAMENAME");
- return 0;
+
+ int16 descObjectIndex = argv[2];
+ int16 saveNum = argv[1];
+ /*int16 version = argv[0];*/
+ Common::String description;
+
+ if (saveNum > 999)
+ return 1;
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ Object *obj = _vm->_dat->getObject(descObjectIndex);
+
+ if (_vm->_dat->getSavegameDescription(filename, description)) {
+ obj->setString(description.c_str());
+ return 0;
+ } else {
+ obj->setString("");
+ return 1;
+ }
+
}
int16 ScriptFunctionsRtz::o1_SHAKESCREEN(int16 argc, int16 *argv) {
@@ -797,6 +849,11 @@ int16 ScriptFunctionsRtz::o1_SETVOLUME(int16 argc, int16 *argv) {
}
int16 ScriptFunctionsRtz::o1_WHATSYNTH(int16 argc, int16 *argv) {
+ // 0 = Default
+ // 1 = PCSPKR
+ // 2 = SBFM/ADLIB
+ // 3 = ADLIBG
+ // 4 = MT32MPU
warning("Unimplemented opcode: o1_WHATSYNTH");
return 0;
}
diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h
index 2f6def0fa9..7e826a9f5e 100644
--- a/engines/made/scriptfuncs.h
+++ b/engines/made/scriptfuncs.h
@@ -41,7 +41,13 @@ class ScriptFunctions {
public:
ScriptFunctions(MadeEngine *vm) : _vm(vm) {}
virtual ~ScriptFunctions() {}
- int16 callFunction(uint16 index, int16 argc, int16 *argv);
+ int16 callFunction(uint16 index, int16 argc, int16 *argv) {
+ if (index >= _externalFuncs.size()) {
+ // TODO: ERROR!
+ return 0;
+ }
+ return (*_externalFuncs[index])(argc, argv);
+ }
virtual void setupExternalsTable() = 0;
protected:
MadeEngine *_vm;
@@ -52,6 +58,67 @@ protected:
};
+class ScriptFunctionsLgop2 : public ScriptFunctions {
+public:
+ ScriptFunctionsLgop2(MadeEngine *vm) : ScriptFunctions(vm) {}
+ ~ScriptFunctionsLgop2() {}
+ void setupExternalsTable();
+protected:
+
+ int16 o1_SYSTEM(int16 argc, int16 *argv);
+ int16 o1_INITGRAF(int16 argc, int16 *argv);
+ int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
+ int16 o1_DRAWPIC(int16 argc, int16 *argv);
+ int16 o1_CLS(int16 argc, int16 *argv);
+ int16 o1_SHOWPAGE(int16 argc, int16 *argv);
+ int16 o1_EVENT(int16 argc, int16 *argv);
+ int16 o1_EVENTX(int16 argc, int16 *argv);
+ int16 o1_EVENTY(int16 argc, int16 *argv);
+ int16 o1_EVENTKEY(int16 argc, int16 *argv);
+ int16 o1_VISUALFX(int16 argc, int16 *argv);
+ int16 o1_PLAYSND(int16 argc, int16 *argv);
+ int16 o1_PLAYMUS(int16 argc, int16 *argv);
+ int16 o1_STOPMUS(int16 argc, int16 *argv);
+ int16 o1_ISMUS(int16 argc, int16 *argv);
+ int16 o1_TEXTPOS(int16 argc, int16 *argv);
+ int16 o1_FLASH(int16 argc, int16 *argv);
+ int16 o1_PLAYNOTE(int16 argc, int16 *argv);
+ int16 o1_STOPNOTE(int16 argc, int16 *argv);
+ int16 o1_PLAYTELE(int16 argc, int16 *argv);
+ int16 o1_STOPTELE(int16 argc, int16 *argv);
+ int16 o1_HIDECURS(int16 argc, int16 *argv);
+ int16 o1_SHOWCURS(int16 argc, int16 *argv);
+ int16 o1_MUSICBEAT(int16 argc, int16 *argv);
+ int16 o1_SCREENLOCK(int16 argc, int16 *argv);
+ int16 o1_ADDSPRITE(int16 argc, int16 *argv);
+ int16 o1_FREEANIM(int16 argc, int16 *argv);
+ int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
+ int16 o1_ERASESPRITES(int16 argc, int16 *argv);
+ int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
+ int16 o1_GETTIMER(int16 argc, int16 *argv);
+ int16 o1_SETTIMER(int16 argc, int16 *argv);
+ int16 o1_RESETTIMER(int16 argc, int16 *argv);
+ int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
+ int16 o1_FREETIMER(int16 argc, int16 *argv);
+ int16 o1_PALETTELOCK(int16 argc, int16 *argv);
+ int16 o1_FONT(int16 argc, int16 *argv);
+ int16 o1_DRAWTEXT(int16 argc, int16 *argv);
+ int16 o1_HOMETEXT(int16 argc, int16 *argv);
+ int16 o1_TEXTRECT(int16 argc, int16 *argv);
+ int16 o1_TEXTXY(int16 argc, int16 *argv);
+ int16 o1_DROPSHADOW(int16 argc, int16 *argv);
+ int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
+ int16 o1_OUTLINE(int16 argc, int16 *argv);
+ int16 o1_LOADCURSOR(int16 argc, int16 *argv);
+ int16 o1_SETGROUND(int16 argc, int16 *argv);
+ int16 o1_RESTEXT(int16 argc, int16 *argv);
+ int16 o1_ADDMASK(int16 argc, int16 *argv);
+ int16 o1_SETMASK(int16 argc, int16 *argv);
+ int16 o1_ISSND(int16 argc, int16 *argv);
+ int16 o1_STOPSND(int16 argc, int16 *argv);
+ int16 o1_PLAYVOICE(int16 argc, int16 *argv);
+};
+
class ScriptFunctionsRtz : public ScriptFunctions {
public:
ScriptFunctionsRtz(MadeEngine *vm) : ScriptFunctions(vm) {}
@@ -159,7 +226,72 @@ protected:
int16 o1_SETVOLUME(int16 argc, int16 *argv);
int16 o1_WHATSYNTH(int16 argc, int16 *argv);
int16 o1_SLOWSYSTEM(int16 argc, int16 *argv);
+};
+
+class ScriptFunctionsMhne : public ScriptFunctions {
+public:
+ ScriptFunctionsMhne(MadeEngine *vm) : ScriptFunctions(vm) {}
+ ~ScriptFunctionsMhne() {}
+ void setupExternalsTable();
+protected:
+ int16 o1_SYSTEM(int16 argc, int16 *argv);
+ int16 o1_INITGRAF(int16 argc, int16 *argv);
+ int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
+ int16 o1_DRAWPIC(int16 argc, int16 *argv);
+ int16 o1_CLS(int16 argc, int16 *argv);
+ int16 o1_SHOWPAGE(int16 argc, int16 *argv);
+ int16 o1_EVENT(int16 argc, int16 *argv);
+ int16 o1_EVENTX(int16 argc, int16 *argv);
+ int16 o1_EVENTY(int16 argc, int16 *argv);
+ int16 o1_EVENTKEY(int16 argc, int16 *argv);
+ int16 o1_VISUALFX(int16 argc, int16 *argv);
+ int16 o1_PLAYSND(int16 argc, int16 *argv);
+ int16 o1_PLAYMUS(int16 argc, int16 *argv);
+ int16 o1_STOPMUS(int16 argc, int16 *argv);
+ int16 o1_ISMUS(int16 argc, int16 *argv);
+ int16 o1_TEXTPOS(int16 argc, int16 *argv);
+ int16 o1_FLASH(int16 argc, int16 *argv);
+ int16 o1_PLAYNOTE(int16 argc, int16 *argv);
+ int16 o1_STOPNOTE(int16 argc, int16 *argv);
+ int16 o1_PLAYTELE(int16 argc, int16 *argv);
+ int16 o1_STOPTELE(int16 argc, int16 *argv);
+ int16 o1_HIDECURS(int16 argc, int16 *argv);
+ int16 o1_SHOWCURS(int16 argc, int16 *argv);
+ int16 o1_MUSICBEAT(int16 argc, int16 *argv);
+ int16 o1_SCREENLOCK(int16 argc, int16 *argv);
+ int16 o1_ADDSPRITE(int16 argc, int16 *argv);
+ int16 o1_FREEANIM(int16 argc, int16 *argv);
+ int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
+ int16 o1_ERASESPRITES(int16 argc, int16 *argv);
+ int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
+ int16 o1_GETTIMER(int16 argc, int16 *argv);
+ int16 o1_SETTIMER(int16 argc, int16 *argv);
+ int16 o1_RESETTIMER(int16 argc, int16 *argv);
+ int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
+ int16 o1_FREETIMER(int16 argc, int16 *argv);
+ int16 o1_PALETTELOCK(int16 argc, int16 *argv);
+ int16 o1_FONT(int16 argc, int16 *argv);
+ int16 o1_DRAWTEXT(int16 argc, int16 *argv);
+ int16 o1_HOMETEXT(int16 argc, int16 *argv);
+ int16 o1_TEXTRECT(int16 argc, int16 *argv);
+ int16 o1_TEXTXY(int16 argc, int16 *argv);
+ int16 o1_DROPSHADOW(int16 argc, int16 *argv);
+ int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
+ int16 o1_OUTLINE(int16 argc, int16 *argv);
+ int16 o1_LOADCURSOR(int16 argc, int16 *argv);
+ int16 o1_SETGROUND(int16 argc, int16 *argv);
+ int16 o1_RESTEXT(int16 argc, int16 *argv);
+ int16 o1_ADDMASK(int16 argc, int16 *argv);
+ int16 o1_SETMASK(int16 argc, int16 *argv);
+ int16 o1_ISSND(int16 argc, int16 *argv);
+ int16 o1_STOPSND(int16 argc, int16 *argv);
+ int16 o1_PLAYVOICE(int16 argc, int16 *argv);
+ int16 o1_CDPLAY(int16 argc, int16 *argv);
+ int16 o1_STOPCD(int16 argc, int16 *argv);
+ int16 o1_CDSTATUS(int16 argc, int16 *argv);
+ int16 o1_CDTIME(int16 argc, int16 *argv);
+ int16 o1_CDPLAYSEG(int16 argc, int16 *argv);
};
} // End of namespace Made
diff --git a/engines/made/scriptfuncs_lgop2.cpp b/engines/made/scriptfuncs_lgop2.cpp
new file mode 100644
index 0000000000..579492a39e
--- /dev/null
+++ b/engines/made/scriptfuncs_lgop2.cpp
@@ -0,0 +1,467 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/util.h"
+#include "common/events.h"
+
+#include "graphics/cursorman.h"
+
+#include "made/made.h"
+#include "made/resource.h"
+#include "made/database.h"
+#include "made/screen.h"
+#include "made/script.h"
+#include "made/pmvplayer.h"
+#include "made/scriptfuncs.h"
+#include "made/music.h"
+
+namespace Made {
+
+/* ScriptFunctionsLgop2 */
+
+typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsLgop2> ExternalFuncLgop2;
+#define External(x) ExternalFuncLgop2(this, &ScriptFunctionsLgop2::x)
+void ScriptFunctionsLgop2::setupExternalsTable() {
+ static const ExternalFuncLgop2 externalsTable[] = {
+ External(o1_SYSTEM),
+ External(o1_INITGRAF),
+ External(o1_RESTOREGRAF),
+ External(o1_DRAWPIC),
+ External(o1_CLS),
+ External(o1_SHOWPAGE),
+ External(o1_EVENT),
+ External(o1_EVENTX),
+ External(o1_EVENTY),
+ External(o1_EVENTKEY),
+ External(o1_VISUALFX),
+ External(o1_PLAYSND),
+ External(o1_PLAYMUS),
+ External(o1_STOPMUS),
+ External(o1_ISMUS),
+ External(o1_TEXTPOS),
+ External(o1_FLASH),
+ External(o1_PLAYNOTE),
+ External(o1_STOPNOTE),
+ External(o1_PLAYTELE),
+ External(o1_STOPTELE),
+ External(o1_HIDECURS),
+ External(o1_SHOWCURS),
+ External(o1_MUSICBEAT),
+ External(o1_SCREENLOCK),
+ External(o1_ADDSPRITE),
+ External(o1_FREEANIM),
+ External(o1_DRAWSPRITE),
+ External(o1_ERASESPRITES),
+ External(o1_UPDATESPRITES),
+ External(o1_GETTIMER),
+ External(o1_SETTIMER),
+ External(o1_RESETTIMER),
+ External(o1_ALLOCTIMER),
+ External(o1_FREETIMER),
+ External(o1_PALETTELOCK),
+ External(o1_FONT),
+ External(o1_DRAWTEXT),
+ External(o1_HOMETEXT),
+ External(o1_TEXTRECT),
+ External(o1_TEXTXY),
+ External(o1_DROPSHADOW),
+ External(o1_TEXTCOLOR),
+ External(o1_OUTLINE),
+ External(o1_LOADCURSOR),
+ External(o1_SETGROUND),
+ External(o1_RESTEXT),
+ External(o1_ADDMASK),
+ External(o1_SETMASK),
+ External(o1_ISSND),
+ External(o1_STOPSND),
+ External(o1_PLAYVOICE)
+ };
+
+ for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
+ _externalFuncs.push_back(&externalsTable[i]);
+
+}
+#undef External
+
+int16 ScriptFunctionsLgop2::o1_SYSTEM(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_INITGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_RESTOREGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_DRAWPIC(int16 argc, int16 *argv) {
+ return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsLgop2::o1_CLS(int16 argc, int16 *argv) {
+ _vm->_screen->clearScreen();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_SHOWPAGE(int16 argc, int16 *argv) {
+ _vm->_screen->show();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_EVENT(int16 argc, int16 *argv) {
+
+ Common::Event event;
+ Common::EventManager *eventMan = g_system->getEventManager();
+
+ int16 eventNum = 0;
+
+ if (eventMan->pollEvent(event)) {
+ switch (event.type) {
+
+ case Common::EVENT_MOUSEMOVE:
+ _vm->_eventMouseX = event.mouse.x;
+ _vm->_eventMouseY = event.mouse.y;
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ eventNum = 1;
+ break;
+
+ /*
+ case Common::EVENT_LBUTTONUP:
+ eventNum = 2; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_RBUTTONDOWN:
+ eventNum = 3;
+ break;
+
+ /*
+ case Common::EVENT_RBUTTONUP:
+ eventNum = 4; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_KEYDOWN:
+ _vm->_eventKey = event.kbd.ascii;
+ eventNum = 5;
+ break;
+
+ case Common::EVENT_QUIT:
+ // TODO: Exit more gracefully.
+ g_system->quit();
+ break;
+
+ default:
+ break;
+
+ }
+ }
+
+ _vm->_system->updateScreen();
+
+ return eventNum;
+}
+
+int16 ScriptFunctionsLgop2::o1_EVENTX(int16 argc, int16 *argv) {
+ return _vm->_eventMouseX;
+}
+
+int16 ScriptFunctionsLgop2::o1_EVENTY(int16 argc, int16 *argv) {
+ return _vm->_eventMouseY;
+}
+
+int16 ScriptFunctionsLgop2::o1_EVENTKEY(int16 argc, int16 *argv) {
+ return _vm->_eventKey;
+}
+
+int16 ScriptFunctionsLgop2::o1_VISUALFX(int16 argc, int16 *argv) {
+ _vm->_screen->setVisualEffectNum(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PLAYSND(int16 argc, int16 *argv) {
+ int soundNum = argv[0];
+ bool loop = false;
+
+ if (argc > 1) {
+ soundNum = argv[1];
+ loop = (argv[0] == 1);
+ }
+
+ if (soundNum > 0) {
+ if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
+ }
+ }
+
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PLAYMUS(int16 argc, int16 *argv) {
+ /*
+
+ Disabled for now since MIDI player doesn't support all commands
+ which results in strange behavior.
+
+ int16 musicNum = argv[0];
+ if (musicNum > 0) {
+ GenericResource *midi = _vm->_res->getMidi(musicNum);
+ _vm->_music->playSMF(midi);
+ _vm->_res->freeResource(midi);
+ }
+ */
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_STOPMUS(int16 argc, int16 *argv) {
+ _vm->_music->stop();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_ISMUS(int16 argc, int16 *argv) {
+ if (_vm->_music->isPlaying())
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_TEXTPOS(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_TEXTPOS");
+ // This seems to be some kind of low-level opcode.
+ // The original engine calls int 10h to set the VGA cursor position.
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_FLASH(int16 argc, int16 *argv) {
+ _vm->_screen->flash(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PLAYNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_STOPNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PLAYTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_STOPTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_HIDECURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(false);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_SHOWCURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(true);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_MUSICBEAT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_MUSICBEAT");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_SCREENLOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setScreenLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_ADDSPRITE(int16 argc, int16 *argv) {
+ //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+ return argv[2];
+}
+
+int16 ScriptFunctionsLgop2::o1_FREEANIM(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_DRAWSPRITE(int16 argc, int16 *argv) {
+ return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsLgop2::o1_ERASESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_UPDATESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->updateSprites();
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_GETTIMER(int16 argc, int16 *argv) {
+ return _vm->getTimer(argv[0]);
+}
+
+int16 ScriptFunctionsLgop2::o1_SETTIMER(int16 argc, int16 *argv) {
+ _vm->setTimer(argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_RESETTIMER(int16 argc, int16 *argv) {
+ _vm->resetTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_ALLOCTIMER(int16 argc, int16 *argv) {
+ int16 timerNum = _vm->allocTimer();
+ return timerNum;
+}
+
+int16 ScriptFunctionsLgop2::o1_FREETIMER(int16 argc, int16 *argv) {
+ _vm->freeTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PALETTELOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setPaletteLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_FONT(int16 argc, int16 *argv) {
+ _vm->_screen->setFont(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_DRAWTEXT(int16 argc, int16 *argv) {
+ // TODO: Needs vsprintf to get the correct text
+ const char *text = _vm->_dat->getString(argv[argc - 1]);
+ _vm->_screen->printText(text);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_HOMETEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_HOMETEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_TEXTRECT(int16 argc, int16 *argv) {
+ int16 x1 = CLIP<int16>(argv[4], 1, 318);
+ int16 y1 = CLIP<int16>(argv[3], 1, 198);
+ int16 x2 = CLIP<int16>(argv[2], 1, 318);
+ int16 y2 = CLIP<int16>(argv[1], 1, 198);
+ //int16 textValue = argv[0];
+ // TODO: textValue
+ _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_TEXTXY(int16 argc, int16 *argv) {
+ int16 x = CLIP<int16>(argv[1], 1, 318);
+ int16 y = CLIP<int16>(argv[0], 1, 198);
+ _vm->_screen->setTextXY(x, y);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_DROPSHADOW(int16 argc, int16 *argv) {
+ // if the drop shadow color is -1, then text drop shadow is disabled
+ // when font drop shadow is enabled, outline is disabled
+ _vm->_screen->setDropShadowColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_TEXTCOLOR(int16 argc, int16 *argv) {
+ _vm->_screen->setTextColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_OUTLINE(int16 argc, int16 *argv) {
+ // if the outline color is -1, then text outline is disabled
+ // when font outline is enabled, drop shadow is disabled
+ _vm->_screen->setOutlineColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_LOADCURSOR(int16 argc, int16 *argv) {
+ PictureResource *flex = _vm->_res->getPicture(argv[2]);
+ Graphics::Surface *surf = flex->getPicture();
+ CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
+ CursorMan.showMouse(true);
+ _vm->_res->freeResource(flex);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_SETGROUND(int16 argc, int16 *argv) {
+ _vm->_screen->setGround(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_RESTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_RESTEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_ADDMASK(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_ADDMASK");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_SETMASK(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SETMASK");
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_ISSND(int16 argc, int16 *argv) {
+ if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_STOPSND(int16 argc, int16 *argv) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ return 0;
+}
+
+int16 ScriptFunctionsLgop2::o1_PLAYVOICE(int16 argc, int16 *argv) {
+ if (argv[0] > 0) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
+ }
+ return 0;
+}
+
+} // End of namespace Made
diff --git a/engines/made/scriptfuncs_mhne.cpp b/engines/made/scriptfuncs_mhne.cpp
new file mode 100644
index 0000000000..65e9c6e070
--- /dev/null
+++ b/engines/made/scriptfuncs_mhne.cpp
@@ -0,0 +1,494 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/util.h"
+#include "common/events.h"
+
+#include "graphics/cursorman.h"
+
+#include "made/made.h"
+#include "made/resource.h"
+#include "made/database.h"
+#include "made/screen.h"
+#include "made/script.h"
+#include "made/pmvplayer.h"
+#include "made/scriptfuncs.h"
+#include "made/music.h"
+
+namespace Made {
+
+/* ScriptFunctionsMhne */
+
+typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsMhne> ExternalFuncMhne;
+#define External(x) ExternalFuncMhne(this, &ScriptFunctionsMhne::x)
+void ScriptFunctionsMhne::setupExternalsTable() {
+ static const ExternalFuncMhne externalsTable[] = {
+ External(o1_SYSTEM),
+ External(o1_INITGRAF),
+ External(o1_RESTOREGRAF),
+ External(o1_DRAWPIC),
+ External(o1_CLS),
+ External(o1_SHOWPAGE),
+ External(o1_EVENT),
+ External(o1_EVENTX),
+ External(o1_EVENTY),
+ External(o1_EVENTKEY),
+ External(o1_VISUALFX),
+ External(o1_PLAYSND),
+ External(o1_PLAYMUS),
+ External(o1_STOPMUS),
+ External(o1_ISMUS),
+ External(o1_TEXTPOS),
+ External(o1_FLASH),
+ External(o1_PLAYNOTE),
+ External(o1_STOPNOTE),
+ External(o1_PLAYTELE),
+ External(o1_STOPTELE),
+ External(o1_HIDECURS),
+ External(o1_SHOWCURS),
+ External(o1_MUSICBEAT),
+ External(o1_SCREENLOCK),
+ External(o1_ADDSPRITE),
+ External(o1_FREEANIM),
+ External(o1_DRAWSPRITE),
+ External(o1_ERASESPRITES),
+ External(o1_UPDATESPRITES),
+ External(o1_GETTIMER),
+ External(o1_SETTIMER),
+ External(o1_RESETTIMER),
+ External(o1_ALLOCTIMER),
+ External(o1_FREETIMER),
+ External(o1_PALETTELOCK),
+ External(o1_FONT),
+ External(o1_DRAWTEXT),
+ External(o1_HOMETEXT),
+ External(o1_TEXTRECT),
+ External(o1_TEXTXY),
+ External(o1_DROPSHADOW),
+ External(o1_TEXTCOLOR),
+ External(o1_OUTLINE),
+ External(o1_LOADCURSOR),
+ External(o1_SETGROUND),
+ External(o1_RESTEXT),
+ External(o1_ADDMASK),
+ External(o1_SETMASK),
+ External(o1_ISSND),
+ External(o1_STOPSND),
+ External(o1_PLAYVOICE),
+ External(o1_CDPLAY),
+ External(o1_STOPCD),
+ External(o1_CDSTATUS),
+ External(o1_CDTIME),
+ External(o1_CDPLAYSEG),
+ };
+
+ for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
+ _externalFuncs.push_back(&externalsTable[i]);
+
+}
+#undef External
+
+int16 ScriptFunctionsMhne::o1_SYSTEM(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_INITGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_RESTOREGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_DRAWPIC(int16 argc, int16 *argv) {
+ return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsMhne::o1_CLS(int16 argc, int16 *argv) {
+ _vm->_screen->clearScreen();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_SHOWPAGE(int16 argc, int16 *argv) {
+ _vm->_screen->show();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_EVENT(int16 argc, int16 *argv) {
+
+ Common::Event event;
+ Common::EventManager *eventMan = g_system->getEventManager();
+
+ int16 eventNum = 0;
+
+ if (eventMan->pollEvent(event)) {
+ switch (event.type) {
+
+ case Common::EVENT_MOUSEMOVE:
+ _vm->_eventMouseX = event.mouse.x;
+ _vm->_eventMouseY = event.mouse.y;
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ eventNum = 1;
+ break;
+
+ /*
+ case Common::EVENT_LBUTTONUP:
+ eventNum = 2; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_RBUTTONDOWN:
+ eventNum = 3;
+ break;
+
+ /*
+ case Common::EVENT_RBUTTONUP:
+ eventNum = 4; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_KEYDOWN:
+ _vm->_eventKey = event.kbd.ascii;
+ eventNum = 5;
+ break;
+
+ case Common::EVENT_QUIT:
+ // TODO: Exit more gracefully.
+ g_system->quit();
+ break;
+
+ default:
+ break;
+
+ }
+ }
+
+ _vm->_system->updateScreen();
+
+ return eventNum;
+}
+
+int16 ScriptFunctionsMhne::o1_EVENTX(int16 argc, int16 *argv) {
+ return _vm->_eventMouseX;
+}
+
+int16 ScriptFunctionsMhne::o1_EVENTY(int16 argc, int16 *argv) {
+ return _vm->_eventMouseY;
+}
+
+int16 ScriptFunctionsMhne::o1_EVENTKEY(int16 argc, int16 *argv) {
+ return _vm->_eventKey;
+}
+
+int16 ScriptFunctionsMhne::o1_VISUALFX(int16 argc, int16 *argv) {
+ _vm->_screen->setVisualEffectNum(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PLAYSND(int16 argc, int16 *argv) {
+ int soundNum = argv[0];
+ bool loop = false;
+
+ if (argc > 1) {
+ soundNum = argv[1];
+ loop = (argv[0] == 1);
+ }
+
+ if (soundNum > 0) {
+ if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
+ }
+ }
+
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PLAYMUS(int16 argc, int16 *argv) {
+ int16 musicNum = argv[0];
+ if (musicNum > 0) {
+ GenericResource *xmidi = _vm->_res->getXmidi(musicNum);
+ _vm->_music->playXMIDI(xmidi);
+ _vm->_res->freeResource(xmidi);
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_STOPMUS(int16 argc, int16 *argv) {
+ _vm->_music->stop();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_ISMUS(int16 argc, int16 *argv) {
+ if (_vm->_music->isPlaying())
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_TEXTPOS(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_TEXTPOS");
+ // This seems to be some kind of low-level opcode.
+ // The original engine calls int 10h to set the VGA cursor position.
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_FLASH(int16 argc, int16 *argv) {
+ _vm->_screen->flash(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PLAYNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_STOPNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PLAYTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_STOPTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_HIDECURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(false);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_SHOWCURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(true);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_MUSICBEAT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_MUSICBEAT");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_SCREENLOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setScreenLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_ADDSPRITE(int16 argc, int16 *argv) {
+ //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+ return argv[2];
+}
+
+int16 ScriptFunctionsMhne::o1_FREEANIM(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_DRAWSPRITE(int16 argc, int16 *argv) {
+ return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsMhne::o1_ERASESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_UPDATESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->updateSprites();
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_GETTIMER(int16 argc, int16 *argv) {
+ return _vm->getTimer(argv[0]);
+}
+
+int16 ScriptFunctionsMhne::o1_SETTIMER(int16 argc, int16 *argv) {
+ _vm->setTimer(argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_RESETTIMER(int16 argc, int16 *argv) {
+ _vm->resetTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_ALLOCTIMER(int16 argc, int16 *argv) {
+ int16 timerNum = _vm->allocTimer();
+ return timerNum;
+}
+
+int16 ScriptFunctionsMhne::o1_FREETIMER(int16 argc, int16 *argv) {
+ _vm->freeTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PALETTELOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setPaletteLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_FONT(int16 argc, int16 *argv) {
+ _vm->_screen->setFont(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_DRAWTEXT(int16 argc, int16 *argv) {
+ Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+ const char *text = obj->getString();
+ _vm->_screen->printText(text);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_HOMETEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_HOMETEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_TEXTRECT(int16 argc, int16 *argv) {
+ int16 x1 = CLIP<int16>(argv[4], 1, 318);
+ int16 y1 = CLIP<int16>(argv[3], 1, 198);
+ int16 x2 = CLIP<int16>(argv[2], 1, 318);
+ int16 y2 = CLIP<int16>(argv[1], 1, 198);
+ //int16 textValue = argv[0];
+ // TODO: textValue
+ _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_TEXTXY(int16 argc, int16 *argv) {
+ int16 x = CLIP<int16>(argv[1], 1, 318);
+ int16 y = CLIP<int16>(argv[0], 1, 198);
+ _vm->_screen->setTextXY(x, y);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_DROPSHADOW(int16 argc, int16 *argv) {
+ // if the drop shadow color is -1, then text drop shadow is disabled
+ // when font drop shadow is enabled, outline is disabled
+ _vm->_screen->setDropShadowColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_TEXTCOLOR(int16 argc, int16 *argv) {
+ _vm->_screen->setTextColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_OUTLINE(int16 argc, int16 *argv) {
+ // if the outline color is -1, then text outline is disabled
+ // when font outline is enabled, drop shadow is disabled
+ _vm->_screen->setOutlineColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_LOADCURSOR(int16 argc, int16 *argv) {
+ PictureResource *flex = _vm->_res->getPicture(argv[2]);
+ Graphics::Surface *surf = flex->getPicture();
+ CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
+ CursorMan.showMouse(true);
+ _vm->_res->freeResource(flex);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_SETGROUND(int16 argc, int16 *argv) {
+ _vm->_screen->setGround(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_RESTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_RESTEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_ADDMASK(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_ADDMASK");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_SETMASK(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SETMASK");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_ISSND(int16 argc, int16 *argv) {
+ if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_STOPSND(int16 argc, int16 *argv) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_PLAYVOICE(int16 argc, int16 *argv) {
+ if (argv[0] > 0) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_CDPLAY(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDPLAY");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_STOPCD(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPCD");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_CDSTATUS(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDSTATUS");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_CDTIME(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDTIME");
+ return 0;
+}
+
+int16 ScriptFunctionsMhne::o1_CDPLAYSEG(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_CDPLAYSEG");
+ return 0;
+}
+
+} // End of namespace Made
diff --git a/engines/made/scriptfuncs_rtz.cpp b/engines/made/scriptfuncs_rtz.cpp
new file mode 100644
index 0000000000..1186a88de8
--- /dev/null
+++ b/engines/made/scriptfuncs_rtz.cpp
@@ -0,0 +1,864 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/util.h"
+#include "common/events.h"
+
+#include "graphics/cursorman.h"
+
+#include "made/made.h"
+#include "made/resource.h"
+#include "made/database.h"
+#include "made/screen.h"
+#include "made/script.h"
+#include "made/pmvplayer.h"
+#include "made/scriptfuncs.h"
+#include "made/music.h"
+
+namespace Made {
+
+/* ScriptFunctionsRtz */
+
+typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz;
+#define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x)
+void ScriptFunctionsRtz::setupExternalsTable() {
+ static const ExternalFuncRtz externalsTable[] = {
+ External(o1_SYSTEM),
+ External(o1_INITGRAF),
+ External(o1_RESTOREGRAF),
+ External(o1_DRAWPIC),
+ External(o1_CLS),
+ External(o1_SHOWPAGE),
+ External(o1_EVENT),
+ External(o1_EVENTX),
+ External(o1_EVENTY),
+ External(o1_EVENTKEY),
+ External(o1_VISUALFX),
+ External(o1_PLAYSND),
+ External(o1_PLAYMUS),
+ External(o1_STOPMUS),
+ External(o1_ISMUS),
+ External(o1_TEXTPOS),
+ External(o1_FLASH),
+ External(o1_PLAYNOTE),
+ External(o1_STOPNOTE),
+ External(o1_PLAYTELE),
+ External(o1_STOPTELE),
+ External(o1_HIDECURS),
+ External(o1_SHOWCURS),
+ External(o1_MUSICBEAT),
+ External(o1_SCREENLOCK),
+ External(o1_ADDSPRITE),
+ External(o1_FREEANIM),
+ External(o1_DRAWSPRITE),
+ External(o1_ERASESPRITES),
+ External(o1_UPDATESPRITES),
+ External(o1_GETTIMER),
+ External(o1_SETTIMER),
+ External(o1_RESETTIMER),
+ External(o1_ALLOCTIMER),
+ External(o1_FREETIMER),
+ External(o1_PALETTELOCK),
+ External(o1_FONT),
+ External(o1_DRAWTEXT),
+ External(o1_HOMETEXT),
+ External(o1_TEXTRECT),
+ External(o1_TEXTXY),
+ External(o1_DROPSHADOW),
+ External(o1_TEXTCOLOR),
+ External(o1_OUTLINE),
+ External(o1_LOADCURSOR),
+ External(o1_SETGROUND),
+ External(o1_RESTEXT),
+ External(o1_CLIPAREA),
+ External(o1_SETCLIP),
+ External(o1_ISSND),
+ External(o1_STOPSND),
+ External(o1_PLAYVOICE),
+ External(o1_CDPLAY),
+ External(o1_STOPCD),
+ External(o1_CDSTATUS),
+ External(o1_CDTIME),
+ External(o1_CDPLAYSEG),
+ External(o1_PRINTF),
+ External(o1_MONOCLS),
+ External(o1_SNDENERGY),
+ External(o1_CLEARTEXT),
+ External(o1_ANIMTEXT),
+ External(o1_TEXTWIDTH),
+ External(o1_PLAYMOVIE),
+ External(o1_LOADSND),
+ External(o1_LOADMUS),
+ External(o1_LOADPIC),
+ External(o1_MUSICVOL),
+ External(o1_RESTARTEVENTS),
+ External(o1_PLACESPRITE),
+ External(o1_PLACETEXT),
+ External(o1_DELETECHANNEL),
+ External(o1_CHANNELTYPE),
+ External(o1_SETSTATE),
+ External(o1_SETLOCATION),
+ External(o1_SETCONTENT),
+ External(o1_EXCLUDEAREA),
+ External(o1_SETEXCLUDE),
+ External(o1_GETSTATE),
+ External(o1_PLACEANIM),
+ External(o1_SETFRAME),
+ External(o1_GETFRAME),
+ External(o1_GETFRAMECOUNT),
+ External(o1_PICWIDTH),
+ External(o1_PICHEIGHT),
+ External(o1_SOUNDRATE),
+ External(o1_DRAWANIMPIC),
+ External(o1_LOADANIM),
+ External(o1_READTEXT),
+ External(o1_READMENU),
+ External(o1_DRAWMENU),
+ External(o1_MENUCOUNT),
+ External(o1_SAVEGAME),
+ External(o1_LOADGAME),
+ External(o1_GAMENAME),
+ External(o1_SHAKESCREEN),
+ External(o1_PLACEMENU),
+ External(o1_SETVOLUME),
+ External(o1_WHATSYNTH),
+ External(o1_SLOWSYSTEM)
+ };
+
+ for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
+ _externalFuncs.push_back(&externalsTable[i]);
+
+}
+#undef External
+
+int16 ScriptFunctionsRtz::o1_SYSTEM(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_INITGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_RESTOREGRAF(int16 argc, int16 *argv) {
+ // This opcode is empty.
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_DRAWPIC(int16 argc, int16 *argv) {
+ return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_CLS(int16 argc, int16 *argv) {
+ _vm->_screen->clearScreen();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SHOWPAGE(int16 argc, int16 *argv) {
+ _vm->_screen->show();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) {
+
+ Common::Event event;
+ Common::EventManager *eventMan = g_system->getEventManager();
+
+ int16 eventNum = 0;
+
+ if (eventMan->pollEvent(event)) {
+ switch (event.type) {
+
+ case Common::EVENT_MOUSEMOVE:
+ _vm->_eventMouseX = event.mouse.x;
+ _vm->_eventMouseY = event.mouse.y;
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ eventNum = 1;
+ break;
+
+ /*
+ case Common::EVENT_LBUTTONUP:
+ eventNum = 2; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_RBUTTONDOWN:
+ eventNum = 3;
+ break;
+
+ /*
+ case Common::EVENT_RBUTTONUP:
+ eventNum = 4; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_KEYDOWN:
+ _vm->_eventKey = event.kbd.ascii;
+ eventNum = 5;
+ break;
+
+ case Common::EVENT_QUIT:
+ // TODO: Exit more gracefully.
+ g_system->quit();
+ break;
+
+ default:
+ break;
+
+ }
+ }
+
+ _vm->_system->updateScreen();
+
+ return eventNum;
+}
+
+int16 ScriptFunctionsRtz::o1_EVENTX(int16 argc, int16 *argv) {
+ return _vm->_eventMouseX;
+}
+
+int16 ScriptFunctionsRtz::o1_EVENTY(int16 argc, int16 *argv) {
+ return _vm->_eventMouseY;
+}
+
+int16 ScriptFunctionsRtz::o1_EVENTKEY(int16 argc, int16 *argv) {
+ return _vm->_eventKey;
+}
+
+int16 ScriptFunctionsRtz::o1_VISUALFX(int16 argc, int16 *argv) {
+ _vm->_screen->setVisualEffectNum(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
+ int soundNum = argv[0];
+ bool loop = false;
+
+ if (argc > 1) {
+ soundNum = argv[1];
+ loop = (argv[0] == 1);
+ }
+
+ if (soundNum > 0) {
+ if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
+ }
+ }
+
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYMUS(int16 argc, int16 *argv) {
+ int16 musicNum = argv[0];
+ if (musicNum > 0) {
+ GenericResource *xmidi = _vm->_res->getXmidi(musicNum);
+ _vm->_music->playXMIDI(xmidi);
+ _vm->_res->freeResource(xmidi);
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_STOPMUS(int16 argc, int16 *argv) {
+ _vm->_music->stop();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_ISMUS(int16 argc, int16 *argv) {
+ if (_vm->_music->isPlaying())
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_TEXTPOS(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_TEXTPOS");
+ // This seems to be some kind of low-level opcode.
+ // The original engine calls int 10h to set the VGA cursor position.
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_FLASH(int16 argc, int16 *argv) {
+ _vm->_screen->flash(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_STOPNOTE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPNOTE");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLAYTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_STOPTELE(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPTELE");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_HIDECURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(false);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SHOWCURS(int16 argc, int16 *argv) {
+ _vm->_system->showMouse(true);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_MUSICBEAT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_MUSICBEAT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SCREENLOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setScreenLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_ADDSPRITE(int16 argc, int16 *argv) {
+ //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+ return 0;//argv[2];
+}
+
+int16 ScriptFunctionsRtz::o1_FREEANIM(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_DRAWSPRITE(int16 argc, int16 *argv) {
+ return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_ERASESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->clearChannels();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_UPDATESPRITES(int16 argc, int16 *argv) {
+ _vm->_screen->updateSprites();
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_GETTIMER(int16 argc, int16 *argv) {
+ return _vm->getTimer(argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_SETTIMER(int16 argc, int16 *argv) {
+ _vm->setTimer(argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_RESETTIMER(int16 argc, int16 *argv) {
+ _vm->resetTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_ALLOCTIMER(int16 argc, int16 *argv) {
+ int16 timerNum = _vm->allocTimer();
+ return timerNum;
+}
+
+int16 ScriptFunctionsRtz::o1_FREETIMER(int16 argc, int16 *argv) {
+ _vm->freeTimer(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PALETTELOCK(int16 argc, int16 *argv) {
+ _vm->_screen->setPaletteLock(argv[0] != 0);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_FONT(int16 argc, int16 *argv) {
+ _vm->_screen->setFont(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_DRAWTEXT(int16 argc, int16 *argv) {
+ // TODO: Needs vsprintf to get the correct text
+ Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+ const char *text = obj->getString();
+ _vm->_screen->printText(text);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_HOMETEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_HOMETEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_TEXTRECT(int16 argc, int16 *argv) {
+ int16 x1 = CLIP<int16>(argv[4], 1, 318);
+ int16 y1 = CLIP<int16>(argv[3], 1, 198);
+ int16 x2 = CLIP<int16>(argv[2], 1, 318);
+ int16 y2 = CLIP<int16>(argv[1], 1, 198);
+ //int16 textValue = argv[0];
+ // TODO: textValue
+ _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_TEXTXY(int16 argc, int16 *argv) {
+ int16 x = CLIP<int16>(argv[1], 1, 318);
+ int16 y = CLIP<int16>(argv[0], 1, 198);
+ _vm->_screen->setTextXY(x, y);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_DROPSHADOW(int16 argc, int16 *argv) {
+ // if the drop shadow color is -1, then text drop shadow is disabled
+ // when font drop shadow is enabled, outline is disabled
+ _vm->_screen->setDropShadowColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_TEXTCOLOR(int16 argc, int16 *argv) {
+ _vm->_screen->setTextColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_OUTLINE(int16 argc, int16 *argv) {
+ // if the outline color is -1, then text outline is disabled
+ // when font outline is enabled, drop shadow is disabled
+ _vm->_screen->setOutlineColor(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_LOADCURSOR(int16 argc, int16 *argv) {
+ PictureResource *flex = _vm->_res->getPicture(argv[2]);
+ Graphics::Surface *surf = flex->getPicture();
+ CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
+ CursorMan.showMouse(true);
+ _vm->_res->freeResource(flex);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETGROUND(int16 argc, int16 *argv) {
+ _vm->_screen->setGround(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_RESTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_RESTEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CLIPAREA(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_CLIPAREA");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETCLIP(int16 argc, int16 *argv) {
+ _vm->_screen->setClip(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_ISSND(int16 argc, int16 *argv) {
+ if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
+ return 1;
+ else
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_STOPSND(int16 argc, int16 *argv) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYVOICE(int16 argc, int16 *argv) {
+ if (argv[0] > 0) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CDPLAY(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDPLAY");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_STOPCD(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_STOPCD");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CDSTATUS(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDSTATUS");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CDTIME(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: o1_CDTIME");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CDPLAYSEG(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_CDPLAYSEG");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PRINTF(int16 argc, int16 *argv) {
+ Object *obj = _vm->_dat->getObject(argv[argc - 1]);
+ const char *text = obj->getString();
+ debug(4, "--> text = %s", text);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_MONOCLS(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_MONOCLS");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SNDENERGY(int16 argc, int16 *argv) {
+ // This is called while in-game voices are played
+ // Not sure what it's used for
+ // -> It's used to animate mouths when NPCs are talking
+ // Commented out to reduce spam
+ //warning("Unimplemented opcode: o1_SNDENERGY");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CLEARTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_CLEARTEXT");
+ return 1;
+}
+
+int16 ScriptFunctionsRtz::o1_ANIMTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_ANIMTEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_TEXTWIDTH(int16 argc, int16 *argv) {
+ int16 width = 0;
+ if (argv[1] > 0) {
+ Object *obj = _vm->_dat->getObject(argv[1]);
+ const char *text = obj->getString();
+ width = _vm->_screen->getTextWidth(argv[0], text);
+ }
+ return width;
+}
+
+int16 ScriptFunctionsRtz::o1_PLAYMOVIE(int16 argc, int16 *argv) {
+ const char *movieName = _vm->_dat->getObject(argv[1])->getString();
+ _vm->_pmvPlayer->play(movieName);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_LOADSND(int16 argc, int16 *argv) {
+ SoundResource *sound = _vm->_res->getSound(argv[0]);
+ if (sound) {
+ _vm->_res->freeResource(sound);
+ return 1;
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_LOADMUS(int16 argc, int16 *argv) {
+ GenericResource *xmidi = _vm->_res->getXmidi(argv[0]);
+ if (xmidi) {
+ _vm->_res->freeResource(xmidi);
+ return 1;
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_LOADPIC(int16 argc, int16 *argv) {
+ PictureResource *flex = _vm->_res->getPicture(argv[0]);
+ if (flex) {
+ _vm->_res->freeResource(flex);
+ return 1;
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_MUSICVOL(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_MUSICVOL");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_RESTARTEVENTS(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_RESTARTEVENTS");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLACESPRITE(int16 argc, int16 *argv) {
+ return _vm->_screen->placeSprite(argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_PLACETEXT(int16 argc, int16 *argv) {
+ return _vm->_screen->placeText(argv[6], argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_DELETECHANNEL(int16 argc, int16 *argv) {
+ _vm->_screen->deleteChannel(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_CHANNELTYPE(int16 argc, int16 *argv) {
+ return _vm->_screen->getChannelType(argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_SETSTATE(int16 argc, int16 *argv) {
+ _vm->_screen->setChannelState(argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETLOCATION(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SETLOCATION");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETCONTENT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SETCONTENT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_EXCLUDEAREA(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_EXCLUDEAREA");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETEXCLUDE(int16 argc, int16 *argv) {
+ _vm->_screen->setExclude(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_GETSTATE(int16 argc, int16 *argv) {
+ return _vm->_screen->getChannelState(argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_PLACEANIM(int16 argc, int16 *argv) {
+ return _vm->_screen->placeAnim(argv[4], argv[3], argv[2], argv[1], argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_SETFRAME(int16 argc, int16 *argv) {
+ _vm->_screen->setAnimFrame(argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_GETFRAME(int16 argc, int16 *argv) {
+ return _vm->_screen->getAnimFrame(argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_GETFRAMECOUNT(int16 argc, int16 *argv) {
+ return _vm->_screen->getAnimFrameCount(argv[0]);
+}
+
+int16 ScriptFunctionsRtz::o1_PICWIDTH(int16 argc, int16 *argv) {
+ int16 width = 0;
+ PictureResource *flex = _vm->_res->getPicture(argv[0]);
+ if (flex) {
+ width = flex->getPicture()->w;
+ _vm->_res->freeResource(flex);
+ }
+ return width;
+}
+
+int16 ScriptFunctionsRtz::o1_PICHEIGHT(int16 argc, int16 *argv) {
+ int16 height = 0;
+ PictureResource *flex = _vm->_res->getPicture(argv[0]);
+ if (flex) {
+ height = flex->getPicture()->h;
+ _vm->_res->freeResource(flex);
+ }
+ return height;
+}
+
+int16 ScriptFunctionsRtz::o1_SOUNDRATE(int16 argc, int16 *argv) {
+ _vm->_soundRate = argv[0];
+ return 1;
+}
+
+int16 ScriptFunctionsRtz::o1_DRAWANIMPIC(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_DRAWANIMPIC");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_LOADANIM(int16 argc, int16 *argv) {
+ AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
+ if (anim) {
+ _vm->_res->freeResource(anim);
+ return 1;
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_READTEXT(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_READTEXT");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_READMENU(int16 argc, int16 *argv) {
+ int16 objectIndex = argv[2];
+ int16 menuIndex = argv[1];
+ int16 textIndex = argv[0];
+ int16 length = 0;
+ MenuResource *menu = _vm->_res->getMenu(menuIndex);
+ if (menu) {
+ const char *text = menu->getString(textIndex);
+ debug(4, "objectIndex = %04X; text = %s\n", objectIndex, text);
+ Object *obj = _vm->_dat->getObject(objectIndex);
+ obj->setString(text);
+ _vm->_res->freeResource(menu);
+ if (text)
+ length = strlen(text);
+ }
+ return length;
+}
+
+int16 ScriptFunctionsRtz::o1_DRAWMENU(int16 argc, int16 *argv) {
+ int16 menuIndex = argv[1];
+ int16 textIndex = argv[0];
+ MenuResource *menu = _vm->_res->getMenu(menuIndex);
+ if (menu) {
+ const char *text = menu->getString(textIndex);
+ if (text)
+ _vm->_screen->printText(text);
+ _vm->_res->freeResource(menu);
+ }
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_MENUCOUNT(int16 argc, int16 *argv) {
+ int16 menuIndex = argv[0];
+ int16 count = 0;
+ MenuResource *menu = _vm->_res->getMenu(menuIndex);
+ if (menu) {
+ count = menu->getCount();
+ _vm->_res->freeResource(menu);
+ }
+ return count;
+}
+
+int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) {
+
+ int16 saveNum = argv[2];
+ int16 descObjectIndex = argv[1];
+ int16 version = argv[0];
+
+ if (saveNum > 999)
+ return 6;
+
+ Object *obj = _vm->_dat->getObject(descObjectIndex);
+ const char *description = obj->getString();
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ return _vm->_dat->savegame(filename, description, version);
+
+}
+
+int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) {
+
+ int16 saveNum = argv[1];
+ int16 version = argv[0];
+
+ if (saveNum > 999)
+ return 1;
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ return _vm->_dat->loadgame(filename, version);
+
+}
+
+int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) {
+
+ int16 descObjectIndex = argv[2];
+ int16 saveNum = argv[1];
+ /*int16 version = argv[0];*/
+ Common::String description;
+
+ if (saveNum > 999)
+ return 1;
+
+ // TODO: Use better filename
+ char filename[256];
+ snprintf(filename, 256, "rtz.%03d", saveNum);
+
+ Object *obj = _vm->_dat->getObject(descObjectIndex);
+
+ if (_vm->_dat->getSavegameDescription(filename, description)) {
+ obj->setString(description.c_str());
+ return 0;
+ } else {
+ obj->setString("");
+ return 1;
+ }
+
+}
+
+int16 ScriptFunctionsRtz::o1_SHAKESCREEN(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SHAKESCREEN");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_PLACEMENU(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_PLACEMENU");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SETVOLUME(int16 argc, int16 *argv) {
+ _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, argv[0] * 25);
+ _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, argv[0] * 25);
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_WHATSYNTH(int16 argc, int16 *argv) {
+ // 0 = Default
+ // 1 = PCSPKR
+ // 2 = SBFM/ADLIB
+ // 3 = ADLIBG
+ // 4 = MT32MPU
+ warning("Unimplemented opcode: o1_WHATSYNTH");
+ return 0;
+}
+
+int16 ScriptFunctionsRtz::o1_SLOWSYSTEM(int16 argc, int16 *argv) {
+ warning("Unimplemented opcode: o1_SLOWSYSTEM");
+ return 0;
+}
+
+} // End of namespace Made
diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp
index 3cb2ea69fd..27cf516b11 100644
--- a/engines/made/sound.cpp
+++ b/engines/made/sound.cpp
@@ -34,7 +34,7 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
int16 prevSample = 0, workSample = 0;
byte soundBuffer[1025];
- byte soundBuffer3[1024];
+ byte deltaSoundBuffer[1024];
int16 soundBuffer2[16];
byte deltaType, type;
uint16 workChunkSize, byteCount, bitCount;
@@ -106,17 +106,24 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
}
- if (deltaType == 1) {
- for (i = 0; i < chunkSize - 1; i += 2) {
- l = i / 2;
- soundBuffer3[i] = soundBuffer[l];
- soundBuffer3[i + 1] = (soundBuffer[l + 1] + soundBuffer[l]) / 2;
- }
- for (i = 0; i < chunkSize; i++) {
- soundBuffer[i] = soundBuffer3[i];
+ if (deltaType > 0) {
+ if (deltaType == 1) {
+ for (i = 0; i < chunkSize - 1; i += 2) {
+ l = i / 2;
+ deltaSoundBuffer[i] = soundBuffer[l];
+ deltaSoundBuffer[i + 1] = (soundBuffer[l] + soundBuffer[l + 1]) / 2;
+ }
+ } else if (deltaType == 2) {
+ for (i = 0; i < chunkSize - 1; i += 4) {
+ l = i / 4;
+ deltaSoundBuffer[i] = soundBuffer[l];
+ deltaSoundBuffer[i + 2] = (soundBuffer[l] + soundBuffer[l + 1]) / 2;
+ deltaSoundBuffer[i + 1] = (deltaSoundBuffer[i + 2] + soundBuffer[l]) / 2;
+ deltaSoundBuffer[i + 3] = (deltaSoundBuffer[i + 2] + soundBuffer[l + 1]) / 2;
+ }
}
- } else if (deltaType == 2) {
- debug(2, "****************************************");
+ for (i = 0; i < chunkSize; i++)
+ soundBuffer[i] = deltaSoundBuffer[i];
}
prevSample = workSample;
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp
index ae7b485d8d..c9a547d75b 100644
--- a/engines/parallaction/callables_ns.cpp
+++ b/engines/parallaction/callables_ns.cpp
@@ -268,7 +268,7 @@ void Parallaction_ns::_c_moveSarc(void *parm) {
a = findAnimation("finito");
a->_flags |= (kFlagsActive | kFlagsActing);
- _localFlags[_currentLocationIndex] |= 0x20; // GROSS HACK: activates 'finito' flag in dinoit_museo.loc
+ setLocationFlags(0x20); // GROSS HACK: activates 'finito' flag in dinoit_museo.loc
}
return;
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index c88cc63575..4f281998e2 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -117,7 +117,7 @@ bool Debugger::Cmd_GlobalFlags(int argc, const char **argv) {
bool Debugger::Cmd_LocalFlags(int argc, const char **argv) {
- uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];
+ uint32 flags = _vm->getLocationFlags();
DebugPrintf("+------------------------------+---------+\n"
"| flag name | value |\n"
@@ -149,8 +149,8 @@ bool Debugger::Cmd_Give(int argc, const char **argv) {
bool Debugger::Cmd_Zones(int argc, const char **argv) {
- ZoneList::iterator b = _vm->_zones.begin();
- ZoneList::iterator e = _vm->_zones.end();
+ ZoneList::iterator b = _vm->_location._zones.begin();
+ ZoneList::iterator e = _vm->_location._zones.end();
DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
"| name | l | t | r | b | type | flag |\n"
@@ -167,8 +167,8 @@ bool Debugger::Cmd_Zones(int argc, const char **argv) {
bool Debugger::Cmd_Animations(int argc, const char **argv) {
- AnimationList::iterator b = _vm->_animations.begin();
- AnimationList::iterator e = _vm->_animations.end();
+ AnimationList::iterator b = _vm->_location._animations.begin();
+ AnimationList::iterator e = _vm->_location._animations.end();
DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
"| name | x | y | z | f | type | flag | \n"
@@ -219,8 +219,8 @@ bool Debugger::Cmd_Set(int argc, const char** argv) {
bool Debugger::Cmd_Programs(int argc, const char** argv) {
- ProgramList::iterator b = _vm->_programs.begin();
- ProgramList::iterator e = _vm->_programs.end();
+ ProgramList::iterator b = _vm->_location._programs.begin();
+ ProgramList::iterator e = _vm->_location._programs.end();
const char *status[] = { "idle", "running", "completed" };
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index a84601f6f9..8841b9ca40 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -233,4 +233,8 @@ bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, cons
return res;
}
-REGISTER_PLUGIN(PARALLACTION, PLUGIN_TYPE_ENGINE, ParallactionMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(PARALLACTION)
+ REGISTER_PLUGIN_DYNAMIC(PARALLACTION, PLUGIN_TYPE_ENGINE, ParallactionMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(PARALLACTION, PLUGIN_TYPE_ENGINE, ParallactionMetaEngine);
+#endif
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 73414ce0b4..2e3ecb590f 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -155,7 +155,7 @@ bool DialogueManager::displayAnswer(uint16 i) {
Answer *a = _q->_answers[i];
- uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];
+ uint32 flags = _vm->getLocationFlags();
if (a->_yesFlags & kFlagsGlobal)
flags = _commandFlags | kFlagsGlobal;
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index f6cb078835..e4c4ce7492 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -437,56 +437,6 @@ void buildMask2(byte* buf) {
}
}
-class BackgroundDecoder : public Graphics::ILBMDecoder {
-
- PaletteFxRange *_range;
- uint32 _i;
-
-protected:
- void readCRNG(Common::IFFChunk &chunk) {
- _range[_i]._timer = chunk.readUint16BE();
- _range[_i]._step = chunk.readUint16BE();
- _range[_i]._flags = chunk.readUint16BE();
- _range[_i]._first = chunk.readByte();
- _range[_i]._last = chunk.readByte();
-
- _i++;
- }
-
-public:
- BackgroundDecoder(Common::ReadStream &input, Graphics::Surface &surface, byte *&colors, PaletteFxRange *range) :
- Graphics::ILBMDecoder(input, surface, colors), _range(range), _i(0) {
- }
-
- void decode() {
- Common::IFFChunk *chunk;
- while ((chunk = nextChunk()) != 0) {
- switch (chunk->id) {
- case ID_BMHD:
- readBMHD(*chunk);
- break;
-
- case ID_CMAP:
- readCMAP(*chunk);
- break;
-
- case ID_BODY:
- readBODY(*chunk);
- break;
-
- case ID_CRNG:
- readCRNG(*chunk);
- break;
- }
- }
- }
-
- uint32 getNumRanges() {
- return _i;
- }
-};
-
-
void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *name) {
char path[PATH_LEN];
@@ -498,9 +448,8 @@ void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *name) {
errorFileNotFound(path);
byte *pal;
- PaletteFxRange ranges[6];
- BackgroundDecoder decoder(s, info.bg, pal, ranges);
+ Graphics::ILBMDecoder decoder(s, info.bg, pal);
decoder.decode();
uint i;
@@ -606,8 +555,15 @@ Frames* AmigaDisk_br::loadStatic(const char* name) {
errorFileNotFound(path);
}
- loadBackground(_backgroundTemp, path);
- return new SurfaceToFrames(&_backgroundTemp.bg);
+ byte *pal = 0;
+ Graphics::Surface* surf = new Graphics::Surface;
+
+ Graphics::ILBMDecoder decoder(stream, *surf, pal);
+ decoder.decode();
+
+ free(pal);
+
+ return new SurfaceToFrames(surf);
}
Sprites* AmigaDisk_br::createSprites(const char *path) {
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 6aeb090ad9..e4859a8851 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -215,25 +215,25 @@ DECLARE_COMMAND_OPCODE(dec) {
DECLARE_COMMAND_OPCODE(ifeq) {
if (_counters[_cmdRunCtxt.cmd->u._lvalue] == _cmdRunCtxt.cmd->u._rvalue) {
- _localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+ setLocationFlags(kFlagsTestTrue);
} else {
- _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+ clearLocationFlags(kFlagsTestTrue);
}
}
DECLARE_COMMAND_OPCODE(iflt) {
if (_counters[_cmdRunCtxt.cmd->u._lvalue] < _cmdRunCtxt.cmd->u._rvalue) {
- _localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+ setLocationFlags(kFlagsTestTrue);
} else {
- _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+ clearLocationFlags(kFlagsTestTrue);
}
}
DECLARE_COMMAND_OPCODE(ifgt) {
if (_counters[_cmdRunCtxt.cmd->u._lvalue] > _cmdRunCtxt.cmd->u._rvalue) {
- _localFlags[_currentLocationIndex] |= kFlagsTestTrue;
+ setLocationFlags(kFlagsTestTrue);
} else {
- _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue;
+ clearLocationFlags(kFlagsTestTrue);
}
}
@@ -259,9 +259,9 @@ DECLARE_COMMAND_OPCODE(unfix) {
DECLARE_COMMAND_OPCODE(zeta) {
- _zeta0 = _cmdRunCtxt.cmd->u._zeta0;
- _zeta1 = _cmdRunCtxt.cmd->u._zeta1;
- _zeta2 = _cmdRunCtxt.cmd->u._zeta2;
+ _location._zeta0 = _cmdRunCtxt.cmd->u._zeta0;
+ _location._zeta1 = _cmdRunCtxt.cmd->u._zeta1;
+ _location._zeta2 = _cmdRunCtxt.cmd->u._zeta2;
}
@@ -294,7 +294,7 @@ DECLARE_COMMAND_OPCODE(part) {
DECLARE_COMMAND_OPCODE(testsfx) {
warning("Parallaction_br::cmdOp_testsfx not completely implemented");
- _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue; // should test if sfx are enabled
+ clearLocationFlags(kFlagsTestTrue); // should test if sfx are enabled
}
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp
index ed4592646b..385e49b78d 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -209,7 +209,7 @@ DECLARE_COMMAND_OPCODE(set) {
_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
_commandFlags |= _cmdRunCtxt.cmd->u._flags;
} else {
- _localFlags[_currentLocationIndex] |= _cmdRunCtxt.cmd->u._flags;
+ setLocationFlags(_cmdRunCtxt.cmd->u._flags);
}
}
@@ -219,7 +219,7 @@ DECLARE_COMMAND_OPCODE(clear) {
_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
_commandFlags &= ~_cmdRunCtxt.cmd->u._flags;
} else {
- _localFlags[_currentLocationIndex] &= ~_cmdRunCtxt.cmd->u._flags;
+ clearLocationFlags(_cmdRunCtxt.cmd->u._flags);
}
}
@@ -294,7 +294,7 @@ DECLARE_COMMAND_OPCODE(toggle) {
_cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal;
_commandFlags ^= _cmdRunCtxt.cmd->u._flags;
} else {
- _localFlags[_currentLocationIndex] ^= _cmdRunCtxt.cmd->u._flags;
+ toggleLocationFlags(_cmdRunCtxt.cmd->u._flags);
}
}
@@ -323,7 +323,7 @@ void Parallaction_ns::drawAnimations() {
uint16 layer = 0;
- for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) {
+ for (AnimationList::iterator it = _location._animations.begin(); it != _location._animations.end(); it++) {
AnimationPtr v18 = *it;
GfxObj *obj = v18->gfxobj;
@@ -374,7 +374,7 @@ void Parallaction_ns::runScripts() {
static uint16 modCounter = 0;
- for (ProgramList::iterator it = _programs.begin(); it != _programs.end(); it++) {
+ for (ProgramList::iterator it = _location._programs.begin(); it != _location._programs.end(); it++) {
AnimationPtr a = (*it)->_anim;
@@ -434,7 +434,7 @@ void Parallaction::runCommands(CommandList& list, ZonePtr z) {
for ( ; it != list.end(); it++) {
CommandPtr cmd = *it;
- uint32 v8 = _localFlags[_currentLocationIndex];
+ uint32 v8 = getLocationFlags();
if (_engineFlags & kEngineQuit)
break;
@@ -576,7 +576,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
uint16 _di = y;
uint16 _si = x;
- for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) {
+ for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) {
// printf("Zone name: %s", z->_name);
ZonePtr z = *it;
@@ -637,7 +637,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
int16 _a, _b, _c, _d, _e, _f;
- for (AnimationList::iterator ait = _animations.begin(); ait != _animations.end(); ait++) {
+ for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ait++) {
AnimationPtr a = *ait;
diff --git a/engines/parallaction/module.mk b/engines/parallaction/module.mk
index 9a66b317e2..c7e7af14bf 100644
--- a/engines/parallaction/module.mk
+++ b/engines/parallaction/module.mk
@@ -29,7 +29,7 @@ MODULE_OBJS := \
walk.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_PARALLACTION), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h
index eb7a1445b3..cfb78f941b 100644
--- a/engines/parallaction/objects.h
+++ b/engines/parallaction/objects.h
@@ -94,6 +94,8 @@ enum ZoneFlags {
enum CommandFlags {
+ kFlagsAll = 0xFFFFFFFF,
+
kFlagsVisited = 1,
kFlagsExit = 0x10000000,
kFlagsEnter = 0x20000000,
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 1b69b163f4..649f21ae96 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -49,15 +49,12 @@ uint16 _mouseButtons = 0;
char _saveData1[30] = { '\0' };
uint16 _language = 0;
-char _slideText[2][MAX_TOKEN_LEN];
uint32 _engineFlags = 0;
uint16 _score = 1;
char _password[8];
uint32 _commandFlags = 0;
-uint16 _introSarcData3 = 200;
-uint16 _introSarcData2 = 1;
// private stuff
@@ -92,6 +89,7 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam
Parallaction::~Parallaction() {
delete _debugger;
+ delete _locationParser;
delete _globalTable;
delete _callableNames;
@@ -115,7 +113,7 @@ int Parallaction::init() {
_engineFlags = 0;
_objectsNames = NULL;
_globalTable = NULL;
- _hasLocationSound = false;
+ _location._hasSound = false;
_transCurrentHoverItem = 0;
_actionAfterWalk = false; // actived when the character needs to move before taking an action
_activeItem._index = 0;
@@ -591,45 +589,16 @@ void Parallaction::resumeJobs() {
return;
}
-
-void Parallaction::pushParserTables(OpcodeSet *opcodes, Table *statements) {
- _opcodes.push(_currentOpcodes);
- _statements.push(_currentStatements);
-
- _currentOpcodes = opcodes;
- _currentStatements = statements;
-}
-
-void Parallaction::popParserTables() {
- assert(_opcodes.size() > 0);
-
- _currentOpcodes = _opcodes.pop();
- _currentStatements = _statements.pop();
-}
-
-void Parallaction::parseStatement() {
- assert(_currentOpcodes != 0);
-
- _lookup = _currentStatements->lookup(_tokens[0]);
-
- debugC(9, kDebugParser, "parseStatement: %s (lookup = %i)", _tokens[0], _lookup);
-
- (*(*_currentOpcodes)[_lookup])();
-}
-
-
-
-
AnimationPtr Parallaction::findAnimation(const char *name) {
- for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++)
+ for (AnimationList::iterator it = _location._animations.begin(); it != _location._animations.end(); it++)
if (!scumm_stricmp((*it)->_name, name)) return *it;
return nullAnimationPtr;
}
void Parallaction::freeAnimations() {
- _animations.clear();
+ _location._animations.clear();
return;
}
@@ -661,7 +630,7 @@ void Parallaction::allocateLocationSlot(const char *name) {
_locationNames[_numLocations][0] = '\0';
_localFlags[_numLocations] = 0;
} else {
- _localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited'
+ setLocationFlags(kFlagsVisited); // 'visited'
}
}
@@ -682,7 +651,7 @@ void Parallaction::freeLocation() {
_gfx->clearGfxObjects();
freeBackground();
- _programs.clear();
+ _location._programs.clear();
freeZones();
freeAnimations();
@@ -735,7 +704,7 @@ void Parallaction::doLocationEnterTransition() {
return;
}
- if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+ if (getLocationFlags() & kFlagsVisited) {
debugC(2, kDebugExec, "skipping location transition");
return; // visited
}
@@ -768,11 +737,28 @@ void Parallaction::doLocationEnterTransition() {
return;
}
+void Parallaction::setLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] |= flags;
+}
+
+void Parallaction::clearLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] &= ~flags;
+}
+
+void Parallaction::toggleLocationFlags(uint32 flags) {
+ _localFlags[_currentLocationIndex] ^= flags;
+}
+
+uint32 Parallaction::getLocationFlags() {
+ return _localFlags[_currentLocationIndex];
+}
+
+
ZonePtr Parallaction::findZone(const char *name) {
- for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) {
+ for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) {
if (!scumm_stricmp((*it)->_name, name)) return *it;
}
@@ -783,9 +769,9 @@ ZonePtr Parallaction::findZone(const char *name) {
void Parallaction::freeZones() {
debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit);
- ZoneList::iterator it = _zones.begin();
+ ZoneList::iterator it = _location._zones.begin();
- while ( it != _zones.end() ) {
+ while ( it != _location._zones.end() ) {
// NOTE : this condition has been relaxed compared to the original, to allow the engine
// to retain special - needed - zones that were lost across location switches.
@@ -794,7 +780,7 @@ void Parallaction::freeZones() {
debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name);
it++;
} else {
- it = _zones.erase(it);
+ it = _location._zones.erase(it);
}
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 3673f047fb..19ce437410 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -145,15 +145,13 @@ struct PARALLACTIONGameDescription;
+
extern uint16 _mouseButtons;
extern char _password[8];
extern uint16 _score;
extern uint16 _language;
extern uint32 _engineFlags;
#define MAX_FORWARDS 50
-extern char _slideText[][MAX_TOKEN_LEN];
-extern uint16 _introSarcData3; // sarcophagus stuff to be saved
-extern uint16 _introSarcData2; // sarcophagus stuff to be saved
extern char _saveData1[];
extern uint32 _commandFlags;
extern const char *_dinoName;
@@ -187,10 +185,20 @@ struct Location {
char *_comment;
char *_endComment;
+ ZoneList _zones;
+ AnimationList _animations;
+ ProgramList _programs;
+
+ bool _hasSound;
+ char _soundFile[50];
+
// NS specific
WalkNodeList _walkNodes;
// BRA specific
+ int _zeta0;
+ int _zeta1;
+ int _zeta2;
CommandList _escapeCommands;
};
@@ -239,35 +247,6 @@ public:
-
-class Opcode {
-
-public:
- virtual void operator()() const = 0;
- virtual ~Opcode() { }
-};
-
-template <class T>
-class OpcodeImpl : public Opcode {
-
- typedef void (T::*Fn)();
-
- T* _instance;
- Fn _fn;
-
-public:
- OpcodeImpl(T* instance, const Fn &fn) : _instance(instance), _fn(fn) { }
-
- void operator()() const {
- (_instance->*_fn)();
- }
-
-};
-
-typedef Common::Array<const Opcode*> OpcodeSet;
-
-
-
#define DECLARE_UNQUALIFIED_ZONE_PARSER(sig) void locZoneParse_##sig()
#define DECLARE_UNQUALIFIED_ANIM_PARSER(sig) void locAnimParse_##sig()
#define DECLARE_UNQUALIFIED_COMMAND_PARSER(sig) void cmdParse_##sig()
@@ -308,15 +287,6 @@ public:
void updateGameInput();
void updateCommentInput();
- uint _lookup;
- Common::Stack<OpcodeSet*> _opcodes;
- Common::Stack<Table*> _statements;
- OpcodeSet *_currentOpcodes;
- Table *_currentStatements;
- void pushParserTables(OpcodeSet *opcodes, Table* statements);
- void popParserTables();
- void parseStatement();
-
OpcodeSet _commandOpcodes;
struct ParallactionStruct1 {
@@ -366,6 +336,8 @@ public:
Table *_callableNames;
Table *_localFlagNames;
+ Parser *_locationParser;
+
public:
int getGameType() const;
uint32 getFeatures() const;
@@ -390,6 +362,11 @@ public:
Character _char;
+ void setLocationFlags(uint32 flags);
+ void clearLocationFlags(uint32 flags);
+ void toggleLocationFlags(uint32 flags);
+ uint32 getLocationFlags();
+
uint32 _localFlags[NUM_LOCATIONS];
char _locationNames[NUM_LOCATIONS][32];
int16 _currentLocationIndex;
@@ -405,9 +382,6 @@ public:
ZonePtr _activeZone;
- ZoneList _zones;
- AnimationList _animations;
- ProgramList _programs;
Font *_labelFont;
Font *_menuFont;
@@ -444,8 +418,6 @@ protected: // data
Common::String _saveFileName;
- bool _hasLocationSound;
- char _locationSound[50];
ZonePtr _hoverZone;
@@ -626,9 +598,13 @@ private:
*/
ZonePtr _moveSarcZone0;
- int16 _introSarcData1;
ZonePtr _moveSarcZone1;
uint16 num_foglie;
+ char _slideText[2][MAX_TOKEN_LEN];
+ int16 _introSarcData1;
+ uint16 _introSarcData2; // sarcophagus stuff to be saved
+ uint16 _introSarcData3; // sarcophagus stuff to be saved
+
ZonePtr _moveSarcZones[5];
ZonePtr _moveSarcExaZones[5];
AnimationPtr _rightHandAnim;
@@ -893,10 +869,6 @@ public:
int _part;
int _progress;
- int _zeta0;
- int _zeta1;
- int _zeta2;
-
int16 _lipSyncVal;
uint _subtitleLipSync;
int _subtitleY;
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 34d6868b52..29e9fe6d70 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -215,7 +215,7 @@ void Parallaction_br::changeLocation(char *location) {
clearSubtitles();
freeBackground();
_gfx->clearGfxObjects();
- _programs.clear();
+ _location._programs.clear();
freeZones();
freeAnimations();
// free(_location._comment);
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index b354be4f49..7a476f7d24 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -138,9 +138,12 @@ int Parallaction_ns::init() {
initParsers();
_introSarcData1 = 0;
+ _introSarcData2 = 1;
+ _introSarcData3 = 200;
+
num_foglie = 0;
- _animations.push_front(_char._ani);
+ _location._animations.push_front(_char._ani);
Parallaction::init();
@@ -156,7 +159,7 @@ Parallaction_ns::~Parallaction_ns() {
delete _instructionNames;
delete _locationStmt;
- _animations.remove(_char._ani);
+ _location._animations.remove(_char._ani);
}
@@ -303,7 +306,7 @@ void Parallaction_ns::changeLocation(char *location) {
setArrowCursor();
}
- _animations.remove(_char._ani);
+ _location._animations.remove(_char._ani);
freeLocation();
@@ -323,7 +326,7 @@ void Parallaction_ns::changeLocation(char *location) {
changeCharacter(locname.character());
}
- _animations.push_front(_char._ani);
+ _location._animations.push_front(_char._ani);
strcpy(_saveData1, locname.location());
parseLocation(_saveData1);
@@ -354,8 +357,8 @@ void Parallaction_ns::changeLocation(char *location) {
runCommands(_location._aCommands);
- if (_hasLocationSound)
- _soundMan->playSfx(_locationSound, 0, true);
+ if (_location._hasSound)
+ _soundMan->playSfx(_location._soundFile, 0, true);
debugC(1, kDebugExec, "changeLocation() done");
@@ -417,7 +420,7 @@ void Parallaction_ns::cleanupGame() {
_engineFlags &= ~kEngineTransformedDonna;
// this code saves main character animation from being removed from the following code
- _animations.remove(_char._ani);
+ _location._animations.remove(_char._ani);
_numLocations = 0;
_commandFlags = 0;
@@ -434,7 +437,7 @@ void Parallaction_ns::cleanupGame() {
_engineFlags &= ~kEngineQuit;
// main character animation is restored
- _animations.push_front(_char._ani);
+ _location._animations.push_front(_char._ani);
_score = 0;
return;
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index cc0a772b45..665da16636 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -209,4 +209,47 @@ uint16 Script::readLineToken(bool errorOnEOF) {
return fillTokens(line);
}
+
+void Parser::reset() {
+ _currentOpcodes = 0;
+ _currentStatements = 0;
+ _script = 0;
+}
+
+void Parser::pushTables(OpcodeSet *opcodes, Table *statements) {
+ _opcodes.push(_currentOpcodes);
+ _statements.push(_currentStatements);
+
+ _currentOpcodes = opcodes;
+ _currentStatements = statements;
+}
+
+void Parser::popTables() {
+ assert(_opcodes.size() > 0);
+
+ _currentOpcodes = _opcodes.pop();
+ _currentStatements = _statements.pop();
+}
+
+void Parser::parseStatement() {
+ assert(_currentOpcodes != 0);
+
+ _script->readLineToken(true);
+ _lookup = _currentStatements->lookup(_tokens[0]);
+
+ debugC(9, kDebugParser, "parseStatement: %s (lookup = %i)", _tokens[0], _lookup);
+
+ (*(*_currentOpcodes)[_lookup])();
+}
+
+void Parser::bind(Script *script) {
+ reset();
+ _script = script;
+}
+
+void Parser::unbind() {
+ reset();
+}
+
+
} // namespace Parallaction
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index f2a2a0c4b6..d29a6c7e73 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -27,6 +27,7 @@
#define PARALLACTION_PARSER_H
#include "common/stream.h"
+#include "parallaction/objects.h"
namespace Parallaction {
@@ -58,6 +59,63 @@ public:
+class Opcode {
+
+public:
+ virtual void operator()() const = 0;
+ virtual ~Opcode() { }
+};
+
+template <class T>
+class OpcodeImpl : public Opcode {
+
+ typedef void (T::*Fn)();
+
+ T* _instance;
+ Fn _fn;
+
+public:
+ OpcodeImpl(T* instance, const Fn &fn) : _instance(instance), _fn(fn) { }
+
+ void operator()() const {
+ (_instance->*_fn)();
+ }
+
+};
+
+typedef Common::Array<const Opcode*> OpcodeSet;
+
+
+class Parser {
+
+public:
+ Parser() { reset(); }
+ ~Parser() {}
+
+ uint _lookup;
+
+ Common::Stack<OpcodeSet*> _opcodes;
+ Common::Stack<Table*> _statements;
+
+ OpcodeSet *_currentOpcodes;
+ Table *_currentStatements;
+
+ void bind(Script *script);
+ void unbind();
+ void pushTables(OpcodeSet *opcodes, Table* statements);
+ void popTables();
+ void parseStatement();
+
+protected:
+ void reset();
+
+ Script *_script;
+};
+
+
+
+
+
} // namespace Parallaction
#endif
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 1968b008eb..2544267382 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -146,11 +146,11 @@ DECLARE_LOCATION_PARSER(location) {
DECLARE_LOCATION_PARSER(zone) {
debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
- parseZone(*_locParseCtxt.script, _zones, _tokens[1]);
+ parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
_locParseCtxt.z->_index = _locParseCtxt.numZones++;
- if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+ if (getLocationFlags() & kFlagsVisited) {
_locParseCtxt.z->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index];
} else {
_zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index] = _locParseCtxt.z->_flags;
@@ -162,11 +162,11 @@ DECLARE_LOCATION_PARSER(zone) {
DECLARE_LOCATION_PARSER(animation) {
debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
- parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]);
+ parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
_locParseCtxt.a->_index = _locParseCtxt.numZones++;
- if (_localFlags[_currentLocationIndex] & kFlagsVisited) {
+ if (getLocationFlags() & kFlagsVisited) {
_locParseCtxt.a->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index];
} else {
_zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index] = _locParseCtxt.a->_flags;
@@ -189,14 +189,14 @@ DECLARE_LOCATION_PARSER(localflags) {
DECLARE_LOCATION_PARSER(flags) {
debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
- if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) {
+ if ((getLocationFlags() & kFlagsVisited) == 0) {
// only for 1st visit
- _localFlags[_currentLocationIndex] = 0;
+ clearLocationFlags(kFlagsAll);
int _si = 1;
do {
byte _al = _localFlagNames->lookup(_tokens[_si]);
- _localFlags[_currentLocationIndex] |= 1 << (_al - 1);
+ setLocationFlags(1 << (_al - 1));
_si++;
if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -288,13 +288,13 @@ DECLARE_LOCATION_PARSER(escape) {
DECLARE_LOCATION_PARSER(zeta) {
debugC(7, kDebugParser, "LOCATION_PARSER(zeta) ");
- _zeta0 = atoi(_tokens[1]);
- _zeta1 = atoi(_tokens[2]);
+ _location._zeta0 = atoi(_tokens[1]);
+ _location._zeta1 = atoi(_tokens[2]);
if (_tokens[3][0] != '\0') {
- _zeta2 = atoi(_tokens[1]);
+ _location._zeta2 = atoi(_tokens[1]);
} else {
- _zeta2 = 50;
+ _location._zeta2 = 50;
}
}
@@ -316,7 +316,7 @@ DECLARE_COMMAND_PARSER(endif) {
DECLARE_COMMAND_PARSER(location) {
debugC(7, kDebugParser, "COMMAND_PARSER(location) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._string = strdup(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -345,7 +345,7 @@ DECLARE_COMMAND_PARSER(location) {
DECLARE_COMMAND_PARSER(string) {
debugC(7, kDebugParser, "COMMAND_PARSER(string) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._string = strdup(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -357,7 +357,7 @@ DECLARE_COMMAND_PARSER(string) {
DECLARE_COMMAND_PARSER(math) {
debugC(7, kDebugParser, "COMMAND_PARSER(math) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._lvalue = _countersNames->lookup(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -372,7 +372,7 @@ DECLARE_COMMAND_PARSER(math) {
DECLARE_COMMAND_PARSER(test) {
debugC(7, kDebugParser, "COMMAND_PARSER(test) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
uint counter = _countersNames->lookup(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -405,7 +405,7 @@ DECLARE_COMMAND_PARSER(test) {
DECLARE_COMMAND_PARSER(music) {
debugC(7, kDebugParser, "COMMAND_PARSER(music) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._musicCommand = _audioCommandsNames->lookup(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -423,7 +423,7 @@ DECLARE_COMMAND_PARSER(music) {
DECLARE_COMMAND_PARSER(zeta) {
debugC(7, kDebugParser, "COMMAND_PARSER(zeta) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -445,7 +445,7 @@ DECLARE_COMMAND_PARSER(zeta) {
DECLARE_COMMAND_PARSER(give) {
debugC(7, kDebugParser, "COMMAND_PARSER(give) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._object = 4 + atoi(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -471,7 +471,7 @@ DECLARE_COMMAND_PARSER(give) {
DECLARE_COMMAND_PARSER(text) {
debugC(7, kDebugParser, "COMMAND_PARSER(text) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
if (isdigit(_tokens[1][1])) {
_locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]);
@@ -497,7 +497,7 @@ DECLARE_COMMAND_PARSER(text) {
DECLARE_COMMAND_PARSER(unary) {
debugC(7, kDebugParser, "COMMAND_PARSER(unary) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._rvalue = atoi(_tokens[1]);
_locParseCtxt.nextToken++;
@@ -548,7 +548,7 @@ DECLARE_ZONE_PARSER(type) {
// }
}
- popParserTables();
+ _locationParser->popTables();
}
@@ -592,7 +592,7 @@ DECLARE_ANIM_PARSER(endanimation) {
_locParseCtxt.a->_flags |= 0x1000000;
- popParserTables();
+ _locationParser->popTables();
}
@@ -760,6 +760,8 @@ typedef OpcodeImpl<Parallaction_br> OpcodeV2;
void Parallaction_br::initParsers() {
+ _locationParser = new Parser;
+
static const OpcodeV2 op0[] = {
INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition
INSTRUCTION_PARSER(zone), // on
@@ -908,10 +910,6 @@ void Parallaction_br::initParsers() {
for (i = 0; i < ARRAYSIZE(op6); i++)
_locationAnimParsers.push_back(&op6[i]);
-
- _currentOpcodes = 0;
- _currentStatements = 0;
-
}
void Parallaction_br::parseLocation(const char* filename) {
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 5e4bdf25cf..b8b36a0885 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -112,7 +112,7 @@ DECLARE_ANIM_PARSER(type) {
_locParseCtxt.a->_flags |= 0x1000000;
- popParserTables();
+ _locationParser->popTables();
}
@@ -176,7 +176,7 @@ DECLARE_ANIM_PARSER(endanimation) {
_locParseCtxt.a->_flags |= 0x1000000;
- popParserTables();
+ _locationParser->popTables();
}
void Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char *name) {
@@ -191,7 +191,7 @@ void Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char *
_locParseCtxt.a = a;
_locParseCtxt.script = &script;
- pushParserTables(&_locationAnimParsers, _locationAnimStmt);
+ _locationParser->pushTables(&_locationAnimParsers, _locationAnimStmt);
}
void Parallaction_ns::parseInstruction(ProgramPtr program) {
@@ -239,7 +239,7 @@ void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) {
delete script;
- _programs.push_back(program);
+ _location._programs.push_back(program);
debugC(1, kDebugParser, "loadProgram() done");
@@ -469,7 +469,7 @@ void Parallaction_ns::parseLValue(ScriptVar &v, const char *str) {
DECLARE_COMMAND_PARSER(flags) {
debugC(7, kDebugParser, "COMMAND_PARSER(flags) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
if (_globalTable->lookup(_tokens[1]) == Table::notFound) {
do {
@@ -496,7 +496,7 @@ DECLARE_COMMAND_PARSER(flags) {
DECLARE_COMMAND_PARSER(zone) {
debugC(7, kDebugParser, "COMMAND_PARSER(zone) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._zone = findZone(_tokens[_locParseCtxt.nextToken]);
if (!_locParseCtxt.cmd->u._zone) {
@@ -512,7 +512,7 @@ DECLARE_COMMAND_PARSER(zone) {
DECLARE_COMMAND_PARSER(location) {
debugC(7, kDebugParser, "COMMAND_PARSER(location) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._string = strdup(_tokens[_locParseCtxt.nextToken]);
_locParseCtxt.nextToken++;
@@ -525,7 +525,7 @@ DECLARE_COMMAND_PARSER(location) {
DECLARE_COMMAND_PARSER(drop) {
debugC(7, kDebugParser, "COMMAND_PARSER(drop) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._object = 4 + _objectsNames->lookup(_tokens[_locParseCtxt.nextToken]);
_locParseCtxt.nextToken++;
@@ -538,7 +538,7 @@ DECLARE_COMMAND_PARSER(drop) {
DECLARE_COMMAND_PARSER(call) {
debugC(7, kDebugParser, "COMMAND_PARSER(call) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._callable = _callableNames->lookup(_tokens[_locParseCtxt.nextToken]) - 1;
_locParseCtxt.nextToken++;
@@ -551,7 +551,7 @@ DECLARE_COMMAND_PARSER(call) {
DECLARE_COMMAND_PARSER(simple) {
debugC(7, kDebugParser, "COMMAND_PARSER(simple) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
addCommand();
}
@@ -559,7 +559,7 @@ DECLARE_COMMAND_PARSER(simple) {
DECLARE_COMMAND_PARSER(move) {
debugC(7, kDebugParser, "COMMAND_PARSER(move) ");
- createCommand(_lookup);
+ createCommand(_locationParser->_lookup);
_locParseCtxt.cmd->u._move.x = atoi(_tokens[_locParseCtxt.nextToken]);
_locParseCtxt.nextToken++;
@@ -573,7 +573,7 @@ DECLARE_COMMAND_PARSER(move) {
DECLARE_COMMAND_PARSER(endcommands) {
debugC(7, kDebugParser, "COMMAND_PARSER(endcommands) ");
- popParserTables();
+ _locationParser->popTables();
// temporary trick to handle dialogue commands
_locParseCtxt.endcommands = true;
@@ -679,7 +679,7 @@ void Parallaction_ns::parseCommands(Script &script, CommandList& list) {
_locParseCtxt.endcommands = false;
_locParseCtxt.script = &script;
- pushParserTables(&_commandParsers, _commandsNames);
+ _locationParser->pushTables(&_commandParsers, _commandsNames);
}
Dialogue *Parallaction_ns::parseDialogue(Script &script) {
@@ -779,8 +779,7 @@ Answer *Parallaction_ns::parseAnswer(Script &script) {
parseCommands(script, answer->_commands);
_locParseCtxt.endcommands = false;
do {
- script.readLineToken(true);
- parseStatement();
+ _locationParser->parseStatement();
} while (!_locParseCtxt.endcommands);
script.readLineToken(true);
@@ -883,14 +882,14 @@ DECLARE_LOCATION_PARSER(nodes) {
DECLARE_LOCATION_PARSER(zone) {
debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
- parseZone(*_locParseCtxt.script, _zones, _tokens[1]);
+ parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
}
DECLARE_LOCATION_PARSER(animation) {
debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
- parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]);
+ parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
}
@@ -922,14 +921,14 @@ DECLARE_LOCATION_PARSER(acommands) {
DECLARE_LOCATION_PARSER(flags) {
debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
- if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) {
+ if ((getLocationFlags() & kFlagsVisited) == 0) {
// only for 1st visit
- _localFlags[_currentLocationIndex] = 0;
+ clearLocationFlags(kFlagsAll);
int _si = 1;
do {
byte _al = _localFlagNames->lookup(_tokens[_si]);
- _localFlags[_currentLocationIndex] |= 1 << (_al - 1);
+ setLocationFlags(1 << (_al - 1));
_si++;
if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -957,8 +956,8 @@ DECLARE_LOCATION_PARSER(sound) {
debugC(7, kDebugParser, "LOCATION_PARSER(sound) ");
if (getPlatform() == Common::kPlatformAmiga) {
- strcpy(_locationSound, _tokens[1]);
- _hasLocationSound = true;
+ strcpy(_location._soundFile, _tokens[1]);
+ _location._hasSound = true;
}
}
@@ -980,29 +979,30 @@ void Parallaction_ns::parseLocation(const char *filename) {
_numForwardedCommands = 0;
Script *script = _disk->loadLocation(filename);
+ _locationParser->bind(script);
// TODO: the following two lines are specific to Nippon Safes
// and should be moved into something like 'initializeParsing()'
- _hasLocationSound = false;
+ _location._hasSound = false;
_locParseCtxt.end = false;
_locParseCtxt.script = script;
_locParseCtxt.filename = filename;
- pushParserTables(&_locationParsers, _locationStmt);
+ _locationParser->pushTables(&_locationParsers, _locationStmt);
do {
- script->readLineToken(true);
- parseStatement();
+ _locationParser->parseStatement();
} while (!_locParseCtxt.end);
- popParserTables();
+ _locationParser->popTables();
+ _locationParser->unbind();
delete script;
resolveCommandForwards();
// this loads animation scripts
- AnimationList::iterator it = _animations.begin();
- for ( ; it != _animations.end(); it++) {
+ AnimationList::iterator it = _location._animations.begin();
+ for ( ; it != _location._animations.end(); it++) {
if ((*it)->_scriptName) {
loadProgram(*it, (*it)->_scriptName);
}
@@ -1048,6 +1048,8 @@ typedef OpcodeImpl<Parallaction_ns> OpcodeV1;
void Parallaction_ns::initParsers() {
+ _locationParser = new Parser;
+
static const OpcodeV1 op0[] = {
INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition
INSTRUCTION_PARSER(animation), // on
@@ -1153,9 +1155,6 @@ void Parallaction_ns::initParsers() {
for (i = 0; i < ARRAYSIZE(op6); i++)
_locationAnimParsers.push_back(&op6[i]);
- _currentOpcodes = 0;
- _currentStatements = 0;
-
}
//
@@ -1193,7 +1192,7 @@ DECLARE_ZONE_PARSER(null) {
DECLARE_ZONE_PARSER(endzone) {
debugC(7, kDebugParser, "ZONE_PARSER(endzone) ");
- popParserTables();
+ _locationParser->popTables();
}
DECLARE_ZONE_PARSER(limits) {
@@ -1226,7 +1225,7 @@ DECLARE_ZONE_PARSER(type) {
parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.z);
}
- popParserTables();
+ _locationParser->popTables();
}
@@ -1274,7 +1273,7 @@ void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) {
list.push_front(z);
- pushParserTables(&_locationZoneParsers, _locationZoneStmt);
+ _locationParser->pushTables(&_locationZoneParsers, _locationZoneStmt);
return;
}
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 3272a16179..0a8ded9e29 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -355,15 +355,15 @@ uint16 Parallaction::checkDoor() {
z = hitZone(kZoneTrap, foot.x, foot.y);
if (z) {
- _localFlags[_currentLocationIndex] |= kFlagsEnter;
+ setLocationFlags(kFlagsEnter);
runCommands(z->_commands, z);
- _localFlags[_currentLocationIndex] &= ~kFlagsEnter;
+ clearLocationFlags(kFlagsEnter);
_zoneTrap = z;
} else
if (_zoneTrap) {
- _localFlags[_currentLocationIndex] |= kFlagsExit;
+ setLocationFlags(kFlagsExit);
runCommands(_zoneTrap->_commands, _zoneTrap);
- _localFlags[_currentLocationIndex] &= ~kFlagsExit;
+ clearLocationFlags(kFlagsExit);
_zoneTrap = nullZonePtr;
}
diff --git a/engines/queen/module.mk b/engines/queen/module.mk
index c691906558..5e0602cae7 100644
--- a/engines/queen/module.mk
+++ b/engines/queen/module.mk
@@ -24,7 +24,7 @@ MODULE_OBJS := \
walk.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_QUEEN), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index cd492b7934..d1a1247c46 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -127,7 +127,11 @@ PluginError QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
return kNoError;
}
-REGISTER_PLUGIN(QUEEN, PLUGIN_TYPE_ENGINE, QueenMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(QUEEN)
+ REGISTER_PLUGIN_DYNAMIC(QUEEN, PLUGIN_TYPE_ENGINE, QueenMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(QUEEN, PLUGIN_TYPE_ENGINE, QueenMetaEngine);
+#endif
namespace Queen {
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 687018f491..b7d2a3aa39 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -162,7 +162,11 @@ bool SagaMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
return gd != 0;
}
-REGISTER_PLUGIN(SAGA, PLUGIN_TYPE_ENGINE, SagaMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(SAGA)
+ REGISTER_PLUGIN_DYNAMIC(SAGA, PLUGIN_TYPE_ENGINE, SagaMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(SAGA, PLUGIN_TYPE_ENGINE, SagaMetaEngine);
+#endif
namespace Saga {
diff --git a/engines/saga/module.mk b/engines/saga/module.mk
index c1b1c364f6..76783a17ae 100644
--- a/engines/saga/module.mk
+++ b/engines/saga/module.mk
@@ -35,7 +35,7 @@ MODULE_OBJS := \
sound.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_SAGA), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 8882abfeb4..df6660523a 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -902,7 +902,7 @@ void Actor::putActor(int dstX, int dstY, int newRoom) {
}
adjustActorPos();
} else {
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
if (_vm->_game.heversion >= 71)
((ScummEngine_v71he *)_vm)->queueAuxBlock(this);
#endif
@@ -1379,7 +1379,7 @@ void ScummEngine_v6::processActors() {
akos_processQueue();
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v71he::processActors() {
preProcessAuxQueue();
@@ -1543,7 +1543,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
bool Actor::actorHitTest(int x, int y) {
AkosRenderer *ar = (AkosRenderer *)_vm->_costumeRenderer;
@@ -1681,7 +1681,7 @@ void Actor::animateCostume() {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void Actor::animateLimb(int limb, int f) {
// This methods is very similiar to animateCostume().
// However, instead of animating *all* the limbs, it only animates
@@ -1853,7 +1853,7 @@ void ScummEngine::resetV1ActorTalkColor() {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::actorTalk(const byte *msg) {
Actor *a;
bool stringWrap = false;
@@ -1863,8 +1863,12 @@ void ScummEngine_v7::actorTalk(const byte *msg) {
// Play associated speech, if any
playSpeech((byte *)_lastStringTag);
- if ((_game.version == 7 && !_keepText) || (_game.version == 8 && VAR(VAR_HAVE_MSG))) {
- stopTalk();
+ if (_game.id == GID_DIG || _game.id == GID_CMI) {
+ if (VAR(VAR_HAVE_MSG))
+ stopTalk();
+ } else {
+ if (!_keepText)
+ stopTalk();
}
if (_actorToPrintStrFor == 0xFF) {
setTalkingActor(0xFF);
@@ -1881,16 +1885,19 @@ void ScummEngine_v7::actorTalk(const byte *msg) {
_charsetBufPos = 0;
_talkDelay = 0;
_haveMsg = 1;
- if (_game.version == 7)
+ if (_game.id == GID_FT)
VAR(VAR_HAVE_MSG) = 0xFF;
_haveActorSpeechMsg = true;
- if (_game.version == 8) {
+ if (_game.id == GID_DIG || _game.id == GID_CMI) {
stringWrap = _string[0].wrapping;
_string[0].wrapping = true;
}
CHARSET_1();
- if (_game.version == 8) {
- VAR(VAR_HAVE_MSG) = (_string[0].no_talk_anim) ? 2 : 1;
+ if (_game.id == GID_DIG || _game.id == GID_CMI) {
+ if (_game.version == 8)
+ VAR(VAR_HAVE_MSG) = (_string[0].no_talk_anim) ? 2 : 1;
+ else
+ VAR(VAR_HAVE_MSG) = 1;
_string[0].wrapping = stringWrap;
}
}
@@ -1965,6 +1972,12 @@ void Actor::runActorTalkScript(int f) {
if (_vm->_game.version == 8 && _vm->VAR(_vm->VAR_HAVE_MSG) == 2)
return;
+ if (_vm->_game.id == GID_FT && _vm->_string[0].no_talk_anim)
+ return;
+
+ if (!_vm->getTalkingActor() || _room != _vm->_currentRoom || _frame == f)
+ return;
+
if (_talkScript) {
int script = _talkScript;
int args[16];
@@ -1974,8 +1987,7 @@ void Actor::runActorTalkScript(int f) {
_vm->runScript(script, 1, 0, args);
} else {
- if (_frame != f)
- startAnimActor(f);
+ startAnimActor(f);
}
}
@@ -1999,13 +2011,17 @@ void ScummEngine::stopTalk() {
setTalkingActor(0xFF);
a->_heTalking = false;
}
- if (_game.version == 8 || _game.heversion >= 60)
+
+ if (_game.id == GID_DIG || _game.id == GID_CMI) {
setTalkingActor(0);
- if (_game.version == 8)
VAR(VAR_HAVE_MSG) = 0;
+ } else if (_game.heversion >= 60) {
+ setTalkingActor(0);
+ }
+
_keepText = false;
if (_game.version >= 7) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
((ScummEngine_v7 *)this)->clearSubtitleQueue();
#endif
} else {
@@ -2038,7 +2054,7 @@ void Actor::setActorCostume(int c) {
if (_vm->_game.features & GF_NEW_COSTUMES) {
memset(_animVariable, 0, sizeof(_animVariable));
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
if (_vm->_game.heversion >= 71)
((ScummEngine_v71he *)_vm)->queueAuxBlock(this);
#endif
@@ -2277,7 +2293,7 @@ bool Actor::isTalkConditionSet(int slot) const {
return (_heCondMask & (1 << (slot - 1))) != 0;
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v71he::preProcessAuxQueue() {
if (!_skipProcessActors) {
for (int i = 0; i < _auxBlocksNum; ++i) {
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 31e7f75878..8e8fff938d 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -1272,7 +1272,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
}
byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
Common::Rect src, dst;
if (!_mirror) {
@@ -1767,7 +1767,7 @@ void ScummEngine_v6::akos_processQueue() {
a->_offsY = param_2;
break;
case 7:
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
assert(_game.heversion >= 71);
((ScummEngine_v71he *)this)->queueAuxEntry(a->_number, param_1);
#endif
@@ -1793,7 +1793,7 @@ void ScummEngine_v6::akos_processQueue() {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::akos_processQueue() {
byte cmd;
int actor, param_1, param_2;
diff --git a/engines/scumm/camera.cpp b/engines/scumm/camera.cpp
index e2e6ff0cb6..288441695f 100644
--- a/engines/scumm/camera.cpp
+++ b/engines/scumm/camera.cpp
@@ -221,7 +221,7 @@ void ScummEngine::actorFollowCamera(int act) {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::setCameraAt(int pos_x, int pos_y) {
Common::Point old;
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 6fadcd171c..46d034d880 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -49,6 +49,7 @@ void ScummEngine::loadCJKFont() {
Common::File fp;
_useCJKMode = false;
_textSurfaceMultiplier = 1;
+ _newLineCharacter = 0xfe;
if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji
int numChar = 256 * 32;
@@ -74,7 +75,7 @@ void ScummEngine::loadCJKFont() {
break;
case Common::JA_JPN:
fontFile = (_game.id == GID_DIG) ? "kanji16.fnt" : "japanese.fnt";
- numChar = 1024;
+ numChar = 8192;
break;
case Common::ZH_TWN:
if (_game.id == GID_CMI) {
@@ -95,15 +96,17 @@ void ScummEngine::loadCJKFont() {
fp.seek(2, SEEK_CUR);
_2byteWidth = fp.readByte();
_2byteHeight = fp.readByte();
+ _newLineCharacter = 0xff;
break;
case Common::JA_JPN:
_2byteWidth = 16;
_2byteHeight = 16;
+ _newLineCharacter = 0xfe;
break;
case Common::ZH_TWN:
_2byteWidth = 16;
_2byteHeight = 15;
- // 0xFE -> 0x21. also compared with 0x0d. perhaps a newline
+ _newLineCharacter = 0x21;
break;
default:
break;
@@ -217,7 +220,7 @@ byte *ScummEngine::get2byteCharPtr(int idx) {
int high = 0;
if (low >= 0x20 && low <= 0x7e) {
- base = (low + low * 2 + 81012) * 5;
+ base = (3 * low + 81012) * 5;
} else {
if (low >= 0xa1 && low <= 0xa3) {
base = 392820;
@@ -352,7 +355,7 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) {
int code = (_vm->_game.heversion >= 80) ? 127 : 64;
while ((chr = text[pos++]) != 0) {
- if (chr == '\n' || chr == '\r')
+ if (chr == '\n' || chr == '\r' || chr == _vm->_newLineCharacter)
break;
if (_vm->_game.heversion >= 72) {
if (chr == code) {
@@ -479,6 +482,9 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {
if (chr == ' ')
lastspace = pos - 1;
+ if (chr == _vm->_newLineCharacter)
+ lastspace = pos - 1;
+
if ((chr & 0x80) && _vm->_useCJKMode) {
pos++;
curw += _vm->_2byteWidth;
@@ -789,7 +795,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
int drawTop = _top - vs->topline;
if ((_vm->_game.heversion >= 71 && _bitDepth >= 8) || (_vm->_game.heversion >= 90 && _bitDepth == 0)) {
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
if (ignoreCharsetMask || !vs->hasTwoBuffers) {
dstPtr = vs->getPixels(0, 0);
} else {
@@ -965,7 +971,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
CharsetRendererNut::CharsetRendererNut(ScummEngine *vm)
: CharsetRenderer(vm) {
_current = 0;
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 2f1ce1129f..b62dbc6006 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -172,7 +172,7 @@ public:
int getCharWidth(byte chr) { return 8; }
};
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
class CharsetRendererNut : public CharsetRenderer {
protected:
NutRenderer *_fr[5];
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 4f10b9a1c3..9359c6610c 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -260,6 +260,8 @@ static Common::Language detectLanguage(const FSList &fslist, byte id) {
return Common::PT_BRA;
case 229884: // d890074bc15c6135868403e73c5f4f36
return Common::ES_ESP;
+ case 223107: // 64f3fe479d45b52902cf88145c41d172
+ return Common::JA_JPN;
}
}
}
@@ -871,7 +873,7 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
break;
case 6:
switch (res.game.heversion) {
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
case 200:
*engine = new ScummEngine_vCUPhe(syst, res);
break;
@@ -908,7 +910,7 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
*engine = new ScummEngine_v6(syst, res);
}
break;
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
case 7:
*engine = new ScummEngine_v7(syst, res);
break;
@@ -964,4 +966,8 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const {
return saveList;
}
-REGISTER_PLUGIN(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(SCUMM)
+ REGISTER_PLUGIN_DYNAMIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine);
+#endif
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 500a2b47b8..18d51e133d 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -67,7 +67,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "tentacle", "Day of the Tentacle" },
{ "zak", "Zak McKracken and the Alien Mindbenders" },
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
{ "ft", "Full Throttle" },
{ "dig", "The Dig" },
{ "comi", "The Curse of Monkey Island" },
@@ -81,7 +81,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "puttmoon", "Putt-Putt Goes to the Moon" },
{ "puttputt", "Putt-Putt Joins the Parade" },
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
{ "airport", "Let's Explore the Airport with Buzzy" },
{ "arttime", "Blue's Art Time Activities" },
{ "balloon", "Putt-Putt and Pep's Balloon-O-Rama" },
@@ -231,7 +231,7 @@ static const GameSettings gameVariantsTable[] = {
{"samnmax", 0, 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK},
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
{"ft", 0, 0, GID_FT, 7, 0, MDT_NONE, 0, UNK},
{"dig", 0, 0, GID_DIG, 7, 0, MDT_NONE, 0, UNK},
@@ -259,7 +259,7 @@ static const GameSettings gameVariantsTable[] = {
// they'll override more specific entries that follow later on.
{"", "HE 70", 0, GID_HEGAME, 6, 70, MDT_NONE, GF_USE_KEY, UNK},
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
// HE CUP demos
{"", "HE CUP", 0, GID_HECUP, 6, 200, MDT_NONE, 0, UNK},
@@ -443,7 +443,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "samnmax", "snmidemo.%03d", kGenDiskNum, UNK_LANG, UNK, 0 },
{ "samnmax", "sdemo.sm%d", kGenDiskNum, Common::DE_DEU, UNK, 0 },
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
{ "dig", "dig.la%d", kGenDiskNum, UNK_LANG, UNK, 0 },
{ "dig", "The Dig Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "dig", "The Dig Demo Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, "Demo" },
@@ -482,7 +482,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "puttputt", "Putt-Putt's Demo", kGenHEMacNoParens, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "puttputt", "Putt-Putt Parade", kGenHEMacNoParens, UNK_LANG, Common::kPlatformMacintosh, 0 },
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
{ "airport", "airport", kGenHEPC, UNK_LANG, UNK, 0 },
{ "airport", "airdemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "airport", "Airport Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 23efa05dd2..5b6c2bcf35 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -928,6 +928,7 @@ void SubtitleSettingsDialog::handleKeyDown(Common::KeyState state) {
void SubtitleSettingsDialog::open() {
cycleValue();
InfoDialog::open();
+ setResult(_value);
}
void SubtitleSettingsDialog::cycleValue() {
@@ -937,11 +938,12 @@ void SubtitleSettingsDialog::cycleValue() {
"Subtitles Only"
};
- _value = (_value + 1) % 3;
+ _value += 1;
+ if (_value > 2)
+ _value = 0;
setInfoText(subtitleDesc[_value]);
- setResult(_value);
_timer = getMillis() + 1500;
}
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 2ca50a725c..6c8d24d25a 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -28,7 +28,7 @@
#include "scumm/actor.h"
#include "scumm/charset.h"
#include "scumm/intern.h"
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
#include "scumm/he/intern_he.h"
#endif
#include "scumm/resource.h"
@@ -907,7 +907,7 @@ void ScummEngine::redrawBGAreas() {
_bgNeedsRedraw = false;
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v71he::redrawBGAreas() {
if (camera._cur.x != camera._last.x && _charset->_hasMask)
stopTalk();
@@ -1834,7 +1834,7 @@ void GdiV2::decodeMask(int x, int y, const int width, const int height,
// Do nothing here for V2 games - zplane was already handled.
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
/**
* Draw a bitmap onto a virtual screen. This is main drawing method for room backgrounds
* used throughout HE71+ versions.
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 4e92fad0fd..e03fdd1c53 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -246,7 +246,7 @@ public:
void drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
int stripnr, int numstrip, byte flag);
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void drawBMAPBg(const byte *ptr, VirtScreen *vs);
void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h);
#endif
diff --git a/engines/scumm/he/cup_player_he.h b/engines/scumm/he/cup_player_he.h
index b9f257add1..1b1c32d86f 100644
--- a/engines/scumm/he/cup_player_he.h
+++ b/engines/scumm/he/cup_player_he.h
@@ -24,7 +24,7 @@
*/
-#if !defined(SCUMM_HE_CUP_PLAYER_HE_H) && !defined(DISABLE_HE)
+#if !defined(SCUMM_HE_CUP_PLAYER_HE_H) && defined(ENABLE_HE)
#define SCUMM_HE_CUP_PLAYER_HE_H
#include "common/stream.h"
diff --git a/engines/scumm/he/floodfill_he.h b/engines/scumm/he/floodfill_he.h
index d449599f7d..cfc672436c 100644
--- a/engines/scumm/he/floodfill_he.h
+++ b/engines/scumm/he/floodfill_he.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_HE_FLOODFILL_HE_H) && !defined(DISABLE_HE)
+#if !defined(SCUMM_HE_FLOODFILL_HE_H) && defined(ENABLE_HE)
#define SCUMM_HE_FLOODFILL_HE_H
#include "common/rect.h"
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index 324c975213..fff8502134 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -27,7 +27,7 @@
#define SCUMM_HE_INTERN_HE_H
#include "scumm/intern.h"
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
#include "scumm/he/floodfill_he.h"
#include "scumm/he/wiz_he.h"
#endif
@@ -40,7 +40,7 @@ class WriteStream;
namespace Scumm {
class ResExtractor;
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
class LogicHE;
class MoviePlayer;
class Sprite;
@@ -178,7 +178,7 @@ protected:
byte VAR_NUM_SOUND_CHANNELS;
};
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
class ScummEngine_v71he : public ScummEngine_v70he {
friend class Wiz;
diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h
index 96de40f287..b144f78c46 100644
--- a/engines/scumm/he/logic_he.h
+++ b/engines/scumm/he/logic_he.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_HE_LOGIC_HE_H) && !defined(DISABLE_HE)
+#if !defined(SCUMM_HE_LOGIC_HE_H) && defined(ENABLE_HE)
#define SCUMM_HE_LOGIC_HE_H
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 75da8cd04a..33e6748860 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -1524,7 +1524,7 @@ void ScummEngine_v70he::readGlobalObjects() {
#endif
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v99he::readMAXS(int blockSize) {
if (blockSize == 52) {
debug(0, "ScummEngine_v99he readMAXS: MAXS has blocksize %d", blockSize);
diff --git a/engines/scumm/he/sprite_he.h b/engines/scumm/he/sprite_he.h
index 55c1093f00..73a05af579 100644
--- a/engines/scumm/he/sprite_he.h
+++ b/engines/scumm/he/sprite_he.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_HE_SPRITE_HE_H) && !defined(DISABLE_HE)
+#if !defined(SCUMM_HE_SPRITE_HE_H) && defined(ENABLE_HE)
#define SCUMM_HE_SPRITE_HE_H
namespace Scumm {
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index 186dbced6d..6887b45299 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_HE_WIZ_HE_H) && !defined(DISABLE_HE)
+#if !defined(SCUMM_HE_WIZ_HE_H) && defined(ENABLE_HE)
#define SCUMM_HE_WIZ_HE_H
#include "common/rect.h"
diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h
index 8cb6562bd3..bcd6e45244 100644
--- a/engines/scumm/imuse_digi/dimuse.h
+++ b/engines/scumm/imuse_digi/dimuse.h
@@ -22,7 +22,7 @@
* $Id$
*/
-#if !defined(SCUMM_IMUSE_DIGI_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_IMUSE_DIGI_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_IMUSE_DIGI_H
#include "common/scummsys.h"
diff --git a/engines/scumm/imuse_digi/dimuse_tables.h b/engines/scumm/imuse_digi/dimuse_tables.h
index ddd7c571f3..942acd721f 100644
--- a/engines/scumm/imuse_digi/dimuse_tables.h
+++ b/engines/scumm/imuse_digi/dimuse_tables.h
@@ -22,7 +22,7 @@
* $Id$
*/
-#if !defined(SCUMM_IMUSE_DIGI_TABLES_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_IMUSE_DIGI_TABLES_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_IMUSE_DIGI_TABLES_H
#include "common/scummsys.h"
diff --git a/engines/scumm/imuse_digi/dimuse_track.h b/engines/scumm/imuse_digi/dimuse_track.h
index 0c6445c43a..33147128cb 100644
--- a/engines/scumm/imuse_digi/dimuse_track.h
+++ b/engines/scumm/imuse_digi/dimuse_track.h
@@ -22,7 +22,7 @@
* $Id$
*/
-#if !defined(SCUMM_IMUSE_DIGI_TRACK_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_IMUSE_DIGI_TRACK_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_IMUSE_DIGI_TRACK_H
#include "common/scummsys.h"
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index b53867ca3d..35028c7e1c 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -36,7 +36,7 @@
#include "scumm/dialogs.h"
#include "scumm/insane/insane.h"
#include "scumm/imuse/imuse.h"
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
#include "scumm/he/intern_he.h"
#include "scumm/he/logic_he.h"
#endif
@@ -202,7 +202,7 @@ void ScummEngine::parseEvents() {
}
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v90he::clearClickedStatus() {
ScummEngine::clearClickedStatus();
if (_game.heversion >= 98) {
@@ -328,7 +328,7 @@ void ScummEngine::processInput() {
processKeyboard(lastKeyHit);
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v8::processKeyboard(Common::KeyState lastKeyHit) {
if (!(_game.features & GF_DEMO)) {
diff --git a/engines/scumm/insane/insane.h b/engines/scumm/insane/insane.h
index 761ca8b96c..28eafb6f73 100644
--- a/engines/scumm/insane/insane.h
+++ b/engines/scumm/insane/insane.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_INSANE_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_INSANE_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_INSANE_H
#include "engines/engine.h"
diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h
index c693787e83..2dfbcdcdbb 100644
--- a/engines/scumm/intern.h
+++ b/engines/scumm/intern.h
@@ -848,7 +848,7 @@ protected:
byte VAR_TIMEDATE_SECOND;
};
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
class ScummEngine_v7 : public ScummEngine_v6 {
friend class SmushPlayer;
friend class Insane;
@@ -909,6 +909,7 @@ public:
void processSubtitleQueue();
void addSubtitleToQueue(const byte *text, const Common::Point &pos, byte color, byte charset);
void clearSubtitleQueue();
+ virtual void CHARSET_1();
protected:
virtual int runDialog(Dialog &dialog);
@@ -977,7 +978,6 @@ protected:
virtual const char *getOpcodeDesc(byte i);
virtual void printString(int m, const byte *msg);
- virtual void CHARSET_1();
virtual void scummLoop_handleSaveLoad();
diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk
index 7ae4577432..7d52a02116 100644
--- a/engines/scumm/module.mk
+++ b/engines/scumm/module.mk
@@ -64,7 +64,7 @@ MODULE_OBJS += \
proc3ARM.o
endif
-ifndef DISABLE_SCUMM_7_8
+ifdef ENABLE_SCUMM_7_8
MODULE_OBJS += \
nut_renderer.o \
script_v8.o \
@@ -104,7 +104,7 @@ MODULE_OBJS += \
gfxARM.o
endif
-ifndef DISABLE_HE
+ifdef ENABLE_HE
MODULE_OBJS += \
he/animation_he.o \
he/cup_player_he.o \
@@ -121,7 +121,7 @@ MODULE_OBJS += \
endif
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_SCUMM), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/scumm/nut_renderer.h b/engines/scumm/nut_renderer.h
index 55a445e957..5783646d11 100644
--- a/engines/scumm/nut_renderer.h
+++ b/engines/scumm/nut_renderer.h
@@ -22,7 +22,7 @@
* $Id$
*/
-#if !defined(SCUMM_NUT_RENDERER_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_NUT_RENDERER_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_NUT_RENDERER_H
#include "common/file.h"
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index b512c83b94..8bcd92fd3b 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -491,7 +491,7 @@ int ScummEngine::findObject(int x, int y) {
a = _objs[b].parentstate;
b = _objs[b].parent;
if (b == 0) {
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
if (_game.heversion >= 71) {
if (((ScummEngine_v71he *)this)->_wiz->polygonHit(_objs[i].obj_nr, x, y))
return _objs[i].obj_nr;
@@ -614,7 +614,7 @@ void ScummEngine::drawObject(int obj, int arg) {
(_game.id == GID_FT && getClass(od.obj_nr, kObjectClassPlayer)))
flags |= Gdi::dbDrawMaskOnAll;
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
if (_game.heversion >= 70 && findResource(MKID_BE('SMAP'), ptr) == NULL)
_gdi->drawBMAPObject(ptr, &_virtscr[kMainVirtScreen], obj, od.x_pos, od.y_pos, od.width, od.height);
else
@@ -1071,7 +1071,7 @@ void ScummEngine_v6::clearDrawQueues() {
_blastObjectQueuePos = 0;
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v71he::clearDrawQueues() {
ScummEngine_v6::clearDrawQueues();
@@ -1304,7 +1304,7 @@ int ScummEngine::getObjectImageCount(int object) {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
int ScummEngine_v8::getObjectIdFromOBIM(const byte *obim) {
// In V8, IMHD has no obj_id, but rather a name string. We map the name
// back to an object id using a table derived from the DOBJ resource.
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 775aa52a14..fb0e55a2dc 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -714,7 +714,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
static int HSL2RGBHelper(int n1, int n2, int hue) {
if (hue > 360)
hue = hue - 360;
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 19c27b4bc3..acdc2bc222 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -218,7 +218,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
char buf[128];
if (_game.version == 8) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
char result;
_imuseDigital->stopAllSounds();
@@ -347,7 +347,7 @@ bool checkTryMedia(BaseScummFile *handle) {
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::readIndexBlock(uint32 blocktype, uint32 itemsize) {
int num;
char *ptr;
@@ -1081,7 +1081,7 @@ void ScummEngine_v5::readMAXS(int blockSize) {
_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v8::readMAXS(int blockSize) {
debug(9, "ScummEngine_v8 readMAXS: MAXS has blocksize %d", blockSize);
@@ -1204,7 +1204,7 @@ void ScummEngine::readGlobalObjects() {
#endif
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v8::readGlobalObjects() {
int i;
int num = _fileHandle->readUint32LE();
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index 04cd13e126..6fedb34b47 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -28,7 +28,7 @@
#include "scumm/actor.h"
#include "scumm/boxes.h"
#include "scumm/intern.h"
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
#include "scumm/he/intern_he.h"
#endif
#include "scumm/object.h"
@@ -560,7 +560,7 @@ void ScummEngine::resetRoomSubBlocks() {
}
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
// Polygons in HE 80+ games
if (_game.heversion >= 80) {
ptr = findResourceData(MKID_BE('POLD'), roomptr);
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 8d23e47bbf..a8ef26c484 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -235,7 +235,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
if (!_imuse || _saveSound || !_saveTemporaryState)
_sound->stopAllSounds();
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_imuseDigital) {
_imuseDigital->stopAllSounds();
_imuseDigital->resetState();
@@ -1239,7 +1239,7 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) {
s->saveLoadEntries(this, cursorEntries);
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::saveOrLoad(Serializer *s) {
ScummEngine::saveOrLoad(s);
@@ -1292,7 +1292,7 @@ void ScummEngine_v70he::saveOrLoad(Serializer *s) {
s->saveLoadEntries(this, HE70Entries);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v71he::saveOrLoad(Serializer *s) {
ScummEngine_v70he::saveOrLoad(s);
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 420ee6a739..faae72b6dd 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1102,7 +1102,7 @@ void ScummEngine_v6::o6_startSound() {
if (_game.heversion >= 60 && (_game.id != GID_PUTTDEMO))
offset = pop();
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_game.version >= 7)
_imuseDigital->startSfx(pop(), 64);
else
@@ -2545,7 +2545,7 @@ void ScummEngine_v6::o6_setBlastObjectWindow() {
// So, we just handle this as no-op opcode.
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::o6_kernelSetFunctions() {
int args[30];
int num;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 8bb5bcb6ef..c99856b3a3 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -495,7 +495,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
case Common::kRenderCGA:
case Common::kRenderEGA:
case Common::kRenderAmiga:
- if (!(_game.features & GF_16COLOR))
+ if ((_game.version >= 4 && !(_game.features & GF_16COLOR)) || (_game.features & GF_OLD256))
_renderMode = Common::kRenderDefault;
break;
@@ -736,7 +736,7 @@ ScummEngine_v70he::~ScummEngine_v70he() {
free(_storedFlObjects);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
ScummEngine_v71he::ScummEngine_v71he(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v70he(syst, dr) {
_auxBlocksNum = 0;
@@ -858,7 +858,7 @@ void ScummEngine_vCUPhe::parseEvents() {
#endif
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
ScummEngine_v7::ScummEngine_v7(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v6(syst, dr) {
_verbLineSpacing = 10;
@@ -927,7 +927,7 @@ int ScummEngine::init() {
File::addDefaultDirectory(_gameDataPath + "Rooms 3/");
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
#ifdef MACOSX
if (_game.version == 8 && !memcmp(_gameDataPath.c_str(), "/Volumes/MONKEY3_", 17)) {
// Special case for COMI on Mac OS X. The mount points on OS X depend
@@ -1212,7 +1212,7 @@ void ScummEngine::setupScumm() {
_compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier);
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::setupScumm() {
_musicEngine = _imuseDigital = new IMuseDigital(this, _mixer, 10);
@@ -1238,7 +1238,7 @@ void ScummEngine::setupCharsetRenderer() {
_charset = new CharsetRendererV2(this, _language);
else if (_game.version == 3)
_charset = new CharsetRendererV3(this);
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
else if (_game.version == 8)
_charset = new CharsetRendererNut(this);
#endif
@@ -1479,7 +1479,7 @@ void ScummEngine_v60he::resetScumm() {
setCursorHotspot(16, 16);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v72he::resetScumm() {
ScummEngine_v60he::resetScumm();
@@ -1954,7 +1954,7 @@ load_game:
CursorMan.showMouse(_cursor.state > 0);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v90he::scummLoop(int delta) {
_moviePlay->handleNextFrame();
if (_game.heversion >= 98) {
@@ -2051,7 +2051,7 @@ void ScummEngine::scummLoop_handleSaveLoad() {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v8::scummLoop_handleSaveLoad() {
ScummEngine::scummLoop_handleSaveLoad();
@@ -2067,7 +2067,7 @@ void ScummEngine::scummLoop_handleDrawing() {
processDrawQue();
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::scummLoop_handleDrawing() {
ScummEngine_v6::scummLoop_handleDrawing();
@@ -2077,7 +2077,7 @@ void ScummEngine_v7::scummLoop_handleDrawing() {
}
#endif
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v90he::scummLoop_handleDrawing() {
ScummEngine_v80he::scummLoop_handleDrawing();
@@ -2125,7 +2125,7 @@ void ScummEngine::scummLoop_handleSound() {
_sound->processSound();
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::scummLoop_handleSound() {
ScummEngine_v6::scummLoop_handleSound();
if (_imuseDigital) {
@@ -2226,7 +2226,7 @@ void ScummEngine::runBootscript() {
runScript(1, 0, 0, args);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v90he::runBootscript() {
if (_game.heversion >= 98) {
_logicHE->initOnce();
@@ -2284,7 +2284,7 @@ int ScummEngine::runDialog(Dialog &dialog) {
return result;
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
int ScummEngine_v7::runDialog(Dialog &dialog) {
_splayer->pause();
int result = ScummEngine::runDialog(dialog);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 6e0e57c0fe..26b6aa6e2f 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1199,6 +1199,7 @@ public:
bool _useCJKMode;
int _2byteHeight;
int _2byteWidth;
+ byte _newLineCharacter;
byte *get2byteCharPtr(int idx);
protected:
diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h
index 486c8d23e6..413a5895d3 100644
--- a/engines/scumm/smush/smush_player.h
+++ b/engines/scumm/smush/smush_player.h
@@ -23,7 +23,7 @@
*
*/
-#if !defined(SCUMM_SMUSH_PLAYER_H) && !defined(DISABLE_SCUMM_7_8)
+#if !defined(SCUMM_SMUSH_PLAYER_H) && defined(ENABLE_SCUMM_7_8)
#define SCUMM_SMUSH_PLAYER_H
#include "common/util.h"
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index d7e3ec1508..fdd0598378 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -675,7 +675,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
}
if (_vm->_imuseDigital) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
//_vm->_imuseDigital->stopSound(kTalkSoundID);
_vm->_imuseDigital->startVoice(kTalkSoundID, input);
#endif
@@ -688,7 +688,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
void Sound::stopTalkSound() {
if (_sfxMode & 2) {
if (_vm->_imuseDigital) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
_vm->_imuseDigital->stopSound(kTalkSoundID);
#endif
} else if (_vm->_game.heversion >= 60) {
@@ -718,7 +718,7 @@ bool Sound::isMouthSyncOff(uint pos) {
}
int Sound::isSoundRunning(int sound) const {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_vm->_imuseDigital)
return (_vm->_imuseDigital->getSoundStatus(sound) != 0);
#endif
@@ -754,7 +754,7 @@ int Sound::isSoundRunning(int sound) const {
*/
bool Sound::isSoundInUse(int sound) const {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_vm->_imuseDigital)
return (_vm->_imuseDigital->getSoundStatus(sound) != 0);
#endif
@@ -848,7 +848,7 @@ void Sound::stopAllSounds() {
void Sound::soundKludge(int *list, int num) {
int i;
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_vm->_imuseDigital) {
_vm->_imuseDigital->parseScriptCmds(list[0], list[1], list[2], list[3], list[4],
list[5], list[6], list[7]);
@@ -912,7 +912,7 @@ void Sound::pauseSounds(bool pause) {
_soundsPaused = pause;
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_vm->_imuseDigital) {
_vm->_imuseDigital->pause(pause);
}
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 61a960b3ed..f42a803a3d 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -34,7 +34,7 @@
#include "scumm/file.h"
#include "scumm/imuse_digi/dimuse.h"
#include "scumm/intern.h"
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
#include "scumm/he/intern_he.h"
#endif
#include "scumm/verbs.h"
@@ -66,7 +66,7 @@ void ScummEngine::printString(int m, const byte *msg) {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v8::printString(int m, const byte *msg) {
if (m == 4) {
const StringTab &st = _string[m];
@@ -220,7 +220,7 @@ void ScummEngine_v6::removeBlastTexts() {
#pragma mark -
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::processSubtitleQueue() {
for (int i = 0; i < _subtitleQueuePos; ++i) {
SubtitleText *st = &_subtitleQueue[i];
@@ -279,6 +279,12 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
break;
}
c = *buffer++;
+
+ if (c == _newLineCharacter) {
+ c = 13;
+ break;
+ }
+
switch (c) {
case 1:
c = 13; // new line
@@ -347,7 +353,7 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
return (c != 2 && c != 3);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
const int charsetCode = (_game.heversion >= 80) ? 127 : 64;
uint32 talk_sound_a = 0;
@@ -425,7 +431,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
void ScummEngine::CHARSET_1() {
Actor *a;
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
byte subtitleBuffer[200];
byte *subtitleLine = subtitleBuffer;
Common::Point subtitlePos;
@@ -527,7 +533,7 @@ void ScummEngine::CHARSET_1() {
if (!_keepText) {
if (_game.version >= 7) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
((ScummEngine_v7 *)this)->clearSubtitleQueue();
_nextLeft = _string[0].xpos;
_nextTop = _string[0].ypos + _screenTop;
@@ -551,7 +557,7 @@ void ScummEngine::CHARSET_1() {
if (_charset->_center) {
_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
if (_nextLeft < 0)
- _nextLeft = 0;
+ _nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
}
_charset->_disableOffsX = _charset->_firstChar = !_keepText;
@@ -568,7 +574,7 @@ void ScummEngine::CHARSET_1() {
if (c == 13) {
newLine:;
_nextLeft = _string[0].xpos;
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_game.version >= 7 && subtitleLine != subtitleBuffer) {
((ScummEngine_v7 *)this)->addSubtitleToQueue(subtitleBuffer, subtitlePos, _charsetColor, _charset->getCurID());
subtitleLine = subtitleBuffer;
@@ -576,6 +582,8 @@ void ScummEngine::CHARSET_1() {
#endif
if (_charset->_center) {
_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
+ if (_nextLeft < 0)
+ _nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
}
if (_game.version == 0) {
@@ -605,7 +613,7 @@ void ScummEngine::CHARSET_1() {
_charset->_top = _nextTop;
if (_game.version >= 7) {
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (subtitleLine == subtitleBuffer) {
subtitlePos.x = _charset->_left;
// BlastText position is relative to the top of the screen, adjust y-coordinate
@@ -652,15 +660,20 @@ void ScummEngine::CHARSET_1() {
}
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
if (_game.version >= 7 && subtitleLine != subtitleBuffer) {
((ScummEngine_v7 *)this)->addSubtitleToQueue(subtitleBuffer, subtitlePos, _charsetColor, _charset->getCurID());
}
#endif
}
-#ifndef DISABLE_SCUMM_7_8
-void ScummEngine_v8::CHARSET_1() {
+#ifdef ENABLE_SCUMM_7_8
+void ScummEngine_v7::CHARSET_1() {
+ if (_game.id == GID_FT) {
+ ScummEngine::CHARSET_1();
+ return;
+ }
+
byte subtitleBuffer[2048];
byte *subtitleLine = subtitleBuffer;
Common::Point subtitlePos;
@@ -811,7 +824,7 @@ void ScummEngine_v8::CHARSET_1() {
}
}
}
- _haveMsg = 2;
+ _haveMsg = (_game.version == 8) ? 2 : 1;
_keepText = false;
_string[0] = saveStr;
}
@@ -1115,7 +1128,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
return dstSize - (end - dst);
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
int ScummEngine_v72he::convertMessageToString(const byte *msg, byte *dst, int dstSize) {
uint num = 0;
byte chr;
@@ -1232,7 +1245,7 @@ int ScummEngine::convertStringMessage(byte *dst, int dstSize, int var) {
#pragma mark -
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v80he::initCharset(int charsetno) {
ScummEngine::initCharset(charsetno);
VAR(VAR_CURRENT_CHARSET) = charsetno;
@@ -1260,7 +1273,7 @@ void ScummEngine::initCharset(int charsetno) {
#pragma mark -
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
static int indexCompare(const void *p1, const void *p2) {
const ScummEngine_v7::LangIndexNode *i1 = (const ScummEngine_v7::LangIndexNode *) p1;
const ScummEngine_v7::LangIndexNode *i2 = (const ScummEngine_v7::LangIndexNode *) p2;
@@ -1450,7 +1463,7 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
_lastStringTag[0] = 0;
// WORKAROUND for bug #1172655.
- if (_game.id == GID_DIG && text[0] != '/') {
+ if (_game.id == GID_DIG) {
if (!strcmp((const char *)text, "faint light"))
text = (const byte *)"/NEW.007/faint light";
else if (!strcmp((const char *)text, "glowing crystal"))
@@ -1475,6 +1488,18 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
text = (const byte *)"/NEW.013/unattached lens";
else if (!strcmp((const char *)text, "lens slot"))
text = (const byte *)"/NEW.014/lens slot";
+
+ // Added in second release of The Dig
+ else if (!strcmp((const char *)text, "/NEWTON.032/"))
+ text = (const byte *)"/NEW.11/You wish.";
+ else if (!strcmp((const char *)text, "/NEWTON.034/"))
+ text = (const byte *)"/NEW.12/In your dreams";
+ else if (!strcmp((const char *)text, "Jonathon Jackson"))
+ text = (const byte *)"Aram Gutowski";
+ else if (!strcmp((const char *)text, "Brink"))
+ text = (const byte *)"/CREVICE.049/Brink";
+ else if (!strcmp((const char *)text, "Robbins"))
+ text = (const byte *)"/NEST.061/Robbins";
}
diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp
index a71ff19b6e..aade7899aa 100644
--- a/engines/scumm/vars.cpp
+++ b/engines/scumm/vars.cpp
@@ -216,7 +216,7 @@ void ScummEngine_v70he::setupScummVars() {
VAR_SOUND_CHANNEL = 14;
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v72he::setupScummVars() {
VAR_KEYPRESS = 0;
VAR_DEBUGMODE = 1;
@@ -333,7 +333,7 @@ void ScummEngine_v90he::setupScummVars() {
}
#endif
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::setupScummVars() {
VAR_MOUSE_X = 1;
VAR_MOUSE_Y = 2;
@@ -568,7 +568,7 @@ void ScummEngine_v5::resetScummVars() {
_scummVars[74] = 1225;
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::resetScummVars() {
ScummEngine::resetScummVars();
@@ -633,7 +633,7 @@ void ScummEngine_v70he::resetScummVars() {
VAR(VAR_TALK_CHANNEL) = 2;
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v72he::resetScummVars() {
ScummEngine_v70he::resetScummVars();
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index eece5a6d24..cf4711f6a2 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -514,7 +514,7 @@ void ScummEngine_v0::handleMouseOver(bool updateInventory) {
drawSentence();
}
-#ifndef DISABLE_HE
+#ifdef ENABLE_HE
void ScummEngine_v72he::checkExecVerbs() {
VAR(VAR_MOUSE_STATE) = 0;
@@ -797,7 +797,7 @@ int ScummEngine::findVerbAtPos(int x, int y) const {
return 0;
}
-#ifndef DISABLE_SCUMM_7_8
+#ifdef ENABLE_SCUMM_7_8
void ScummEngine_v7::drawVerb(int verb, int mode) {
VerbSlot *vs;
diff --git a/engines/sky/module.mk b/engines/sky/module.mk
index 67b3b19e5d..9cab69ce9d 100644
--- a/engines/sky/module.mk
+++ b/engines/sky/module.mk
@@ -24,7 +24,7 @@ MODULE_OBJS := \
music/musicbase.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_SKY), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index ae1abc677d..e53458e33a 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -247,7 +247,11 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
return saveList;
}
-REGISTER_PLUGIN(SKY, PLUGIN_TYPE_ENGINE, SkyMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(SKY)
+ REGISTER_PLUGIN_DYNAMIC(SKY, PLUGIN_TYPE_ENGINE, SkyMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(SKY, PLUGIN_TYPE_ENGINE, SkyMetaEngine);
+#endif
namespace Sky {
diff --git a/engines/sword1/module.mk b/engines/sword1/module.mk
index 1ee62af853..87c0061c3c 100644
--- a/engines/sword1/module.mk
+++ b/engines/sword1/module.mk
@@ -21,7 +21,7 @@ MODULE_OBJS := \
text.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_SWORD1), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index f58f39c986..7372779199 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -187,7 +187,11 @@ PluginError SwordMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
return kNoError;
}
-REGISTER_PLUGIN(SWORD1, PLUGIN_TYPE_ENGINE, SwordMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(SWORD1)
+ REGISTER_PLUGIN_DYNAMIC(SWORD1, PLUGIN_TYPE_ENGINE, SwordMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(SWORD1, PLUGIN_TYPE_ENGINE, SwordMetaEngine);
+#endif
namespace Sword1 {
diff --git a/engines/sword2/module.mk b/engines/sword2/module.mk
index 3b21023fa8..c675b9561e 100644
--- a/engines/sword2/module.mk
+++ b/engines/sword2/module.mk
@@ -34,7 +34,7 @@ MODULE_OBJS := \
walker.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_SWORD2), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index d86c5b6c9e..0601d11791 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -180,7 +180,11 @@ PluginError Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) con
return kNoGameDataFoundError;
}
-REGISTER_PLUGIN(SWORD2, PLUGIN_TYPE_ENGINE, Sword2MetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(SWORD2)
+ REGISTER_PLUGIN_DYNAMIC(SWORD2, PLUGIN_TYPE_ENGINE, Sword2MetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(SWORD2, PLUGIN_TYPE_ENGINE, Sword2MetaEngine);
+#endif
namespace Sword2 {
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index faf997812c..d2798d7060 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -146,4 +146,8 @@ bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const Comm
return gd != 0;
}
-REGISTER_PLUGIN(TOUCHE, PLUGIN_TYPE_ENGINE, ToucheMetaEngine);
+#if PLUGIN_ENABLED_DYNAMIC(TOUCHE)
+ REGISTER_PLUGIN_DYNAMIC(TOUCHE, PLUGIN_TYPE_ENGINE, ToucheMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(TOUCHE, PLUGIN_TYPE_ENGINE, ToucheMetaEngine);
+#endif
diff --git a/engines/touche/module.mk b/engines/touche/module.mk
index 1cfd2d2929..30965e1155 100644
--- a/engines/touche/module.mk
+++ b/engines/touche/module.mk
@@ -12,7 +12,7 @@ MODULE_OBJS := \
touche.o
# This module can be built as a plugin
-ifdef BUILD_PLUGINS
+ifeq ($(ENABLE_TOUCHE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
diff --git a/ports.mk b/ports.mk
index fbaa504a5e..3d79384e19 100644
--- a/ports.mk
+++ b/ports.mk
@@ -18,7 +18,11 @@ install: all
$(INSTALL) -d "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
$(INSTALL) -c -m 644 "$(srcdir)/AUTHORS" "$(srcdir)/COPYING" "$(srcdir)/COPYRIGHT" "$(srcdir)/NEWS" "$(srcdir)/README" "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/scummvm/"
- $(INSTALL) -c -m 644 "$(srcdir)/gui/themes/modern.ini" "$(srcdir)/gui/themes/modern.zip" "$(srcdir)/gui/themes/classic080.ini" "$(DESTDIR)$(DATADIR)/scummvm/"
+ $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(DATADIR)/scummvm/"
+ifdef DYNAMIC_MODULES
+ $(INSTALL) -d "$(DESTDIR)$(LIBDIR)/scummvm/"
+ $(INSTALL) -c -s -m 644 $(DIST_FILES_PLUGINS) "$(DESTDIR)$(LIBDIR)/scummvm/"
+endif
uninstall:
rm -f "$(DESTDIR)$(BINDIR)/scummvm$(EXEEXT)"
@@ -26,6 +30,9 @@ uninstall:
rm -f "$(DESTDIR)$(PREFIX)/share/pixmaps/scummvm.xpm"
rm -rf "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
rm -rf "$(DESTDIR)$(DATADIR)/scummvm/"
+ifdef DYNAMIC_MODULES
+ rm -rf "$(DESTDIR)$(LIBDIR)/scummvm/"
+endif
deb:
ln -sf dists/debian;
@@ -140,8 +147,8 @@ osxsnap: bundle credits
# Windows specific
#
-scummvmico.o: icons/scummvm.ico
- $(WINDRES) dists/scummvm.rc scummvmico.o
+scummvmico.o: $(srcdir)/icons/scummvm.ico
+ $(WINDRES) -I$(srcdir) $(srcdir)/dists/scummvm.rc scummvmico.o
# Special target to create a win32 snapshot binary
win32dist: scummvm$(EXEEXT)
diff --git a/rules.mk b/rules.mk
index 2fea7ccb36..f2365f8928 100644
--- a/rules.mk
+++ b/rules.mk
@@ -51,6 +51,9 @@ PLUGIN:=
# Add to "plugins" target
plugins: $(PLUGIN-$(MODULE))
+# Add to the PLUGINS variable
+PLUGINS += $(PLUGIN-$(MODULE))
+
# Pseudo target for comfort, allows for "make common", "make gui" etc.
$(MODULE): $(PLUGIN-$(MODULE))
clean-plugins: clean-$(MODULE)
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 9108aa450b..53bc224180 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -68,7 +68,7 @@ static const MidiDriverDescription s_musicDrivers[] = {
#if defined(PALMOS_MODE)
# if defined(COMPILE_CLIE)
{"ypa1", "Yamaha Pa1", MD_YPA1, MDT_MIDI},
-# elif defined(COMPILE_ZODIAC) && (defined(DISABLE_SCUMM) || !defined(PALMOS_ARM))
+# elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM))
{"zodiac", "Tapwave Zodiac", MD_ZODIAC, MDT_MIDI},
# endif
#endif
@@ -239,7 +239,7 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) {
#if defined(PALMOS_MODE)
#if defined(COMPILE_CLIE)
case MD_YPA1: return MidiDriver_YamahaPa1_create();
-#elif defined(COMPILE_ZODIAC) && (defined(DISABLE_SCUMM) || !defined(PALMOS_ARM))
+#elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM))
case MD_ZODIAC: return MidiDriver_Zodiac_create();
#endif
#endif