aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--backends/events/dinguxsdl/dinguxsdl-events.cpp5
-rw-r--r--backends/events/gph/gph-events.cpp3
-rw-r--r--backends/events/linuxmotosdl/linuxmotosdl-events.cpp10
-rw-r--r--backends/events/maemosdl/maemosdl-events.cpp32
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.cpp10
-rw-r--r--backends/events/samsungtvsdl/samsungtvsdl-events.cpp11
-rw-r--r--backends/platform/android/events.cpp2
-rw-r--r--backends/platform/dingux/dingux.mk1
-rw-r--r--backends/platform/gph/caanoo-bundle.mk2
-rw-r--r--backends/platform/gph/gp2x-bundle.mk2
-rw-r--r--backends/platform/gph/gp2xwiz-bundle.mk2
-rw-r--r--backends/platform/linuxmoto/linuxmoto.mk4
-rwxr-xr-xbackends/platform/maemo/debian/rules1
-rw-r--r--backends/platform/n64/n64.mk1
-rw-r--r--backends/platform/sdl/ps3/ps3.mk27
-rw-r--r--backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg1
-rw-r--r--backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg1
-rw-r--r--backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg1
-rw-r--r--backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg1
-rw-r--r--backends/platform/tizen/form.cpp9
-rw-r--r--backends/platform/wii/osystem_events.cpp4
-rw-r--r--backends/platform/wii/wii.mk1
-rw-r--r--backends/vkeybd/packs/vkeybd_small.zipbin0 -> 87598 bytes
-rw-r--r--backends/vkeybd/packs/vkeybd_small/lowercase-symbols320x240.bmpbin0 -> 153654 bytes
-rw-r--r--backends/vkeybd/packs/vkeybd_small/lowercase320x240.bmpbin0 -> 153654 bytes
-rw-r--r--backends/vkeybd/packs/vkeybd_small/uppercase-symbols320x240.bmpbin0 -> 153654 bytes
-rw-r--r--backends/vkeybd/packs/vkeybd_small/uppercase320x240.bmpbin0 -> 153654 bytes
-rw-r--r--backends/vkeybd/packs/vkeybd_small/vkeybd_small.xml637
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp12
-rw-r--r--common/EventMapper.cpp30
-rwxr-xr-xconfigure2
-rw-r--r--devtools/create_project/scripts/postbuild.cmd3
-rw-r--r--devtools/scumm-md5.txt1
-rw-r--r--engines/agos/midi.cpp4
-rw-r--r--engines/fullpipe/gfx.cpp2
-rw-r--r--engines/fullpipe/mgm.cpp719
-rw-r--r--engines/fullpipe/mgm.h95
-rw-r--r--engines/fullpipe/module.mk1
-rw-r--r--engines/fullpipe/motion.cpp725
-rw-r--r--engines/fullpipe/motion.h68
-rw-r--r--engines/fullpipe/scene.cpp12
-rw-r--r--engines/mads/game.cpp36
-rw-r--r--engines/mads/game.h6
-rw-r--r--engines/mads/messages.cpp6
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp289
-rw-r--r--engines/mads/nebular/dialogs_nebular.h44
-rw-r--r--engines/mads/nebular/game_nebular.cpp6
-rw-r--r--engines/mads/nebular/nebular_scenes8.cpp2
-rw-r--r--engines/mads/scene.cpp2
-rw-r--r--engines/mads/screen.cpp19
-rw-r--r--engines/mads/sprites.cpp2
-rw-r--r--engines/neverhood/graphics.cpp10
-rw-r--r--engines/neverhood/modules/module1600_sprites.cpp3
-rw-r--r--engines/saga/detection_tables.h24
-rw-r--r--engines/scumm/scumm-md5.h3
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp2
-rw-r--r--graphics/transparent_surface.h8
-rw-r--r--ports.mk30
59 files changed, 1997 insertions, 940 deletions
diff --git a/README b/README
index b50d4a14d0..39f6223548 100644
--- a/README
+++ b/README
@@ -1268,6 +1268,9 @@ other games.
instead, or a multiple thereof
Alt-Enter - Toggles full screen/windowed
Alt-s - Make a screenshot (SDL backend only)
+ Ctrl-F7 - Open virtual keyboard (if enabled)
+ This can also be triggered by a long press
+ of the middle mouse button or wheel.
SCUMM:
Ctrl 0-9 and Alt 0-9 - Load and save game state
diff --git a/backends/events/dinguxsdl/dinguxsdl-events.cpp b/backends/events/dinguxsdl/dinguxsdl-events.cpp
index 46089a4fcd..6f9f2a7748 100644
--- a/backends/events/dinguxsdl/dinguxsdl-events.cpp
+++ b/backends/events/dinguxsdl/dinguxsdl-events.cpp
@@ -144,8 +144,9 @@ bool DINGUXSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
} else if (ev.key.keysym.sym == BUT_SELECT) { // virtual keyboard
- ev.key.keysym.sym = SDLK_F7;
-
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+#endif
} else if (ev.key.keysym.sym == BUT_START) { // F5, menu in some games
ev.key.keysym.sym = SDLK_F5;
diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp
index 90b6a2a29d..88fc97d3d1 100644
--- a/backends/events/gph/gph-events.cpp
+++ b/backends/events/gph/gph-events.cpp
@@ -348,8 +348,7 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_KEYDOWN;
if (BUTTON_STATE_L == true) {
#ifdef ENABLE_VKEYBD
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0);
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
#else
event.kbd.keycode = Common::KEYCODE_0;
event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0);
diff --git a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
index ce34662612..b0d443ff9f 100644
--- a/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
+++ b/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
@@ -73,7 +73,10 @@ bool LinuxmotoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
}
// VirtualKeyboard - Camera key
else if (ev.key.keysym.sym == SDLK_PAUSE) {
- ev.key.keysym.sym = SDLK_F7;
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+ return true;
+#endif
}
// Enter - mod+fire key
else if (ev.key.keysym.sym == SDLK_b) {
@@ -117,7 +120,10 @@ bool LinuxmotoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
}
// VirtualKeyboard - Right Soft key
else if (ev.key.keysym.sym == SDLK_F11) {
- ev.key.keysym.sym = SDLK_F7;
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+ return true;
+#endif
}
#endif
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index 5045363286..8b7514004a 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -86,12 +86,11 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
if (!model.hasHwKeyboard) {
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
- event.kbd.flags = 0;
- debug(9, "remapping to F7 down (virtual keyboard)");
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+ debug(9, "remapping to virtual keyboard trigger");
return true;
+#endif
} else {
// handled in keyup
}
@@ -102,12 +101,11 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
} else if (ev.key.keysym.sym == SDLK_F8) {
if (ev.key.keysym.mod & KMOD_CTRL) {
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
- event.kbd.flags = 0;
- debug(9, "remapping to F7 down (virtual keyboard)");
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+ debug(9, "remapping to virtual keyboard trigger");
return true;
+#endif
} else {
// handled in keyup
return true;
@@ -125,12 +123,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
if (!model.hasHwKeyboard) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
- event.kbd.flags = 0;
- debug(9, "remapping to F7 down (virtual keyboard)");
- return true;
+ // handled in keydown
} else {
bool currentState = ((OSystem_SDL *)g_system)->getGraphicsManager()->getFeatureState(OSystem::kFeatureFullscreenMode);
g_system->beginGFXTransaction();
@@ -146,12 +139,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
} else if (ev.key.keysym.sym == SDLK_F8) {
if (ev.key.keysym.mod & KMOD_CTRL) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
- event.kbd.flags = 0;
- debug(9, "remapping to F7 up (virtual keyboard)");
- return true;
+ // handled in key down
} else {
toggleClickMode();
debug(9, "remapping to click toggle");
diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
index 1a854436f1..0f6e01857b 100644
--- a/backends/events/ps3sdl/ps3sdl-events.cpp
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -72,9 +72,9 @@ bool PS3SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event)
event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0);
break;
case BTN_SELECT: // Virtual keyboard
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0);
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
+#endif
break;
case BTN_SQUARE: // Escape
event.type = Common::EVENT_KEYDOWN;
@@ -110,9 +110,7 @@ bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0);
break;
case BTN_SELECT: // Virtual keyboard
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0);
+ // Handled in key down
break;
case BTN_SQUARE: // Escape
event.type = Common::EVENT_KEYUP;
diff --git a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
index f5b919a060..61499b566d 100644
--- a/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
+++ b/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
@@ -38,10 +38,10 @@ bool SamsungTVSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.kbd.ascii = Common::ASCII_F5;
return true;
} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
+#ifdef ENABLE_VKEYBD
+ event.type = Common::EVENT_VIRTUAL_KEYBOARD;
return true;
+#endif
}
break;
}
@@ -54,11 +54,6 @@ bool SamsungTVSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = Common::ASCII_F5;
return true;
- } else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = Common::KEYCODE_F7;
- event.kbd.ascii = Common::ASCII_F7;
- return true;
}
break;
}
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index c60626ec36..8039981a92 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -263,7 +263,7 @@ void OSystem_Android::setupKeymapper() {
Action *act;
act = new Action(globalMap, "VIRT", "Display keyboard");
- act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0));
+ act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, KBD_CTRL));
mapper->addGlobalKeymap(globalMap);
diff --git a/backends/platform/dingux/dingux.mk b/backends/platform/dingux/dingux.mk
index e0aca42856..48a9347143 100644
--- a/backends/platform/dingux/dingux.mk
+++ b/backends/platform/dingux/dingux.mk
@@ -26,6 +26,7 @@ ifdef DYNAMIC_MODULES
$(STRIP) $(bundle_name)/plugins/*
endif
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/
$(CP) $(srcdir)/backends/platform/dingux/scummvm.gpe $(bundle_name)/
$(CP) $(srcdir)/backends/platform/dingux/README.DINGUX $(bundle_name)/
$(CP) $(srcdir)/backends/platform/dingux/scummvm.png $(bundle_name)/
diff --git a/backends/platform/gph/caanoo-bundle.mk b/backends/platform/gph/caanoo-bundle.mk
index 2cf8e62b37..9362daeba3 100644
--- a/backends/platform/gph/caanoo-bundle.mk
+++ b/backends/platform/gph/caanoo-bundle.mk
@@ -24,6 +24,7 @@ caanoo-bundle: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/scummvm/
$(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/$(EXECUTABLE)
@@ -55,6 +56,7 @@ caanoo-bundle-debug: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/scummvm/
$(INSTALL) -c -m 777 $(srcdir)/$(EXECUTABLE) $(bundle_name)/scummvm/$(EXECUTABLE)
diff --git a/backends/platform/gph/gp2x-bundle.mk b/backends/platform/gph/gp2x-bundle.mk
index 9fcb379e04..d430ae6ebe 100644
--- a/backends/platform/gph/gp2x-bundle.mk
+++ b/backends/platform/gph/gp2x-bundle.mk
@@ -21,6 +21,7 @@ gp2x-bundle: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)
$(STRIP) $(EXECUTABLE) -o $(bundle_name)/$(EXECUTABLE)
@@ -52,6 +53,7 @@ gp2x-bundle-debug: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)
$(INSTALL) -c -m 777 $(srcdir)/$(EXECUTABLE) $(bundle_name)/$(EXECUTABLE)
diff --git a/backends/platform/gph/gp2xwiz-bundle.mk b/backends/platform/gph/gp2xwiz-bundle.mk
index 4f49850813..36a720aae6 100644
--- a/backends/platform/gph/gp2xwiz-bundle.mk
+++ b/backends/platform/gph/gp2xwiz-bundle.mk
@@ -23,6 +23,7 @@ gp2xwiz-bundle: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/scummvm/
$(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/$(EXECUTABLE)
@@ -57,6 +58,7 @@ gp2xwiz-bundle-debug: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/engine-data
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/scummvm/
$(INSTALL) -c -m 777 $(srcdir)/$(EXECUTABLE) $(bundle_name)/scummvm/$(EXECUTABLE)
diff --git a/backends/platform/linuxmoto/linuxmoto.mk b/backends/platform/linuxmoto/linuxmoto.mk
index f64fadbccd..937fb4ef69 100644
--- a/backends/platform/linuxmoto/linuxmoto.mk
+++ b/backends/platform/linuxmoto/linuxmoto.mk
@@ -5,6 +5,7 @@ motoezx: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release/scummvm/
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip release/scummvm/
$(CP) $(srcdir)/dists/motoezx/* release/scummvm/
tar -C release -cvzf release/ScummVM-motoezx.pkg scummvm
$(RM) -r release/scummvm
@@ -16,6 +17,7 @@ motomagx-mpkg: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release/scummvm/
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip release/scummvm/
$(CP) $(srcdir)/dists/motomagx/mpkg/* release/scummvm/
tar -C release -cvzf release/ScummVM-motomagx.mpkg scummvm
$(RM) -r release/scummvm
@@ -26,6 +28,7 @@ motomagx-mgx: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release/scummvm/
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release/scummvm/
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip release/scummvm/
$(CP) $(srcdir)/dists/motomagx/mgx/* release/scummvm/
tar -C release -cvf release/ScummVM-motomagx.mgx scummvm
$(RM) -r release/scummvm
@@ -38,6 +41,7 @@ motomagx-pep: $(EXECUTABLE)
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release/pep/app
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release/pep/app
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release/pep/app
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip release/pep/app
tar -C release/pep -czvf release/ScummVM-motomagx.pep app description.ini scummvm_big_usr.png scummvm_small_usr.png
$(RM) -r release/pep
diff --git a/backends/platform/maemo/debian/rules b/backends/platform/maemo/debian/rules
index c713403876..2aa7f339c9 100755
--- a/backends/platform/maemo/debian/rules
+++ b/backends/platform/maemo/debian/rules
@@ -46,6 +46,7 @@ install: build
install -m0644 dists/pred.dic debian/scummvm/opt/scummvm/share
install -m0644 gui/themes/scummclassic.zip gui/themes/scummmodern.zip debian/scummvm/opt/scummvm/share
install -m0644 backends/vkeybd/packs/vkeybd_default.zip debian/scummvm/opt/scummvm/share
+ install -m0644 backends/vkeybd/packs/vkeybd_small.zip debian/scummvm/opt/scummvm/share
# for optified version we can also add engine datafiles
install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/tony.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share
diff --git a/backends/platform/n64/n64.mk b/backends/platform/n64/n64.mk
index 83ad405503..3198170788 100644
--- a/backends/platform/n64/n64.mk
+++ b/backends/platform/n64/n64.mk
@@ -20,6 +20,7 @@ ifdef DIST_FILES_ENGINEDATA
endif
$(CP) $(DIST_FILES_DOCS) $(bundle_name)/
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/romfs
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip $(bundle_name)/romfs
genromfs -f $(bundle_name)/romfs.img -d $(bundle_name)/romfs -V scummvmn64
mips64-objcopy $(EXECUTABLE) $(bundle_name)/scummvm.elf -O binary
cat $(N64SDK)/hkz-libn64/bootcode $(bundle_name)/scummvm.elf $(bundle_name)/romfs.img > scummvm.v64
diff --git a/backends/platform/sdl/ps3/ps3.mk b/backends/platform/sdl/ps3/ps3.mk
new file mode 100644
index 0000000000..a06409fc65
--- /dev/null
+++ b/backends/platform/sdl/ps3/ps3.mk
@@ -0,0 +1,27 @@
+ps3pkg: $(EXECUTABLE)
+ $(STRIP) $(EXECUTABLE)
+ sprxlinker $(EXECUTABLE)
+ mkdir -p ps3pkg/USRDIR/data/
+ mkdir -p ps3pkg/USRDIR/doc/
+ mkdir -p ps3pkg/USRDIR/saves/
+ make_self_npdrm "$(EXECUTABLE)" ps3pkg/USRDIR/EBOOT.BIN UP0001-SCUM12000_00-0000000000000000
+ cp $(DIST_FILES_THEMES) ps3pkg/USRDIR/data/
+ifdef DIST_FILES_ENGINEDATA
+ cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/
+endif
+ cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/
+ cp $(srcdir)/dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/
+ cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/
+ cp $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip ps3pkg/USRDIR/data/
+ cp $(srcdir)/dists/ps3/ICON0.PNG ps3pkg/
+ cp $(srcdir)/dists/ps3/PIC1.PNG ps3pkg/
+ sfo.py -f $(srcdir)/dists/ps3/sfo.xml ps3pkg/PARAM.SFO
+ pkg.py --contentid UP0001-SCUM12000_00-0000000000000000 ps3pkg/ scummvm-ps3.pkg
+
+ps3run: $(EXECUTABLE)
+ $(STRIP) $(EXECUTABLE)
+ sprxlinker $(EXECUTABLE)
+ make_self $(EXECUTABLE) $(EXECUTABLE).self
+ ps3load $(EXECUTABLE).self
+
+.PHONY: ps3pkg ps3run
diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
index 5f74bee1c7..2ba65c4571 100644
--- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
+++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
@@ -74,6 +74,7 @@
"..\..\..\..\dists\engine-data\toon.dat"-"c:\data\scummvm\toon.dat"
"..\..\..\..\dists\engine-data\wintermute.zip"-"c:\data\scummvm\wintermute.zip"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\data\scummvm\vkeybd_default.zip"
+"..\..\..\vkeybd\packs\vkeybd_small.zip"-"c:\data\scummvm\vkeybd_small.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\data\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\data\scummvm\scummmodern.zip"
diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
index 4ef085d600..2d2edf2803 100644
--- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
+++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
@@ -82,6 +82,7 @@
"..\..\..\..\dists\engine-data\toon.dat"-"c:\data\scummvm\toon.dat"
"..\..\..\..\dists\engine-data\wintermute.zip"-"c:\data\scummvm\wintermute.zip"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\data\scummvm\vkeybd_default.zip"
+"..\..\..\vkeybd\packs\vkeybd_small.zip"-"c:\data\scummvm\vkeybd_small.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\data\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\data\scummvm\scummmodern.zip"
diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
index b4f1cfdd5c..5db65e8e5c 100644
--- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
+++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
@@ -64,6 +64,7 @@
"..\..\..\..\dists\engine-data\teenagent.dat"-"c:\shared\scummvm\teenagent.dat"
"..\..\..\..\dists\engine-data\toon.dat"-"c:\shared\scummvm\toon.dat"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\shared\scummvm\vkeybd_default.zip"
+"..\..\..\vkeybd\packs\vkeybd_small.zip"-"c:\shared\scummvm\vkeybd_small.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\shared\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\shared\scummvm\scummmodern.zip"
diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
index 722e23a1b8..d783bd51bd 100644
--- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
+++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
@@ -72,6 +72,7 @@
"..\..\..\..\dists\engine-data\teenagent.dat"-"c:\shared\scummvm\teenagent.dat"
"..\..\..\..\dists\engine-data\toon.dat"-"c:\shared\scummvm\toon.dat"
"..\..\..\vkeybd\packs\vkeybd_default.zip"-"c:\shared\scummvm\vkeybd_default.zip"
+"..\..\..\vkeybd\packs\vkeybd_small.zip"-"c:\shared\scummvm\vkeybd_small.zip"
"..\..\..\..\gui\themes\translations.dat"-"c:\shared\scummvm\translations.dat"
"..\..\..\..\gui\themes\scummmodern.zip"-"c:\shared\scummvm\scummmodern.zip"
diff --git a/backends/platform/tizen/form.cpp b/backends/platform/tizen/form.cpp
index 3f7b918102..568829dc96 100644
--- a/backends/platform/tizen/form.cpp
+++ b/backends/platform/tizen/form.cpp
@@ -338,7 +338,14 @@ void TizenAppForm::showKeypad() {
// display the soft keyboard
if (_state == kActiveState) {
_buttonState = kLeftButton;
- pushKey(Common::KEYCODE_F7);
+
+ Common::Event e;
+ e.type = Common::EVENT_VIRTUAL_KEYBOARD;
+ if (_eventQueueLock) {
+ _eventQueueLock->Acquire();
+ _eventQueue.push(e);
+ _eventQueueLock->Release();
+ }
}
}
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
index 2da1d80917..0563639de3 100644
--- a/backends/platform/wii/osystem_events.cpp
+++ b/backends/platform/wii/osystem_events.cpp
@@ -357,8 +357,8 @@ bool OSystem_Wii::pollEvent(Common::Event &event) {
PAD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.', flags);
PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, flags);
PAD_EVENT(PADS_UP, Common::KEYCODE_LSHIFT, 0, flags);
- PAD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, flags);
- //PAD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, 0);
+ PAD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, Common::KBD_CTRL);
+ //PAD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, Common::KBD_CTRL);
if ((bd | bu) & (PADS_A | PADS_B)) {
if (bd & PADS_A)
diff --git a/backends/platform/wii/wii.mk b/backends/platform/wii/wii.mk
index 99ef46338c..62a8900d9a 100644
--- a/backends/platform/wii/wii.mk
+++ b/backends/platform/wii/wii.mk
@@ -43,6 +43,7 @@ ifneq ($(DIST_FILES_ENGINEDATA),)
$(CP) $(DIST_FILES_ENGINEDATA) wiidist/scummvm/
endif
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip wiidist/scummvm/
+ $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_small.zip wiidist/scummvm/
wiiloaddist: wiidist
cd wiidist && zip -9r scummvm.zip scummvm/
diff --git a/backends/vkeybd/packs/vkeybd_small.zip b/backends/vkeybd/packs/vkeybd_small.zip
new file mode 100644
index 0000000000..d1c7fc75e5
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small.zip
Binary files differ
diff --git a/backends/vkeybd/packs/vkeybd_small/lowercase-symbols320x240.bmp b/backends/vkeybd/packs/vkeybd_small/lowercase-symbols320x240.bmp
new file mode 100644
index 0000000000..08d40a0373
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small/lowercase-symbols320x240.bmp
Binary files differ
diff --git a/backends/vkeybd/packs/vkeybd_small/lowercase320x240.bmp b/backends/vkeybd/packs/vkeybd_small/lowercase320x240.bmp
new file mode 100644
index 0000000000..25579234bb
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small/lowercase320x240.bmp
Binary files differ
diff --git a/backends/vkeybd/packs/vkeybd_small/uppercase-symbols320x240.bmp b/backends/vkeybd/packs/vkeybd_small/uppercase-symbols320x240.bmp
new file mode 100644
index 0000000000..76a7f51839
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small/uppercase-symbols320x240.bmp
Binary files differ
diff --git a/backends/vkeybd/packs/vkeybd_small/uppercase320x240.bmp b/backends/vkeybd/packs/vkeybd_small/uppercase320x240.bmp
new file mode 100644
index 0000000000..96ce1adbe4
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small/uppercase320x240.bmp
Binary files differ
diff --git a/backends/vkeybd/packs/vkeybd_small/vkeybd_small.xml b/backends/vkeybd/packs/vkeybd_small/vkeybd_small.xml
new file mode 100644
index 0000000000..20e91fe2fc
--- /dev/null
+++ b/backends/vkeybd/packs/vkeybd_small/vkeybd_small.xml
@@ -0,0 +1,637 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<keyboard initial_mode="lowercase" v_align="bottom" h_align="center">
+<!-- coords key = "start x, start y, end x, end y" -->
+ <!-- Lowercase -->
+ <mode name="lowercase" resolutions="320x240">
+ <layout resolution="320x240" bitmap="lowercase320x240.bmp" transparent_color="255,0,255">
+ <map>
+ <area shape="rect" coords="13,8,306,20" target="display_area" />
+ <area shape="rect" coords="9,26,25,42" target="esc" />
+ <area shape="rect" coords="50,25,67,43" target="f2" />
+ <area shape="rect" coords="29,24,46,43" target="f1" />
+ <area shape="rect" coords="71,26,88,44" target="f3" />
+ <area shape="rect" coords="90,25,107,43" target="f4" />
+ <area shape="rect" coords="111,26,128,44" target="f5" />
+ <area shape="rect" coords="132,26,149,44" target="f6" />
+ <area shape="rect" coords="153,25,170,44" target="f7" />
+ <area shape="rect" coords="173,26,190,44" target="f8" />
+ <area shape="rect" coords="194,24,211,43" target="f9" />
+ <area shape="rect" coords="215,26,231,44" target="f10" />
+ <area shape="rect" coords="235,26,253,43" target="f11" />
+ <area shape="rect" coords="255,26,272,45" target="f12" />
+ <area shape="rect" coords="276,27,310,43" target="del" />
+ <area shape="rect" coords="276,46,299,65" target="delete" />
+ <area shape="rect" coords="300,46,311,65" target="backspace" />
+ <area shape="rect" coords="8,68,32,85" target="tab" />
+ <area shape="rect" coords="36,68,53,85" target="q" />
+ <area shape="rect" coords="57,68,75,86" target="w" />
+ <area shape="rect" coords="78,67,94,85" target="e" />
+ <area shape="rect" coords="98,67,115,85" target="r" />
+ <area shape="rect" coords="119,67,136,85" target="t" />
+ <area shape="rect" coords="141,68,158,86" target="y" />
+ <area shape="rect" coords="161,67,179,86" target="u" />
+ <area shape="rect" coords="182,67,199,86" target="i" />
+ <area shape="rect" coords="202,67,220,85" target="o" />
+ <area shape="rect" coords="223,68,240,86" target="p" />
+ <area shape="rect" coords="44,88,63,107" target="a" />
+ <area shape="rect" coords="65,88,84,106" target="s" />
+ <area shape="rect" coords="86,89,104,107" target="d" />
+ <area shape="rect" coords="107,89,124,107" target="f" />
+ <area shape="rect" coords="128,89,145,107" target="g" />
+ <area shape="rect" coords="149,88,165,107" target="h" />
+ <area shape="rect" coords="169,89,186,107" target="j" />
+ <area shape="rect" coords="189,89,207,107" target="k" />
+ <area shape="rect" coords="210,89,228,107" target="l" />
+ <area shape="rect" coords="273,89,311,106" target="enter" />
+ <area shape="rect" coords="9,110,50,127" target="shift" />
+ <area shape="rect" coords="8,89,41,106" target="caps" />
+ <area shape="rect" coords="58,110,75,128" target="z" />
+ <area shape="rect" coords="79,110,96,128" target="x" />
+ <area shape="rect" coords="99,109,116,127" target="c" />
+ <area shape="rect" coords="120,110,138,128" target="v" />
+ <area shape="rect" coords="141,109,157,127" target="b" />
+ <area shape="rect" coords="162,110,179,128" target="n" />
+ <area shape="rect" coords="182,110,199,128" target="m" />
+ <area shape="rect" coords="271,109,311,128" target="symbols" />
+ <area shape="rect" coords="9,130,33,148" target="ctrl" />
+ <area shape="rect" coords="38,130,61,147" target="alt" />
+ <area shape="rect" coords="67,130,262,148" target="space" />
+ <area shape="rect" coords="8,47,26,64" target="|" />
+ <area shape="rect" coords="28,47,45,64" target="1" />
+ <area shape="rect" coords="50,47,67,65" target="2" />
+ <area shape="rect" coords="70,46,87,65" target="3" />
+ <area shape="rect" coords="91,46,108,64" target="4" />
+ <area shape="rect" coords="111,46,129,65" target="5" />
+ <area shape="rect" coords="132,47,149,65" target="6" />
+ <area shape="rect" coords="152,47,170,64" target="7" />
+ <area shape="rect" coords="174,46,191,63" target="8" />
+ <area shape="rect" coords="194,47,211,65" target="9" />
+ <area shape="rect" coords="215,46,232,64" target="0" />
+ <area shape="rect" coords="235,47,252,65" target="-" />
+ <area shape="rect" coords="255,46,272,65" target="=" />
+ <area shape="rect" coords="244,68,261,86" target="[" />
+ <area shape="rect" coords="264,67,282,86" target="]" />
+ <area shape="rect" coords="284,68,309,86" target="#" />
+ <area shape="rect" coords="231,88,249,106" target=";" />
+ <area shape="rect" coords="251,89,269,107" target="’" />
+ <area shape="rect" coords="202,110,219,128" target="," />
+ <area shape="rect" coords="223,110,241,128" target="." />
+ <area shape="rect" coords="243,110,261,128" target="/" />
+ <area shape="rect" coords="269,131,288,150" target="ok" />
+ <area shape="rect" coords="292,131,311,150" target="cancel" />
+ </map>
+ </layout>
+ <event name="esc" type="key" code="27" ascii="27" modifiers="" />
+ <event name="f1" type="key" code="282" ascii="315" modifiers="" />
+ <event name="f2" type="key" code="283" ascii="316" modifiers="" />
+ <event name="f3" type="key" code="284" ascii="317" modifiers="" />
+ <event name="f4" type="key" code="285" ascii="318" modifiers="" />
+ <event name="f5" type="key" code="286" ascii="319" modifiers="" />
+ <event name="f6" type="key" code="287" ascii="320" modifiers="" />
+ <event name="f7" type="key" code="288" ascii="321" modifiers="" />
+ <event name="f8" type="key" code="289" ascii="322" modifiers="" />
+ <event name="f9" type="key" code="290" ascii="323" modifiers="" />
+ <event name="f10" type="key" code="291" ascii="324" modifiers="" />
+ <event name="f11" type="key" code="292" ascii="325" modifiers="" />
+ <event name="f12" type="key" code="293" ascii="326" modifiers="" />
+ <event name="del" type="key" code="127" ascii="0" modifiers="" />
+ <event name="ctrl" type="modifier" modifiers="ctrl" />
+ <event name="alt" type="modifier" modifiers="alt" />
+ <event name="shift" type="modifier" modifiers="shift" />
+ <event name="caps" type="switch_mode" mode="uppercase" />
+ <event name="symbols" type="switch_mode" mode="lowercasesymbols" />
+ <event name="backspace" type="key" code="8" ascii="8" modifiers="" />
+ <event name="enter" type="key" code="13" ascii="13" modifiers="" />
+ <event name="|" type="key" code="124" ascii="124" modifiers="" />
+ <event name="-" type="key" code="45" ascii="45" modifiers="" />
+ <event name="=" type="key" code="61" ascii="61" modifiers="" />
+ <event name="[" type="key" code="91" ascii="91" modifiers="" />
+ <event name="]" type="key" code="93" ascii="93" modifiers="" />
+ <event name="#" type="key" code="35" ascii="35" modifiers="" />
+ <event name=";" type="key" code="59" ascii="59" modifiers="" />
+ <event name="'" type="key" code="39" ascii="39" modifiers="" />
+ <event name="," type="key" code="44" ascii="44" modifiers="" />
+ <event name="." type="key" code="46" ascii="46" modifiers="" />
+ <event name="/" type="key" code="47" ascii="47" modifiers="" />
+ <event name="space" type="key" code="32" ascii="32" modifiers="" />
+ <event name="tab" type="key" code="9" ascii="9" modifiers="" />
+ <event name="a" type="key" code="97" ascii="97" modifiers="" />
+ <event name="b" type="key" code="98" ascii="98" modifiers="" />
+ <event name="c" type="key" code="99" ascii="99" modifiers="" />
+ <event name="d" type="key" code="100" ascii="100" modifiers="" />
+ <event name="e" type="key" code="101" ascii="101" modifiers="" />
+ <event name="f" type="key" code="102" ascii="102" modifiers="" />
+ <event name="g" type="key" code="103" ascii="103" modifiers="" />
+ <event name="h" type="key" code="104" ascii="104" modifiers="" />
+ <event name="i" type="key" code="105" ascii="105" modifiers="" />
+ <event name="j" type="key" code="106" ascii="106" modifiers="" />
+ <event name="k" type="key" code="107" ascii="107" modifiers="" />
+ <event name="l" type="key" code="108" ascii="108" modifiers="" />
+ <event name="m" type="key" code="109" ascii="109" modifiers="" />
+ <event name="n" type="key" code="110" ascii="110" modifiers="" />
+ <event name="o" type="key" code="111" ascii="111" modifiers="" />
+ <event name="p" type="key" code="112" ascii="112" modifiers="" />
+ <event name="q" type="key" code="113" ascii="113" modifiers="" />
+ <event name="r" type="key" code="114" ascii="114" modifiers="" />
+ <event name="s" type="key" code="115" ascii="115" modifiers="" />
+ <event name="t" type="key" code="116" ascii="116" modifiers="" />
+ <event name="u" type="key" code="117" ascii="117" modifiers="" />
+ <event name="v" type="key" code="118" ascii="118" modifiers="" />
+ <event name="w" type="key" code="119" ascii="119" modifiers="" />
+ <event name="x" type="key" code="120" ascii="120" modifiers="" />
+ <event name="y" type="key" code="121" ascii="121" modifiers="" />
+ <event name="z" type="key" code="122" ascii="122" modifiers="" />
+ <event name="0" type="key" code="48" ascii="48" modifiers="" />
+ <event name="1" type="key" code="49" ascii="49" modifiers="" />
+ <event name="2" type="key" code="50" ascii="50" modifiers="" />
+ <event name="3" type="key" code="51" ascii="51" modifiers="" />
+ <event name="4" type="key" code="52" ascii="52" modifiers="" />
+ <event name="5" type="key" code="53" ascii="53" modifiers="" />
+ <event name="6" type="key" code="54" ascii="54" modifiers="" />
+ <event name="7" type="key" code="55" ascii="55" modifiers="" />
+ <event name="8" type="key" code="56" ascii="56" modifiers="" />
+ <event name="9" type="key" code="57" ascii="57" modifiers="" />
+ <event name="ok" type="submit" />
+ <event name="cancel" type="cancel" />
+ <event name="quit" type="submit" />
+ <event name="delete" type="delete" />
+ </mode>
+
+ <!-- Uppercase -->
+ <mode name="uppercase" resolutions="320x240">
+ <layout resolution="320x240" bitmap="uppercase320x240.bmp" transparent_color="255,0,255">
+ <map>
+ <area shape="rect" coords="13,8,306,20" target="display_area" />
+ <area shape="rect" coords="9,26,25,42" target="esc" />
+ <area shape="rect" coords="50,25,67,43" target="f2" />
+ <area shape="rect" coords="29,24,46,43" target="f1" />
+ <area shape="rect" coords="71,26,88,44" target="f3" />
+ <area shape="rect" coords="90,25,107,43" target="f4" />
+ <area shape="rect" coords="111,26,128,44" target="f5" />
+ <area shape="rect" coords="132,26,149,44" target="f6" />
+ <area shape="rect" coords="153,25,170,44" target="f7" />
+ <area shape="rect" coords="173,26,190,44" target="f8" />
+ <area shape="rect" coords="194,24,211,43" target="f9" />
+ <area shape="rect" coords="215,26,231,44" target="f10" />
+ <area shape="rect" coords="235,26,253,43" target="f11" />
+ <area shape="rect" coords="255,26,272,45" target="f12" />
+ <area shape="rect" coords="276,27,310,43" target="del" />
+ <area shape="rect" coords="276,46,299,65" target="delete" />
+ <area shape="rect" coords="300,46,311,65" target="backspace" />
+ <area shape="rect" coords="8,68,32,85" target="tab" />
+ <area shape="rect" coords="36,68,53,85" target="Q" />
+ <area shape="rect" coords="57,68,75,86" target="W" />
+ <area shape="rect" coords="78,67,94,85" target="E" />
+ <area shape="rect" coords="98,67,115,85" target="R" />
+ <area shape="rect" coords="119,67,136,85" target="T" />
+ <area shape="rect" coords="141,68,158,86" target="Y" />
+ <area shape="rect" coords="161,67,179,86" target="U" />
+ <area shape="rect" coords="182,67,199,86" target="I" />
+ <area shape="rect" coords="202,67,220,85" target="O" />
+ <area shape="rect" coords="223,68,240,86" target="P" />
+ <area shape="rect" coords="44,88,63,107" target="A" />
+ <area shape="rect" coords="65,88,84,106" target="S" />
+ <area shape="rect" coords="86,89,104,107" target="D" />
+ <area shape="rect" coords="107,89,124,107" target="F" />
+ <area shape="rect" coords="128,89,145,107" target="G" />
+ <area shape="rect" coords="149,88,165,107" target="H" />
+ <area shape="rect" coords="169,89,186,107" target="J" />
+ <area shape="rect" coords="189,89,207,107" target="K" />
+ <area shape="rect" coords="210,89,228,107" target="L" />
+ <area shape="rect" coords="273,89,311,106" target="enter" />
+ <area shape="rect" coords="9,110,50,127" target="shift" />
+ <area shape="rect" coords="8,89,41,106" target="caps" />
+ <area shape="rect" coords="58,110,75,128" target="Z" />
+ <area shape="rect" coords="79,110,96,128" target="X" />
+ <area shape="rect" coords="99,109,116,127" target="C" />
+ <area shape="rect" coords="120,110,138,128" target="V" />
+ <area shape="rect" coords="141,109,157,127" target="B" />
+ <area shape="rect" coords="162,110,179,128" target="N" />
+ <area shape="rect" coords="182,110,199,128" target="M" />
+ <area shape="rect" coords="271,109,311,128" target="symbols" />
+ <area shape="rect" coords="9,130,33,148" target="ctrl" />
+ <area shape="rect" coords="38,130,61,147" target="alt" />
+ <area shape="rect" coords="67,130,262,148" target="space" />
+ <area shape="rect" coords="8,47,26,64" target="|" />
+ <area shape="rect" coords="28,47,45,64" target="1" />
+ <area shape="rect" coords="50,47,67,65" target="2" />
+ <area shape="rect" coords="70,46,87,65" target="3" />
+ <area shape="rect" coords="91,46,108,64" target="4" />
+ <area shape="rect" coords="111,46,129,65" target="5" />
+ <area shape="rect" coords="132,47,149,65" target="6" />
+ <area shape="rect" coords="152,47,170,64" target="7" />
+ <area shape="rect" coords="174,46,191,63" target="8" />
+ <area shape="rect" coords="194,47,211,65" target="9" />
+ <area shape="rect" coords="215,46,232,64" target="0" />
+ <area shape="rect" coords="235,47,252,65" target="-" />
+ <area shape="rect" coords="255,46,272,65" target="=" />
+ <area shape="rect" coords="244,68,261,86" target="[" />
+ <area shape="rect" coords="264,67,282,86" target="]" />
+ <area shape="rect" coords="284,68,309,86" target="#" />
+ <area shape="rect" coords="231,88,249,106" target=";" />
+ <area shape="rect" coords="251,89,269,107" target="’" />
+ <area shape="rect" coords="202,110,219,128" target="," />
+ <area shape="rect" coords="223,110,241,128" target="." />
+ <area shape="rect" coords="243,110,261,128" target="/" />
+ <area shape="rect" coords="269,131,288,150" target="ok" />
+ <area shape="rect" coords="292,131,311,150" target="cancel" />
+ </map>
+ </layout>
+ <event name="esc" type="key" code="27" ascii="27" modifiers="" />
+ <event name="f1" type="key" code="282" ascii="315" modifiers="" />
+ <event name="f2" type="key" code="283" ascii="316" modifiers="" />
+ <event name="f3" type="key" code="284" ascii="317" modifiers="" />
+ <event name="f4" type="key" code="285" ascii="318" modifiers="" />
+ <event name="f5" type="key" code="286" ascii="319" modifiers="" />
+ <event name="f6" type="key" code="287" ascii="320" modifiers="" />
+ <event name="f7" type="key" code="288" ascii="321" modifiers="" />
+ <event name="f8" type="key" code="289" ascii="322" modifiers="" />
+ <event name="f9" type="key" code="290" ascii="323" modifiers="" />
+ <event name="f10" type="key" code="291" ascii="324" modifiers="" />
+ <event name="f11" type="key" code="292" ascii="325" modifiers="" />
+ <event name="f12" type="key" code="293" ascii="326" modifiers="" />
+ <event name="del" type="key" code="127" ascii="0" modifiers="" />
+ <event name="ctrl" type="modifier" modifiers="ctrl" />
+ <event name="alt" type="modifier" modifiers="alt" />
+ <event name="shift" type="modifier" modifiers="shift" />
+ <event name="caps" type="switch_mode" mode="lowercase" />
+ <event name="symbols" type="switch_mode" mode="uppercasesymbols" />
+ <event name="backspace" type="key" code="8" ascii="8" modifiers="" />
+ <event name="enter" type="key" code="13" ascii="13" modifiers="" />
+ <event name="|" type="key" code="124" ascii="124" modifiers="" />
+ <event name="-" type="key" code="45" ascii="45" modifiers="" />
+ <event name="=" type="key" code="61" ascii="61" modifiers="" />
+ <event name="[" type="key" code="91" ascii="91" modifiers="" />
+ <event name="]" type="key" code="93" ascii="93" modifiers="" />
+ <event name="#" type="key" code="35" ascii="35" modifiers="" />
+ <event name=";" type="key" code="59" ascii="59" modifiers="" />
+ <event name="'" type="key" code="39" ascii="39" modifiers="" />
+ <event name="," type="key" code="44" ascii="44" modifiers="" />
+ <event name="." type="key" code="46" ascii="46" modifiers="" />
+ <event name="/" type="key" code="47" ascii="47" modifiers="" />
+ <event name="space" type="key" code="32" ascii="32" modifiers="" />
+ <event name="tab" type="key" code="9" ascii="9" modifiers="" />
+ <event name="A" type="key" code="97" ascii="65" modifiers="shift" />
+ <event name="B" type="key" code="98" ascii="66" modifiers="shift" />
+ <event name="C" type="key" code="99" ascii="67" modifiers="shift" />
+ <event name="D" type="key" code="100" ascii="68" modifiers="shift" />
+ <event name="E" type="key" code="101" ascii="69" modifiers="shift" />
+ <event name="F" type="key" code="102" ascii="70" modifiers="shift" />
+ <event name="G" type="key" code="103" ascii="71" modifiers="shift" />
+ <event name="H" type="key" code="104" ascii="72" modifiers="shift" />
+ <event name="I" type="key" code="105" ascii="73" modifiers="shift" />
+ <event name="J" type="key" code="106" ascii="74" modifiers="shift" />
+ <event name="K" type="key" code="107" ascii="75" modifiers="shift" />
+ <event name="L" type="key" code="108" ascii="76" modifiers="shift" />
+ <event name="M" type="key" code="109" ascii="77" modifiers="shift" />
+ <event name="N" type="key" code="110" ascii="78" modifiers="shift" />
+ <event name="O" type="key" code="111" ascii="79" modifiers="shift" />
+ <event name="P" type="key" code="112" ascii="80" modifiers="shift" />
+ <event name="Q" type="key" code="113" ascii="81" modifiers="shift" />
+ <event name="R" type="key" code="114" ascii="82" modifiers="shift" />
+ <event name="S" type="key" code="115" ascii="83" modifiers="shift" />
+ <event name="T" type="key" code="116" ascii="84" modifiers="shift" />
+ <event name="U" type="key" code="117" ascii="85" modifiers="shift" />
+ <event name="V" type="key" code="118" ascii="86" modifiers="shift" />
+ <event name="W" type="key" code="119" ascii="87" modifiers="shift" />
+ <event name="X" type="key" code="120" ascii="88" modifiers="shift" />
+ <event name="Y" type="key" code="121" ascii="89" modifiers="shift" />
+ <event name="Z" type="key" code="122" ascii="90" modifiers="shift" />
+ <event name="0" type="key" code="48" ascii="48" modifiers="" />
+ <event name="1" type="key" code="49" ascii="49" modifiers="" />
+ <event name="2" type="key" code="50" ascii="50" modifiers="" />
+ <event name="3" type="key" code="51" ascii="51" modifiers="" />
+ <event name="4" type="key" code="52" ascii="52" modifiers="" />
+ <event name="5" type="key" code="53" ascii="53" modifiers="" />
+ <event name="6" type="key" code="54" ascii="54" modifiers="" />
+ <event name="7" type="key" code="55" ascii="55" modifiers="" />
+ <event name="8" type="key" code="56" ascii="56" modifiers="" />
+ <event name="9" type="key" code="57" ascii="57" modifiers="" />
+ <event name="ok" type="submit" />
+ <event name="cancel" type="cancel" />
+ <event name="quit" type="submit" />
+ <event name="delete" type="delete" />
+ </mode>
+
+ <!-- Lowercase Symbols -->
+ <mode name="lowercasesymbols" resolutions="320x240">
+ <layout resolution="320x240" bitmap="lowercase-symbols320x240.bmp" transparent_color="255,0,255">
+ <map>
+ <area shape="rect" coords="13,8,306,20" target="display_area" />
+ <area shape="rect" coords="9,26,25,42" target="esc" />
+ <area shape="rect" coords="50,25,67,43" target="f2" />
+ <area shape="rect" coords="29,24,46,43" target="f1" />
+ <area shape="rect" coords="71,26,88,44" target="f3" />
+ <area shape="rect" coords="90,25,107,43" target="f4" />
+ <area shape="rect" coords="111,26,128,44" target="f5" />
+ <area shape="rect" coords="132,26,149,44" target="f6" />
+ <area shape="rect" coords="153,25,170,44" target="f7" />
+ <area shape="rect" coords="173,26,190,44" target="f8" />
+ <area shape="rect" coords="194,24,211,43" target="f9" />
+ <area shape="rect" coords="215,26,231,44" target="f10" />
+ <area shape="rect" coords="235,26,253,43" target="f11" />
+ <area shape="rect" coords="255,26,272,45" target="f12" />
+ <area shape="rect" coords="276,27,310,43" target="del" />
+ <area shape="rect" coords="8,47,26,64" target="¬" />
+ <area shape="rect" coords="28,47,45,64" target="!" />
+ <area shape="rect" coords="50,47,67,65" target="quote" />
+ <area shape="rect" coords="70,46,87,65" target="£" />
+ <area shape="rect" coords="91,46,108,64" target="$" />
+ <area shape="rect" coords="111,46,129,65" target="%" />
+ <area shape="rect" coords="132,47,149,65" target="^" />
+ <area shape="rect" coords="152,47,170,64" target="&amp;" />
+ <area shape="rect" coords="174,46,191,63" target="*" />
+ <area shape="rect" coords="194,47,211,65" target="(" />
+ <area shape="rect" coords="215,46,232,64" target=")" />
+ <area shape="rect" coords="235,47,252,65" target="_" />
+ <area shape="rect" coords="255,46,272,65" target="+" />
+ <area shape="rect" coords="276,46,299,65" target="delete" />
+ <area shape="rect" coords="300,46,311,65" target="backspace" />
+ <area shape="rect" coords="8,68,32,85" target="tab" />
+ <area shape="rect" coords="36,68,53,85" target="q" />
+ <area shape="rect" coords="57,68,75,86" target="w" />
+ <area shape="rect" coords="78,67,94,85" target="e" />
+ <area shape="rect" coords="98,67,115,85" target="r" />
+ <area shape="rect" coords="119,67,136,85" target="t" />
+ <area shape="rect" coords="141,68,158,86" target="y" />
+ <area shape="rect" coords="161,67,179,86" target="u" />
+ <area shape="rect" coords="182,67,199,86" target="i" />
+ <area shape="rect" coords="202,67,220,85" target="o" />
+ <area shape="rect" coords="223,68,240,86" target="p" />
+ <area shape="rect" coords="244,68,261,86" target="{" />
+ <area shape="rect" coords="264,67,282,86" target="}" />
+ <area shape="rect" coords="284,68,309,86" target="~" />
+ <area shape="rect" coords="8,89,41,106" target="caps" />
+ <area shape="rect" coords="44,88,63,107" target="a" />
+ <area shape="rect" coords="65,88,84,106" target="s" />
+ <area shape="rect" coords="86,89,104,107" target="d" />
+ <area shape="rect" coords="107,89,124,107" target="f" />
+ <area shape="rect" coords="128,89,145,107" target="g" />
+ <area shape="rect" coords="149,88,165,107" target="h" />
+ <area shape="rect" coords="169,89,186,107" target="j" />
+ <area shape="rect" coords="189,89,207,107" target="k" />
+ <area shape="rect" coords="210,89,228,107" target="l" />
+ <area shape="rect" coords="231,88,249,106" target=":" />
+ <area shape="rect" coords="251,89,269,107" target="@" />
+ <area shape="rect" coords="273,89,311,106" target="enter" />
+ <area shape="rect" coords="9,110,50,127" target="shift" />
+ <area shape="rect" coords="58,110,75,128" target="z" />
+ <area shape="rect" coords="79,110,96,128" target="x" />
+ <area shape="rect" coords="99,109,116,127" target="c" />
+ <area shape="rect" coords="120,110,138,128" target="v" />
+ <area shape="rect" coords="141,109,157,127" target="b" />
+ <area shape="rect" coords="162,110,179,128" target="n" />
+ <area shape="rect" coords="182,110,199,128" target="m" />
+ <area shape="rect" coords="202,110,219,128" target="&lt;" />
+ <area shape="rect" coords="223,110,241,128" target="&gt;" />
+ <area shape="rect" coords="243,110,261,128" target="?" />
+ <area shape="rect" coords="271,109,311,128" target="symbols" />
+ <area shape="rect" coords="9,130,33,148" target="ctrl" />
+ <area shape="rect" coords="38,130,61,147" target="alt" />
+ <area shape="rect" coords="67,130,262,148" target="space" />
+ <area shape="rect" coords="269,131,288,150" target="ok" />
+ <area shape="rect" coords="292,131,311,150" target="cancel" />
+ </map>
+ </layout>
+ <event name="esc" type="key" code="27" ascii="27" modifiers="" />
+ <event name="f1" type="key" code="282" ascii="315" modifiers="" />
+ <event name="f2" type="key" code="283" ascii="316" modifiers="" />
+ <event name="f3" type="key" code="284" ascii="317" modifiers="" />
+ <event name="f4" type="key" code="285" ascii="318" modifiers="" />
+ <event name="f5" type="key" code="286" ascii="319" modifiers="" />
+ <event name="f6" type="key" code="287" ascii="320" modifiers="" />
+ <event name="f7" type="key" code="288" ascii="321" modifiers="" />
+ <event name="f8" type="key" code="289" ascii="322" modifiers="" />
+ <event name="f9" type="key" code="290" ascii="323" modifiers="" />
+ <event name="f10" type="key" code="291" ascii="324" modifiers="" />
+ <event name="f11" type="key" code="292" ascii="325" modifiers="" />
+ <event name="f12" type="key" code="293" ascii="326" modifiers="" />
+ <event name="del" type="key" code="127" ascii="0" modifiers="" />
+ <event name="ctrl" type="modifier" modifiers="ctrl" />
+ <event name="alt" type="modifier" modifiers="alt" />
+ <event name="shift" type="modifier" modifiers="shift" />
+ <event name="symbols" type="switch_mode" mode="lowercase" />
+ <event name="caps" type="switch_mode" mode="uppercasesymbols" />
+ <event name="backspace" type="key" code="8" ascii="8" modifiers="" />
+ <event name="enter" type="key" code="13" ascii="13" modifiers="" />
+ <event name="quote" type="key" code="34" ascii="34" modifiers="" />
+ <event name="£" type="key" code="163" ascii="163" modifiers="" />
+ <event name="$" type="key" code="36" ascii="36" modifiers="" />
+ <event name="%" type="key" code="37" ascii="37" modifiers="" />
+ <event name="^" type="key" code="94" ascii="94" modifiers="" />
+ <event name="&amp;" type="key" code="38" ascii="38" modifiers="" />
+ <event name="*" type="key" code="42" ascii="42" modifiers="" />
+ <event name="(" type="key" code="40" ascii="40" modifiers="" />
+ <event name=")" type="key" code="41" ascii="41" modifiers="" />
+ <event name="_" type="key" code="95" ascii="95" modifiers="" />
+ <event name="+" type="key" code="43" ascii="43" modifiers="" />
+ <event name="¬" type="key" code="172" ascii="172" modifiers="" />
+ <event name="!" type="key" code="33" ascii="33" modifiers="" />
+ <event name="{" type="key" code="123" ascii="123" modifiers="" />
+ <event name="}" type="key" code="125" ascii="125" modifiers="" />
+ <event name="~" type="key" code="126" ascii="126" modifiers="" />
+ <event name=":" type="key" code="58" ascii="58" modifiers="" />
+ <event name="@" type="key" code="64" ascii="64" modifiers="" />
+ <event name="&lt;" type="key" code="60" ascii="60" modifiers="" />
+ <event name="&gt;" type="key" code="62" ascii="62" modifiers="" />
+ <event name="?" type="key" code="63" ascii="63" modifiers="" />
+ <event name="space" type="key" code="32" ascii="32" modifiers="" />
+ <event name="tab" type="key" code="9" ascii="9" modifiers="" />
+ <event name="a" type="key" code="97" ascii="97" modifiers="" />
+ <event name="b" type="key" code="98" ascii="98" modifiers="" />
+ <event name="c" type="key" code="99" ascii="99" modifiers="" />
+ <event name="d" type="key" code="100" ascii="100" modifiers="" />
+ <event name="e" type="key" code="101" ascii="101" modifiers="" />
+ <event name="f" type="key" code="102" ascii="102" modifiers="" />
+ <event name="g" type="key" code="103" ascii="103" modifiers="" />
+ <event name="h" type="key" code="104" ascii="104" modifiers="" />
+ <event name="i" type="key" code="105" ascii="105" modifiers="" />
+ <event name="j" type="key" code="106" ascii="106" modifiers="" />
+ <event name="k" type="key" code="107" ascii="107" modifiers="" />
+ <event name="l" type="key" code="108" ascii="108" modifiers="" />
+ <event name="m" type="key" code="109" ascii="109" modifiers="" />
+ <event name="n" type="key" code="110" ascii="110" modifiers="" />
+ <event name="o" type="key" code="111" ascii="111" modifiers="" />
+ <event name="p" type="key" code="112" ascii="112" modifiers="" />
+ <event name="q" type="key" code="113" ascii="113" modifiers="" />
+ <event name="r" type="key" code="114" ascii="114" modifiers="" />
+ <event name="s" type="key" code="115" ascii="115" modifiers="" />
+ <event name="t" type="key" code="116" ascii="116" modifiers="" />
+ <event name="u" type="key" code="117" ascii="117" modifiers="" />
+ <event name="v" type="key" code="118" ascii="118" modifiers="" />
+ <event name="w" type="key" code="119" ascii="119" modifiers="" />
+ <event name="x" type="key" code="120" ascii="120" modifiers="" />
+ <event name="y" type="key" code="121" ascii="121" modifiers="" />
+ <event name="z" type="key" code="122" ascii="122" modifiers="" />
+ <event name="ok" type="submit" />
+ <event name="cancel" type="cancel" />
+ <event name="quit" type="submit" />
+ <event name="delete" type="delete" />
+ </mode>
+
+ <!-- Uppercase Symbols -->
+ <mode name="uppercasesymbols" resolutions="320x240">
+ <layout resolution="320x240" bitmap="uppercase-symbols320x240.bmp" transparent_color="255,0,255">
+ <map>
+ <area shape="rect" coords="13,8,306,20" target="display_area" />
+ <area shape="rect" coords="9,26,25,42" target="esc" />
+ <area shape="rect" coords="50,25,67,43" target="f2" />
+ <area shape="rect" coords="29,24,46,43" target="f1" />
+ <area shape="rect" coords="71,26,88,44" target="f3" />
+ <area shape="rect" coords="90,25,107,43" target="f4" />
+ <area shape="rect" coords="111,26,128,44" target="f5" />
+ <area shape="rect" coords="132,26,149,44" target="f6" />
+ <area shape="rect" coords="153,25,170,44" target="f7" />
+ <area shape="rect" coords="173,26,190,44" target="f8" />
+ <area shape="rect" coords="194,24,211,43" target="f9" />
+ <area shape="rect" coords="215,26,231,44" target="f10" />
+ <area shape="rect" coords="235,26,253,43" target="f11" />
+ <area shape="rect" coords="255,26,272,45" target="f12" />
+ <area shape="rect" coords="276,27,310,43" target="del" />
+ <area shape="rect" coords="8,47,26,64" target="¬" />
+ <area shape="rect" coords="28,47,45,64" target="!" />
+ <area shape="rect" coords="50,47,67,65" target="quote" />
+ <area shape="rect" coords="70,46,87,65" target="£" />
+ <area shape="rect" coords="91,46,108,64" target="$" />
+ <area shape="rect" coords="111,46,129,65" target="%" />
+ <area shape="rect" coords="132,47,149,65" target="^" />
+ <area shape="rect" coords="152,47,170,64" target="&amp;" />
+ <area shape="rect" coords="174,46,191,63" target="*" />
+ <area shape="rect" coords="194,47,211,65" target="(" />
+ <area shape="rect" coords="215,46,232,64" target=")" />
+ <area shape="rect" coords="235,47,252,65" target="_" />
+ <area shape="rect" coords="255,46,272,65" target="+" />
+ <area shape="rect" coords="276,46,299,65" target="delete" />
+ <area shape="rect" coords="300,46,311,65" target="backspace" />
+ <area shape="rect" coords="8,68,32,85" target="tab" />
+ <area shape="rect" coords="36,68,53,85" target="Q" />
+ <area shape="rect" coords="57,68,75,86" target="W" />
+ <area shape="rect" coords="78,67,94,85" target="E" />
+ <area shape="rect" coords="98,67,115,85" target="R" />
+ <area shape="rect" coords="119,67,136,85" target="T" />
+ <area shape="rect" coords="141,68,158,86" target="Y" />
+ <area shape="rect" coords="161,67,179,86" target="U" />
+ <area shape="rect" coords="182,67,199,86" target="I" />
+ <area shape="rect" coords="202,67,220,85" target="O" />
+ <area shape="rect" coords="223,68,240,86" target="P" />
+ <area shape="rect" coords="244,68,261,86" target="{" />
+ <area shape="rect" coords="264,67,282,86" target="}" />
+ <area shape="rect" coords="284,68,309,86" target="~" />
+ <area shape="rect" coords="8,89,41,106" target="caps" />
+ <area shape="rect" coords="44,88,63,107" target="A" />
+ <area shape="rect" coords="65,88,84,106" target="S" />
+ <area shape="rect" coords="86,89,104,107" target="D" />
+ <area shape="rect" coords="107,89,124,107" target="F" />
+ <area shape="rect" coords="128,89,145,107" target="G" />
+ <area shape="rect" coords="149,88,165,107" target="H" />
+ <area shape="rect" coords="169,89,186,107" target="J" />
+ <area shape="rect" coords="189,89,207,107" target="K" />
+ <area shape="rect" coords="210,89,228,107" target="L" />
+ <area shape="rect" coords="231,88,249,106" target=":" />
+ <area shape="rect" coords="251,89,269,107" target="@" />
+ <area shape="rect" coords="273,89,311,106" target="enter" />
+ <area shape="rect" coords="9,110,50,127" target="shift" />
+ <area shape="rect" coords="58,110,75,128" target="z" />
+ <area shape="rect" coords="79,110,96,128" target="x" />
+ <area shape="rect" coords="99,109,116,127" target="c" />
+ <area shape="rect" coords="120,110,138,128" target="v" />
+ <area shape="rect" coords="141,109,157,127" target="b" />
+ <area shape="rect" coords="162,110,179,128" target="n" />
+ <area shape="rect" coords="182,110,199,128" target="m" />
+ <area shape="rect" coords="202,110,219,128" target="&lt;" />
+ <area shape="rect" coords="223,110,241,128" target="&gt;" />
+ <area shape="rect" coords="243,110,261,128" target="?" />
+ <area shape="rect" coords="271,109,311,128" target="symbols" />
+ <area shape="rect" coords="9,130,33,148" target="ctrl" />
+ <area shape="rect" coords="38,130,61,147" target="alt" />
+ <area shape="rect" coords="67,130,262,148" target="space" />
+ <area shape="rect" coords="269,131,288,150" target="ok" />
+ <area shape="rect" coords="292,131,311,150" target="cancel" />
+ </map>
+ </layout>
+ <event name="esc" type="key" code="27" ascii="27" modifiers="" />
+ <event name="f1" type="key" code="282" ascii="315" modifiers="" />
+ <event name="f2" type="key" code="283" ascii="316" modifiers="" />
+ <event name="f3" type="key" code="284" ascii="317" modifiers="" />
+ <event name="f4" type="key" code="285" ascii="318" modifiers="" />
+ <event name="f5" type="key" code="286" ascii="319" modifiers="" />
+ <event name="f6" type="key" code="287" ascii="320" modifiers="" />
+ <event name="f7" type="key" code="288" ascii="321" modifiers="" />
+ <event name="f8" type="key" code="289" ascii="322" modifiers="" />
+ <event name="f9" type="key" code="290" ascii="323" modifiers="" />
+ <event name="f10" type="key" code="291" ascii="324" modifiers="" />
+ <event name="f11" type="key" code="292" ascii="325" modifiers="" />
+ <event name="f12" type="key" code="293" ascii="326" modifiers="" />
+ <event name="del" type="key" code="127" ascii="0" modifiers="" />
+ <event name="ctrl" type="modifier" modifiers="ctrl" />
+ <event name="alt" type="modifier" modifiers="alt" />
+ <event name="shift" type="switch_mode" mode="shiftlowercase" />
+ <event name="caps" type="switch_mode" mode="lowercasesymbols" />
+ <event name="symbols" type="switch_mode" mode="uppercase" />
+ <event name="backspace" type="key" code="8" ascii="8" modifiers="" />
+ <event name="enter" type="key" code="13" ascii="13" modifiers="" />
+ <event name="quote" type="key" code="34" ascii="34" modifiers="" />
+ <event name="£" type="key" code="163" ascii="163" modifiers="" />
+ <event name="$" type="key" code="36" ascii="36" modifiers="" />
+ <event name="%" type="key" code="37" ascii="37" modifiers="" />
+ <event name="^" type="key" code="94" ascii="94" modifiers="" />
+ <event name="&amp;" type="key" code="38" ascii="38" modifiers="" />
+ <event name="*" type="key" code="42" ascii="42" modifiers="" />
+ <event name="(" type="key" code="40" ascii="40" modifiers="" />
+ <event name=")" type="key" code="41" ascii="41" modifiers="" />
+ <event name="_" type="key" code="95" ascii="95" modifiers="" />
+ <event name="+" type="key" code="43" ascii="43" modifiers="" />
+ <event name="¬" type="key" code="172" ascii="172" modifiers="" />
+ <event name="!" type="key" code="33" ascii="33" modifiers="" />
+ <event name="{" type="key" code="123" ascii="123" modifiers="" />
+ <event name="}" type="key" code="125" ascii="125" modifiers="" />
+ <event name="~" type="key" code="126" ascii="126" modifiers="" />
+ <event name=":" type="key" code="58" ascii="58" modifiers="" />
+ <event name="@" type="key" code="64" ascii="64" modifiers="" />
+ <event name="&lt;" type="key" code="60" ascii="60" modifiers="" />
+ <event name="&gt;" type="key" code="62" ascii="62" modifiers="" />
+ <event name="?" type="key" code="63" ascii="63" modifiers="" />
+ <event name="space" type="key" code="32" ascii="32" modifiers="" />
+ <event name="tab" type="key" code="9" ascii="9" modifiers="" />
+ <event name="A" type="key" code="97" ascii="65" modifiers="shift" />
+ <event name="B" type="key" code="98" ascii="66" modifiers="shift" />
+ <event name="C" type="key" code="99" ascii="67" modifiers="shift" />
+ <event name="D" type="key" code="100" ascii="68" modifiers="shift" />
+ <event name="E" type="key" code="101" ascii="69" modifiers="shift" />
+ <event name="F" type="key" code="102" ascii="70" modifiers="shift" />
+ <event name="G" type="key" code="103" ascii="71" modifiers="shift" />
+ <event name="H" type="key" code="104" ascii="72" modifiers="shift" />
+ <event name="I" type="key" code="105" ascii="73" modifiers="shift" />
+ <event name="J" type="key" code="106" ascii="74" modifiers="shift" />
+ <event name="K" type="key" code="107" ascii="75" modifiers="shift" />
+ <event name="L" type="key" code="108" ascii="76" modifiers="shift" />
+ <event name="M" type="key" code="109" ascii="77" modifiers="shift" />
+ <event name="N" type="key" code="110" ascii="78" modifiers="shift" />
+ <event name="O" type="key" code="111" ascii="79" modifiers="shift" />
+ <event name="P" type="key" code="112" ascii="80" modifiers="shift" />
+ <event name="Q" type="key" code="113" ascii="81" modifiers="shift" />
+ <event name="R" type="key" code="114" ascii="82" modifiers="shift" />
+ <event name="S" type="key" code="115" ascii="83" modifiers="shift" />
+ <event name="T" type="key" code="116" ascii="84" modifiers="shift" />
+ <event name="U" type="key" code="117" ascii="85" modifiers="shift" />
+ <event name="V" type="key" code="118" ascii="86" modifiers="shift" />
+ <event name="W" type="key" code="119" ascii="87" modifiers="shift" />
+ <event name="X" type="key" code="120" ascii="88" modifiers="shift" />
+ <event name="Y" type="key" code="121" ascii="89" modifiers="shift" />
+ <event name="Z" type="key" code="122" ascii="90" modifiers="shift" />
+ <event name="0" type="key" code="48" ascii="48" modifiers="" />
+ <event name="1" type="key" code="49" ascii="49" modifiers="" />
+ <event name="2" type="key" code="50" ascii="50" modifiers="" />
+ <event name="3" type="key" code="51" ascii="51" modifiers="" />
+ <event name="4" type="key" code="52" ascii="52" modifiers="" />
+ <event name="5" type="key" code="53" ascii="53" modifiers="" />
+ <event name="6" type="key" code="54" ascii="54" modifiers="" />
+ <event name="7" type="key" code="55" ascii="55" modifiers="" />
+ <event name="8" type="key" code="56" ascii="56" modifiers="" />
+ <event name="9" type="key" code="57" ascii="57" modifiers="" />
+ <event name="ok" type="submit" />
+ <event name="cancel" type="cancel" />
+ <event name="quit" type="submit" />
+ <event name="delete" type="delete" />
+ </mode>
+</keyboard>
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index 678c751410..ce19e9d462 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -98,7 +98,7 @@ bool VirtualKeyboard::openPack(const String &packName, const FSNode &node) {
return false;
}
} else {
- warning("Could not find %s.xml file in %s.zip keyboard pack", packName.c_str(), packName.c_str());
+ warning("Could not find %s.xml file in %s.zip virtual keyboard pack", packName.c_str(), packName.c_str());
delete _fileArchive;
_fileArchive = 0;
return false;
@@ -132,15 +132,15 @@ bool VirtualKeyboard::loadKeyboardPack(const String &packName) {
_loaded = _parser->parse();
if (_loaded) {
- debug("Keyboard pack '%s' loaded successfully", packName.c_str());
+ debug("Virtual keyboard pack '%s' loaded successfully", packName.c_str());
} else {
- warning("Error parsing the keyboard pack '%s'", packName.c_str());
+ warning("Error parsing the virtual keyboard pack '%s'", packName.c_str());
delete _fileArchive;
_fileArchive = 0;
}
} else {
- warning("Keyboard pack not found");
+ warning("Virtual keyboard disabled due to missing pack file");
}
return _loaded;
@@ -205,7 +205,7 @@ void VirtualKeyboard::switchMode(Mode *newMode) {
void VirtualKeyboard::switchMode(const String &newMode) {
if (!_modes.contains(newMode)) {
- warning("Keyboard mode '%s' unknown", newMode.c_str());
+ warning("Virtual keyboard mode '%s' unknown", newMode.c_str());
} else {
switchMode(&_modes[newMode]);
}
@@ -227,7 +227,7 @@ void VirtualKeyboard::handleMouseUp(int16 x, int16 y) {
void VirtualKeyboard::show() {
if (!_loaded) {
- warning("Virtual keyboard not loaded");
+ debug(1, "VirtualKeyboard::show() - Virtual keyboard not loaded");
return;
} else {
_kbdGUI->checkScreenChanged();
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp
index 30896d7514..b92116cbe7 100644
--- a/common/EventMapper.cpp
+++ b/common/EventMapper.cpp
@@ -30,23 +30,45 @@ namespace Common {
List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {
List<Event> events;
Event mappedEvent;
+#ifdef ENABLE_VKEYBD
+ // Trigger virtual keyboard on long press of more than 1 second
+ // of middle mouse button.
+ const uint32 vkeybdTime = 1000;
+
+ static bool vkeybd = false;
+ static uint32 vkeybdThen = 0;
+
+ if (ev.type == EVENT_MBUTTONDOWN) {
+ vkeybdThen = g_system->getMillis();
+ }
+
+ if (ev.type == EVENT_MBUTTONUP) {
+ if ((g_system->getMillis() - vkeybdThen) >= vkeybdTime) {
+ mappedEvent.type = EVENT_VIRTUAL_KEYBOARD;
+
+ // Avoid blocking event from engine.
+ addDelayedEvent(100, ev);
+ }
+ }
+#endif
+
if (ev.type == EVENT_KEYDOWN) {
if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F5) {
mappedEvent.type = EVENT_MAINMENU;
}
#ifdef ENABLE_VKEYBD
- else if (ev.kbd.keycode == KEYCODE_F7 && ev.kbd.hasFlags(0)) {
+ else if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F7) {
mappedEvent.type = EVENT_VIRTUAL_KEYBOARD;
- // Avoid blocking F7 events from engine.
+ // Avoid blocking CTRL-F7 events from engine.
addDelayedEvent(100, ev);
}
#endif
#ifdef ENABLE_KEYMAPPER
- else if (ev.kbd.keycode == KEYCODE_F8 && ev.kbd.hasFlags(0)) {
+ else if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F8) {
mappedEvent.type = EVENT_KEYMAPPER_REMAP;
- // Avoid blocking F8 events from engine.
+ // Avoid blocking CTRL-F8 events from engine.
addDelayedEvent(100, ev);
}
#endif
diff --git a/configure b/configure
index 3f49565010..3d37473c33 100755
--- a/configure
+++ b/configure
@@ -2797,6 +2797,8 @@ if test -n "$_host"; then
_mt32emu=no
_timidity=no
_vkeybd=yes
+ _eventrec=no
+ _port_mk="backends/platform/sdl/ps3/ps3.mk"
;;
psp)
_backend="psp"
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index 8b70ec3dd8..fcbd8c534a 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -26,7 +26,8 @@ echo.
xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~4/lib/%~3/freetype6.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" "%~2" 1>NUL 2>&1
-xcopy /F /Y "%~1/gui/themes/translations.dat" "%~2" 1>NUL 2>&1
+xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_small.zip" "%~2" 1>NUL 2>&1
+xcopy /F /Y "%~1/gui/themes/translations.dat" "%~2" 1>NUL 2>&1
if "%~5"=="0" goto done
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index a52bbaecf8..e458689367 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -529,6 +529,7 @@ freddi3 Freddi Fish 3: The Case of the Stolen Conch Shell
02cae0e7ff8504f73618391873d5781a -1 de Windows HE 98.5 - - Julius
78c07ca088526d8d4446a4c2cb501203 -1 fr All HE 99 - - alamaz, gist974
83cedbe26aa8b58988e984e3d34cac8e -1 de All HE 99 - - Joachim Eberhard
+ 45adb5065e77559196dc0477e0f91fb9 -1 gb Windows HE 99 - - George Q. Greg
75bff95816b84672b877d22a911ab811 -1 ru Windows HE 99 Updated - sev
0ddf1174d0d097956ba10dd452ea65e6 -1 he Windows HE 99 - - Matan Bareket
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 392ee08ea1..c26fbe3331 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -235,10 +235,6 @@ void MidiPlayer::startTrack(int track) {
_music.parser = parser; // That plugs the power cord into the wall
} else if (_music.parser) {
if (!_music.parser->setTrack(track)) {
- // The Roland MT32 music in Simon the Sorcerer 2
- // is missing the extra tracks in many scenes,
- // like the introduction sequence.
- stop();
return;
}
_currentTrack = (byte)track;
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index d465bf210a..61fbf7192f 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -863,7 +863,6 @@ bool Bitmap::putDibRB(int32 *palette) {
int start1;
int fillLen;
uint16 pixel;
- int endx;
int y;
uint16 *srcPtr2;
uint16 *srcPtr;
@@ -875,7 +874,6 @@ bool Bitmap::putDibRB(int32 *palette) {
debug(8, "Bitmap::putDibRB()");
- endx = _width - 1;
endy = _height - 1;
int startx = 0;
diff --git a/engines/fullpipe/mgm.cpp b/engines/fullpipe/mgm.cpp
new file mode 100644
index 0000000000..aacfd5452a
--- /dev/null
+++ b/engines/fullpipe/mgm.cpp
@@ -0,0 +1,719 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "fullpipe/fullpipe.h"
+
+#include "fullpipe/utils.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/messages.h"
+
+namespace Fullpipe {
+
+void MGM::clear() {
+ _items.clear();
+}
+
+MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) {
+ int idx = getItemIndexById(ani->_id);
+
+ if (idx == -1)
+ return 0;
+
+ int stid = staticsId;
+
+ if (!staticsId) {
+ if (ani->_movement) {
+ stid = ani->_movement->_staticsObj2->_staticsId;
+ } else {
+ if (!ani->_statics)
+ return 0;
+
+ stid = ani->_statics->_staticsId;
+ }
+ }
+
+ if (stid == staticsIndex)
+ return new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ int startidx = getStaticsIndexById(idx, stid);
+ int endidx = getStaticsIndexById(idx, staticsIndex);
+ int subidx = startidx + endidx * _items[idx]->statics.size();
+
+ if (!_items[idx]->subItems[subidx]->movement) {
+ clearMovements2(idx);
+ recalcOffsets(idx, startidx, endidx, 0, 1);
+ }
+
+ if (!_items[idx]->subItems[subidx]->movement)
+ return 0;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ Common::Point point;
+ ExCommand *ex;
+
+ int i = 0;
+ do {
+ subidx = startidx + endidx * _items[idx]->statics.size();
+
+ _items[idx]->subItems[subidx]->movement->calcSomeXY(point, 0, -1);
+
+ if (pointArr) {
+ int sz;
+
+ if (_items[idx]->subItems[subidx]->movement->_currMovement)
+ sz = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size();
+ else
+ sz = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size();
+
+ ex = new ExCommand2(20, ani->_id, &pointArr[i], sz);
+
+ ex->_messageNum = _items[idx]->subItems[subidx]->movement->_id;
+ } else {
+ ex = new ExCommand(ani->_id, 1, _items[idx]->subItems[subidx]->movement->_id, 0, 0, 0, 1, 0, 0, 0);
+ }
+
+ ex->_keyCode = ani->_okeyCode;
+ ex->_field_3C = 1;
+ ex->_field_24 = 1;
+
+ mq->addExCommandToEnd(ex);
+
+ if (resStatId)
+ *resStatId = _items[idx]->subItems[subidx]->movement->_id;
+
+ startidx = _items[idx]->subItems[subidx]->staticsIndex;
+
+ uint step;
+
+ if (_items[idx]->subItems[subidx]->movement->_currMovement)
+ step = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size();
+ else
+ step = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size();
+
+ i += step;
+ } while (startidx != endidx);
+
+ return mq;
+}
+
+MGMItem::MGMItem() {
+ objId = 0;
+}
+
+MGMSubItem::MGMSubItem() {
+ movement = 0;
+ staticsIndex = 0;
+ field_8 = 0;
+ field_C = 0;
+ x = 0;
+ y = 0;
+}
+
+void MGM::addItem(int objId) {
+ if (getItemIndexById(objId) == -1) {
+ MGMItem *item = new MGMItem();
+
+ item->objId = objId;
+ _items.push_back(item);
+ }
+ rebuildTables(objId);
+}
+
+void MGM::rebuildTables(int objId) {
+ int idx = getItemIndexById(objId);
+
+ if (idx == -1)
+ return;
+
+ _items[idx]->subItems.clear();
+ _items[idx]->statics.clear();
+ _items[idx]->movements1.clear();
+ _items[idx]->movements2.clear();
+
+ StaticANIObject *obj = g_fp->_currentScene->getStaticANIObject1ById(objId, -1);
+
+ if (!obj)
+ return;
+
+ for (uint i = 0; i < obj->_staticsList.size(); i++)
+ _items[idx]->statics.push_back((Statics *)obj->_staticsList[i]);
+
+ for (uint i = 0; i < obj->_movements.size(); i++)
+ _items[idx]->movements1.push_back((Movement *)obj->_movements[i]);
+
+ _items[idx]->subItems.clear();
+}
+
+int MGM::getItemIndexById(int objId) {
+ for (uint i = 0; i < _items.size(); i++)
+ if (_items[i]->objId == objId)
+ return i;
+
+ return -1;
+}
+
+MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
+ if (!mgminfo->ani)
+ return 0;
+
+ Movement *mov = mgminfo->ani->_movement;
+
+ if (!mov && !mgminfo->ani->_statics)
+ return 0;
+
+ if (!(mgminfo->flags & 1)) {
+ if (mov)
+ mgminfo->staticsId1 = mov->_staticsObj2->_staticsId;
+ else
+ mgminfo->staticsId1 = mgminfo->ani->_statics->_staticsId;
+ }
+
+ Common::Point point;
+
+ if (!(mgminfo->flags & 0x10) || !(mgminfo->flags & 0x20)) {
+ int nx = mgminfo->ani->_ox;
+ int ny = mgminfo->ani->_oy;
+
+ if (mgminfo->ani->_movement) {
+ mgminfo->ani->calcNextStep(&point);
+
+ nx += point.x;
+ ny += point.y;
+ }
+
+ if (!(mgminfo->flags & 0x10))
+ mgminfo->x2 = nx;
+
+ if (!(mgminfo->flags & 0x20))
+ mgminfo->y2 = ny;
+ }
+
+ mov = mgminfo->ani->getMovementById(mgminfo->movementId);
+
+ if (!mov)
+ return 0;
+
+ int itemIdx = getItemIndexById(mgminfo->ani->_id);
+ int subIdx = getStaticsIndexById(itemIdx, mgminfo->staticsId1);
+ int st2idx = getStaticsIndexById(itemIdx, mov->_staticsObj1->_staticsId);
+ int st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId);
+ int subOffset = getStaticsIndexById(itemIdx, mgminfo->staticsId2);
+
+ clearMovements2(itemIdx);
+ recalcOffsets(itemIdx, subIdx, st2idx, 0, 1);
+ clearMovements2(itemIdx);
+ recalcOffsets(itemIdx, st1idx, subOffset, 0, 1);
+
+ MGMSubItem *sub1 = _items[itemIdx]->subItems[subIdx + st2idx * _items[itemIdx]->statics.size()];
+ MGMSubItem *sub2 = _items[itemIdx]->subItems[st1idx + subOffset * _items[itemIdx]->statics.size()];
+
+ if (subIdx != st2idx && !sub1->movement)
+ return 0;
+
+ if (st1idx != subOffset && !sub2->movement)
+ return 0;
+
+ int n1x = mgminfo->x1 - mgminfo->x2 - sub1->x - sub2->x;
+ int n1y = mgminfo->y1 - mgminfo->y2 - sub1->y - sub2->y;
+
+ Common::Point point1;
+
+ mov->calcSomeXY(point1, 0, -1);
+
+ int n2x = point1.x;
+ int n2y = point1.y;
+ int mult;
+ int len = -1;
+
+ if (mgminfo->flags & 0x40) {
+ mult = mgminfo->field_10;
+ len = -1;
+ n2x *= mult;
+ n2y *= mult;
+ } else {
+ calcLength(&point, mov, n1x, n1y, &mult, &len, 1);
+ n2x = point.x;
+ n2y = point.y;
+ }
+
+ if (!(mgminfo->flags & 2)) {
+ len = -1;
+ n2x = mult * point1.x;
+ n1x = mult * point1.x;
+ mgminfo->x1 = mgminfo->x2 + mult * point1.x + sub1->x + sub2->x;
+ }
+
+ if (!(mgminfo->flags & 4)) {
+ n2y = mult * point1.y;
+ n1y = mult * point1.y;
+ len = -1;
+ mgminfo->y1 = mgminfo->y2 + mult * point1.y + sub1->y + sub2->y;
+ }
+
+ int px = 0;
+ int py = 0;
+
+ if (sub1->movement) {
+ px = countPhases(itemIdx, subIdx, st2idx, 1);
+ py = countPhases(itemIdx, subIdx, st2idx, 2);
+ }
+
+ if (mult > 1) {
+ px += (mult - 1) * mov->countPhasesWithFlag(-1, 1);
+ py += (mult - 1) * mov->countPhasesWithFlag(-1, 2);
+ }
+
+ if (mult > 0) {
+ px += mov->countPhasesWithFlag(len, 1);
+ py += mov->countPhasesWithFlag(len, 2);
+ }
+
+ if (sub2->movement) {
+ px += countPhases(itemIdx, st1idx, subOffset, 1);
+ py += countPhases(itemIdx, st1idx, subOffset, 2);
+ }
+
+ int dx1 = n1x - n2x;
+ int dy1 = n1y - n2y;
+ int x1, y1;
+
+ if (px) {
+ x1 = (int)((double)dx1 / (double)px);
+ } else {
+ x1 = 0;
+ }
+
+ if (py) {
+ y1 = (int)((double)dy1 / (double)py);
+ } else {
+ y1 = 0;
+ }
+
+ Common::Point x2, y2;
+
+ y2.x = dx1 - px * x1;
+ y2.y = dy1 - py * y1;
+
+ if (n1x - n2x == px * x1)
+ x2.x = 0;
+ else
+ x2.x = (dx1 - px * x1) / abs(dx1 - px * x1);
+
+ if (dy1 == py * y1)
+ x2.y = 0;
+ else
+ x2.y = (dy1 - py * y1) / abs(dy1 - py * y1);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand2 *ex2;
+
+ for (int i = subIdx; i != st2idx;) {
+ MGMSubItem *s = _items[itemIdx]->subItems[i + subOffset * _items[itemIdx]->statics.size()];
+
+ ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1);
+ ex2->_parId = mq->_id;
+ ex2->_keyCode = mgminfo->ani->_okeyCode;
+
+ mq->addExCommandToEnd(ex2);
+
+ i = s->staticsIndex;
+ }
+
+ for (int i = 0; i < mult; ++i) {
+ int plen;
+
+ if (i == mult - 1)
+ plen = len;
+ else
+ plen = -1;
+
+ ex2 = buildExCommand2(mov, mgminfo->ani->_id, x1, y1, &x2, &y2, plen);
+ ex2->_parId = mq->_id;
+ ex2->_keyCode = mgminfo->ani->_okeyCode;
+
+ mq->addExCommandToEnd(ex2);
+ }
+
+ for (int j = st1idx; j != subOffset;) {
+ MGMSubItem *s = _items[itemIdx]->subItems[j + subOffset * _items[itemIdx]->statics.size()];
+
+ ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1);
+ ex2->_parId = mq->_id;
+ ex2->_keyCode = mgminfo->ani->_okeyCode;
+
+ mq->addExCommandToEnd(ex2);
+
+ j = s->staticsIndex;
+ }
+
+ ExCommand *ex = new ExCommand(mgminfo->ani->_id, 5, -1, mgminfo->x1, mgminfo->y1, 0, 1, 0, 0, 0);
+
+ ex->_field_14 = mgminfo->field_1C;
+ ex->_keyCode = mgminfo->ani->_okeyCode;
+ ex->_field_24 = 0;
+ ex->_excFlags |= 3;
+
+ mq->addExCommandToEnd(ex);
+
+ return mq;
+}
+
+int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) {
+ int res = 0;
+
+ if (endIdx < 0)
+ return 0;
+
+ while (subIdx != endIdx) {
+ if (subIdx < 0)
+ break;
+
+ res += _items[idx]->subItems[subIdx + endIdx * _items[idx]->statics.size()]->movement->countPhasesWithFlag(-1, flag);
+
+ subIdx = _items[idx]->subItems[subIdx + 6 * endIdx * _items[idx]->statics.size()]->staticsIndex;
+ }
+
+ return res;
+}
+void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) {
+ if (getItemIndexById(ani->_id) == -1)
+ return;
+
+ if (ani->_movement) {
+ ani->queueMessageQueue(0);
+ ani->_movement->gotoLastFrame();
+ ani->_statics = ani->_movement->_staticsObj2;
+
+ int x = ani->_movement->_ox;
+ int y = ani->_movement->_oy;
+
+ ani->_movement = 0;
+
+ ani->setOXY(x, y);
+ }
+
+ if (ani->_statics) {
+ Common::Point point;
+
+ getPoint(&point, ani->_id, ani->_statics->_staticsId, staticsId);
+
+ ani->setOXY(ani->_ox + point.x, ani->_oy + point.y);
+
+ ani->_statics = ani->getStaticsById(staticsId);
+ }
+}
+
+Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, int staticsId2) {
+ int idx = getItemIndexById(objectId);
+
+ if (idx == -1) {
+ point->x = -1;
+ point->y = -1;
+ } else {
+ int st1idx = getStaticsIndexById(idx, staticsId1);
+ int st2idx = getStaticsIndexById(idx, staticsId2);
+
+ if (st1idx == st2idx) {
+ point->x = 0;
+ point->y = 0;
+ } else {
+ int subidx = st1idx + st2idx * _items[idx]->statics.size();
+
+ if (!_items[idx]->subItems[subidx]->movement) {
+ clearMovements2(idx);
+ recalcOffsets(idx, st1idx, st2idx, false, true);
+
+ if (!_items[idx]->subItems[subidx]->movement) {
+ clearMovements2(idx);
+ recalcOffsets(idx, st1idx, st2idx, true, false);
+ }
+ }
+
+ MGMSubItem *sub = _items[idx]->subItems[subidx];
+
+ if (sub->movement) {
+ point->x = sub->x;
+ point->y = sub->y;
+ } else {
+ point->x = 0;
+ point->y = 0;
+ }
+ }
+ }
+
+ return point;
+}
+
+int MGM::getStaticsIndexById(int idx, int16 id) {
+ if (!_items[idx]->statics.size())
+ return -1;
+
+ for (uint i = 0; i < _items[idx]->statics.size(); i++) {
+ if (_items[idx]->statics[i]->_staticsId == id)
+ return i;
+ }
+
+ return 0;
+}
+
+int MGM::getStaticsIndex(int idx, Statics *st) {
+ if (!_items[idx]->statics.size())
+ return -1;
+
+ for (uint i = 0; i < _items[idx]->statics.size(); i++) {
+ if (_items[idx]->statics[i] == st)
+ return i;
+ }
+
+ return 0;
+}
+
+void MGM::clearMovements2(int idx) {
+ _items[idx]->movements2.clear();
+}
+
+int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
+ MGMItem *item = _items[idx];
+ int subIdx = st1idx + st2idx * item->statics.size();
+
+ if (st1idx == st2idx) {
+ memset(&item->subItems[subIdx], 0, sizeof(item->subItems[subIdx]));
+ return 0;
+ }
+
+ if (item->subItems[subIdx])
+ return item->subItems[subIdx]->field_8;
+
+ Common::Point point;
+
+ for (uint i = 0; i < item->movements1.size(); i++) {
+ Movement *mov = item->movements1[i];
+
+ if (mov->_staticsObj1 == item->statics[st1idx]) {
+ if (!item->movements2[i] && (!flop || mov->_field_50)) {
+ item->movements2[i] = 1;
+
+ int stidx = getStaticsIndex(idx, item->movements1[i]->_staticsObj2);
+ int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
+ int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+ int newsz = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C;
+
+ if (recalc >= 0) {
+ if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1 ||
+ (item->subItems[subIdx]->field_8 == recalc + 1 && item->subItems[subIdx]->field_C > newsz)) {
+ item->subItems[subIdx]->movement = mov;
+ item->subItems[subIdx]->staticsIndex = stidx;
+ item->subItems[subIdx]->field_8 = recalc + 1;
+ item->subItems[subIdx]->field_C = newsz;
+
+ mov->calcSomeXY(point, 0, -1);
+
+ item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x + point.x;
+ item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y + point.y;
+ }
+ }
+ }
+ } else if (flip) {
+ if (mov->_staticsObj2 == item->statics[st1idx]) {
+ if (!item->movements2[i] && (!flop || mov->_field_50)) {
+ item->movements2[i] = 1;
+
+ int stidx = getStaticsIndex(idx, mov->_staticsObj1);
+ int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
+
+ if (recalc >= 0) {
+ if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1) {
+ item->subItems[subIdx]->movement = mov;
+ item->subItems[subIdx]->staticsIndex = stidx;
+ item->subItems[subIdx]->field_8 = recalc + 1;
+
+ int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+
+ item->subItems[subIdx]->field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C;
+
+ mov->calcSomeXY(point, 0, -1);
+
+ item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x - point.x;
+ item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y - point.y;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (item->subItems[subIdx]->movement)
+ return item->subItems[subIdx]->field_8;
+
+ return -1;
+}
+
+int MGM::refreshOffsets(int objectId, int idx1, int idx2) {
+ int idx = getItemIndexById(objectId);
+
+ if (idx != -1) {
+ int from = getStaticsIndexById(idx, idx1);
+ int to = getStaticsIndexById(idx, idx2);
+
+ MGMSubItem *sub = _items[idx]->subItems[from + to * _items[idx]->statics.size()];
+
+ if (sub->movement) {
+ idx = sub->field_8;
+ } else {
+ clearMovements2(idx);
+ idx = recalcOffsets(idx, from, to, 0, 1);
+ }
+ }
+
+ return idx;
+}
+
+Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) {
+ Common::Point point;
+
+ mov->calcSomeXY(point, 0, -1);
+ int p1x = point.x;
+ int p1y = point.y;
+
+ int newmult = 0;
+ int oldlen = *len;
+
+ if (abs(p1y) > abs(p1x)) {
+ if (mov->calcSomeXY(point, 0, -1)->y)
+ newmult = (int)((double)y / mov->calcSomeXY(point, 0, -1)->y);
+ } else if (mov->calcSomeXY(point, 0, -1)->x) {
+ newmult = (int)((double)x / mov->calcSomeXY(point, 0, -1)->x);
+ }
+
+ if (newmult < 0)
+ newmult = 0;
+
+ *mult = newmult;
+
+ int phase = 1;
+ int sz;
+
+ if (flag) {
+ if (abs(p1y) > abs(p1x)) {
+ while (abs(p1y * newmult + mov->calcSomeXY(point, 0, phase)->y) < abs(y)) {
+ sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+
+ if (phase > sz)
+ break;
+
+ phase++;
+ }
+ } else {
+ while (abs(p1x * newmult + mov->calcSomeXY(point, 0, phase)->x) < abs(x)) {
+ sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+
+ if (phase >= sz)
+ break;
+
+ phase++;
+ }
+ }
+
+ *len = phase - 1;
+ } else {
+ *len = -1;
+ }
+
+ int p2x = 0;
+ int p2y = 0;
+
+ if (!oldlen)
+ oldlen = -1;
+
+ if (oldlen > 0) {
+ ++*mult;
+
+ mov->calcSomeXY(point, 0, oldlen);
+ p2x = point.x;
+ p2y = point.y;
+
+ if (abs(p1y) > abs(p1x))
+ p2x = p1x;
+ else
+ p2y = p1y;
+ }
+
+ pRes->x = p2x + p1x * newmult;
+ pRes->y = p2y + p1y * newmult;
+
+ return pRes;
+}
+
+ExCommand2 *MGM::buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) {
+ uint cnt;
+
+ if (mov->_currMovement)
+ cnt = mov->_currMovement->_dynamicPhases.size();
+ else
+ cnt = mov->_dynamicPhases.size();
+
+ if (len > 0 && cnt > (uint)len)
+ cnt = len;
+
+ Common::Point **points = (Common::Point **)malloc(sizeof(Common::Point *) * cnt);
+
+ for (uint i = 0; i < cnt; i++) {
+ int flags = mov->getDynamicPhaseByIndex(i)->getDynFlags();
+
+ points[i] = new Common::Point;
+
+ if (flags & 1) {
+ points[i]->x = x1 + x2->x;
+
+ y2->x -= x2->x;
+
+ if (!y2->x)
+ x2->x = 0;
+ }
+
+ if (flags & 2) {
+ points[i]->y = y1 + x2->y;
+
+ y2->y -= x2->y;
+
+ if (!y2->y)
+ x2->y = 0;
+ }
+ }
+
+ ExCommand2 *ex = new ExCommand2(20, objId, points, cnt);
+ ex->_excFlags = 2;
+ ex->_messageNum = mov->_id;
+ ex->_field_14 = len;
+ ex->_field_24 = 1;
+ ex->_keyCode = -1;
+
+ for (uint i = 0; i < cnt; i++)
+ delete points[i];
+
+ free(points);
+
+ return ex;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/mgm.h b/engines/fullpipe/mgm.h
new file mode 100644
index 0000000000..13195891da
--- /dev/null
+++ b/engines/fullpipe/mgm.h
@@ -0,0 +1,95 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FULLPIPE_MGM_H
+#define FULLPIPE_MGM_H
+
+namespace Fullpipe {
+
+class ExCommand2;
+class Movement;
+class Statics;
+
+struct MGMSubItem {
+ Movement *movement;
+ int staticsIndex;
+ int field_8;
+ int field_C;
+ int x;
+ int y;
+
+ MGMSubItem();
+};
+
+struct MGMItem {
+ int16 objId;
+ Common::Array<MGMSubItem *> subItems;
+ Common::Array<Statics *> statics;
+ Common::Array<Movement *> movements1;
+ Common::Array<int> movements2;
+
+ MGMItem();
+};
+
+struct MGMInfo {
+ StaticANIObject *ani;
+ int staticsId1;
+ int staticsId2;
+ int movementId;
+ int field_10;
+ int x1;
+ int y1;
+ int field_1C;
+ int x2;
+ int y2;
+ int flags;
+
+ MGMInfo() { memset(this, 0, sizeof(MGMInfo)); }
+};
+
+class MGM : public CObject {
+public:
+ Common::Array<MGMItem *> _items;
+
+public:
+ void clear();
+ void addItem(int objId);
+ void rebuildTables(int objId);
+ int getItemIndexById(int objId);
+
+ MessageQueue *genMovement(MGMInfo *mgminfo);
+ void updateAnimStatics(StaticANIObject *ani, int staticsId);
+ Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
+ int getStaticsIndexById(int idx, int16 id);
+ int getStaticsIndex(int idx, Statics *st);
+ void clearMovements2(int idx);
+ int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
+ Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag);
+ ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
+ MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
+ int countPhases(int idx, int subIdx, int subOffset, int flag);
+ int refreshOffsets(int objectId, int idx1, int idx2);
+};
+
+} // End of namespace Fullpipe
+
+#endif /* FULLPIPE_MGM_H */
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 3962fe64ba..96bd91fd39 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS = \
lift.o \
messagehandlers.o \
messages.o \
+ mgm.o \
modal.o \
motion.o \
ngiarchive.o \
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 66d587f134..49cf88434e 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -22,15 +22,10 @@
#include "fullpipe/fullpipe.h"
-#include "common/file.h"
-#include "common/array.h"
-#include "common/list.h"
-
-#include "fullpipe/objects.h"
+#include "fullpipe/utils.h"
#include "fullpipe/statics.h"
#include "fullpipe/gameloader.h"
#include "fullpipe/motion.h"
-#include "fullpipe/messages.h"
namespace Fullpipe {
@@ -1470,12 +1465,12 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla
return arr;
}
-void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2) {
+void MovGraph::findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &allPaths) {
if (lnk == lnk2) {
for (uint i = 0; i < tempObList1.size(); i++)
- tempObList2.push_back(tempObList1[i]);
+ allPaths.push_back(tempObList1[i]);
- tempObList2.push_back(lnk);
+ allPaths.push_back(lnk);
} else {
lnk->_flags |= 0x80000000;
@@ -1492,39 +1487,42 @@ void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<
}
if (!(l->_flags & 0xA0000000))
- shuffleTree(l, lnk2, tempObList1, tempObList2);
+ findAllPaths(l, lnk2, tempObList1, allPaths);
}
lnk->_flags &= 0x7FFFFFFF;
}
}
-Common::Array<MovItem *> *MovGraph::calcMovItems(MovArr *movarr1, MovArr *movarr2, int *listCount) {
+// Returns a list of possible paths two points in graph space
+Common::Array<MovItem *> *MovGraph::calcMovItems(MovArr *currPos, MovArr *destPos, int *pathCount) {
Common::Array<MovGraphLink *> tempObList1;
- Common::Array<MovGraphLink *> tempObList2;
+ Common::Array<MovGraphLink *> allPaths;
- shuffleTree(movarr1->_link, movarr2->_link, tempObList1, tempObList2);
+ // Get all paths between two edges of the graph
+ findAllPaths(currPos->_link, destPos->_link, tempObList1, allPaths);
- *listCount = 0;
+ *pathCount = 0;
- if (!tempObList2.size())
+ if (!allPaths.size())
return 0;
- *listCount = tempObList2.size();
+ *pathCount = allPaths.size();
Common::Array<MovItem *> *res = new Common::Array<MovItem *>;
- for (int i = 0; i < *listCount; i++) {
+ for (int i = 0; i < *pathCount; i++) {
MovItem *r = new MovItem;
- genMovItem(r, tempObList2[i], movarr1, movarr2);
+ genMovItem(r, allPaths[i], currPos, destPos);
res->push_back(r);
- delete tempObList2[i];
+ delete allPaths[i];
}
- movarr2->_link = movarr1->_link;
+ // Start the resulting path from current position
+ destPos->_link = currPos->_link;
return res;
}
@@ -2776,693 +2774,6 @@ MovGraphNode *MovGraph::calcOffset(int ox, int oy) {
return res;
}
-void MGM::clear() {
- _items.clear();
-}
-
-MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) {
- int idx = getItemIndexById(ani->_id);
-
- if (idx == -1)
- return 0;
-
- int stid = staticsId;
-
- if (!staticsId) {
- if (ani->_movement) {
- stid = ani->_movement->_staticsObj2->_staticsId;
- } else {
- if (!ani->_statics)
- return 0;
-
- stid = ani->_statics->_staticsId;
- }
- }
-
- if (stid == staticsIndex)
- return new MessageQueue(g_fp->_globalMessageQueueList->compact());
-
- int startidx = getStaticsIndexById(idx, stid);
- int endidx = getStaticsIndexById(idx, staticsIndex);
- int subidx = startidx + endidx * _items[idx]->statics.size();
-
- if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, startidx, endidx, 0, 1);
- }
-
- if (!_items[idx]->subItems[subidx]->movement)
- return 0;
-
- MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
- Common::Point point;
- ExCommand *ex;
-
- int i = 0;
- do {
- subidx = startidx + endidx * _items[idx]->statics.size();
-
- _items[idx]->subItems[subidx]->movement->calcSomeXY(point, 0, -1);
-
- if (pointArr) {
- int sz;
-
- if (_items[idx]->subItems[subidx]->movement->_currMovement)
- sz = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size();
- else
- sz = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size();
-
- ex = new ExCommand2(20, ani->_id, &pointArr[i], sz);
-
- ex->_messageNum = _items[idx]->subItems[subidx]->movement->_id;
- } else {
- ex = new ExCommand(ani->_id, 1, _items[idx]->subItems[subidx]->movement->_id, 0, 0, 0, 1, 0, 0, 0);
- }
-
- ex->_keyCode = ani->_okeyCode;
- ex->_field_3C = 1;
- ex->_field_24 = 1;
-
- mq->addExCommandToEnd(ex);
-
- if (resStatId)
- *resStatId = _items[idx]->subItems[subidx]->movement->_id;
-
- startidx = _items[idx]->subItems[subidx]->staticsIndex;
-
- uint step;
-
- if (_items[idx]->subItems[subidx]->movement->_currMovement)
- step = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size();
- else
- step = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size();
-
- i += step;
- } while (startidx != endidx);
-
- return mq;
-}
-
-MGMItem::MGMItem() {
- objId = 0;
-}
-
-MGMSubItem::MGMSubItem() {
- movement = 0;
- staticsIndex = 0;
- field_8 = 0;
- field_C = 0;
- x = 0;
- y = 0;
-}
-
-void MGM::addItem(int objId) {
- if (getItemIndexById(objId) == -1) {
- MGMItem *item = new MGMItem();
-
- item->objId = objId;
- _items.push_back(item);
- }
- rebuildTables(objId);
-}
-
-void MGM::rebuildTables(int objId) {
- int idx = getItemIndexById(objId);
-
- if (idx == -1)
- return;
-
- _items[idx]->subItems.clear();
- _items[idx]->statics.clear();
- _items[idx]->movements1.clear();
- _items[idx]->movements2.clear();
-
- StaticANIObject *obj = g_fp->_currentScene->getStaticANIObject1ById(objId, -1);
-
- if (!obj)
- return;
-
- for (uint i = 0; i < obj->_staticsList.size(); i++)
- _items[idx]->statics.push_back((Statics *)obj->_staticsList[i]);
-
- for (uint i = 0; i < obj->_movements.size(); i++)
- _items[idx]->movements1.push_back((Movement *)obj->_movements[i]);
-
- _items[idx]->subItems.clear();
-}
-
-int MGM::getItemIndexById(int objId) {
- for (uint i = 0; i < _items.size(); i++)
- if (_items[i]->objId == objId)
- return i;
-
- return -1;
-}
-
-MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
- if (!mgminfo->ani)
- return 0;
-
- Movement *mov = mgminfo->ani->_movement;
-
- if (!mov && !mgminfo->ani->_statics)
- return 0;
-
- if (!(mgminfo->flags & 1)) {
- if (mov)
- mgminfo->staticsId1 = mov->_staticsObj2->_staticsId;
- else
- mgminfo->staticsId1 = mgminfo->ani->_statics->_staticsId;
- }
-
- Common::Point point;
-
- if (!(mgminfo->flags & 0x10) || !(mgminfo->flags & 0x20)) {
- int nx = mgminfo->ani->_ox;
- int ny = mgminfo->ani->_oy;
-
- if (mgminfo->ani->_movement) {
- mgminfo->ani->calcNextStep(&point);
-
- nx += point.x;
- ny += point.y;
- }
-
- if (!(mgminfo->flags & 0x10))
- mgminfo->x2 = nx;
-
- if (!(mgminfo->flags & 0x20))
- mgminfo->y2 = ny;
- }
-
- mov = mgminfo->ani->getMovementById(mgminfo->movementId);
-
- if (!mov)
- return 0;
-
- int itemIdx = getItemIndexById(mgminfo->ani->_id);
- int subIdx = getStaticsIndexById(itemIdx, mgminfo->staticsId1);
- int st2idx = getStaticsIndexById(itemIdx, mov->_staticsObj1->_staticsId);
- int st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId);
- int subOffset = getStaticsIndexById(itemIdx, mgminfo->staticsId2);
-
- clearMovements2(itemIdx);
- recalcOffsets(itemIdx, subIdx, st2idx, 0, 1);
- clearMovements2(itemIdx);
- recalcOffsets(itemIdx, st1idx, subOffset, 0, 1);
-
- MGMSubItem *sub1 = _items[itemIdx]->subItems[subIdx + st2idx * _items[itemIdx]->statics.size()];
- MGMSubItem *sub2 = _items[itemIdx]->subItems[st1idx + subOffset * _items[itemIdx]->statics.size()];
-
- if (subIdx != st2idx && !sub1->movement)
- return 0;
-
- if (st1idx != subOffset && !sub2->movement)
- return 0;
-
- int n1x = mgminfo->x1 - mgminfo->x2 - sub1->x - sub2->x;
- int n1y = mgminfo->y1 - mgminfo->y2 - sub1->y - sub2->y;
-
- Common::Point point1;
-
- mov->calcSomeXY(point1, 0, -1);
-
- int n2x = point1.x;
- int n2y = point1.y;
- int mult;
- int len = -1;
-
- if (mgminfo->flags & 0x40) {
- mult = mgminfo->field_10;
- len = -1;
- n2x *= mult;
- n2y *= mult;
- } else {
- calcLength(&point, mov, n1x, n1y, &mult, &len, 1);
- n2x = point.x;
- n2y = point.y;
- }
-
- if (!(mgminfo->flags & 2)) {
- len = -1;
- n2x = mult * point1.x;
- n1x = mult * point1.x;
- mgminfo->x1 = mgminfo->x2 + mult * point1.x + sub1->x + sub2->x;
- }
-
- if (!(mgminfo->flags & 4)) {
- n2y = mult * point1.y;
- n1y = mult * point1.y;
- len = -1;
- mgminfo->y1 = mgminfo->y2 + mult * point1.y + sub1->y + sub2->y;
- }
-
- int px = 0;
- int py = 0;
-
- if (sub1->movement) {
- px = countPhases(itemIdx, subIdx, st2idx, 1);
- py = countPhases(itemIdx, subIdx, st2idx, 2);
- }
-
- if (mult > 1) {
- px += (mult - 1) * mov->countPhasesWithFlag(-1, 1);
- py += (mult - 1) * mov->countPhasesWithFlag(-1, 2);
- }
-
- if (mult > 0) {
- px += mov->countPhasesWithFlag(len, 1);
- py += mov->countPhasesWithFlag(len, 2);
- }
-
- if (sub2->movement) {
- px += countPhases(itemIdx, st1idx, subOffset, 1);
- py += countPhases(itemIdx, st1idx, subOffset, 2);
- }
-
- int dx1 = n1x - n2x;
- int dy1 = n1y - n2y;
- int x1, y1;
-
- if (px) {
- x1 = (int)((double)dx1 / (double)px);
- } else {
- x1 = 0;
- }
-
- if (py) {
- y1 = (int)((double)dy1 / (double)py);
- } else {
- y1 = 0;
- }
-
- Common::Point x2, y2;
-
- y2.x = dx1 - px * x1;
- y2.y = dy1 - py * y1;
-
- if (n1x - n2x == px * x1)
- x2.x = 0;
- else
- x2.x = (dx1 - px * x1) / abs(dx1 - px * x1);
-
- if (dy1 == py * y1)
- x2.y = 0;
- else
- x2.y = (dy1 - py * y1) / abs(dy1 - py * y1);
-
- MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
- ExCommand2 *ex2;
-
- for (int i = subIdx; i != st2idx;) {
- MGMSubItem *s = _items[itemIdx]->subItems[i + subOffset * _items[itemIdx]->statics.size()];
-
- ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1);
- ex2->_parId = mq->_id;
- ex2->_keyCode = mgminfo->ani->_okeyCode;
-
- mq->addExCommandToEnd(ex2);
-
- i = s->staticsIndex;
- }
-
- for (int i = 0; i < mult; ++i) {
- int plen;
-
- if (i == mult - 1)
- plen = len;
- else
- plen = -1;
-
- ex2 = buildExCommand2(mov, mgminfo->ani->_id, x1, y1, &x2, &y2, plen);
- ex2->_parId = mq->_id;
- ex2->_keyCode = mgminfo->ani->_okeyCode;
-
- mq->addExCommandToEnd(ex2);
- }
-
- for (int j = st1idx; j != subOffset;) {
- MGMSubItem *s = _items[itemIdx]->subItems[j + subOffset * _items[itemIdx]->statics.size()];
-
- ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1);
- ex2->_parId = mq->_id;
- ex2->_keyCode = mgminfo->ani->_okeyCode;
-
- mq->addExCommandToEnd(ex2);
-
- j = s->staticsIndex;
- }
-
- ExCommand *ex = new ExCommand(mgminfo->ani->_id, 5, -1, mgminfo->x1, mgminfo->y1, 0, 1, 0, 0, 0);
-
- ex->_field_14 = mgminfo->field_1C;
- ex->_keyCode = mgminfo->ani->_okeyCode;
- ex->_field_24 = 0;
- ex->_excFlags |= 3;
-
- mq->addExCommandToEnd(ex);
-
- return mq;
-}
-
-int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) {
- int res = 0;
-
- if (endIdx < 0)
- return 0;
-
- while (subIdx != endIdx) {
- if (subIdx < 0)
- break;
-
- res += _items[idx]->subItems[subIdx + endIdx * _items[idx]->statics.size()]->movement->countPhasesWithFlag(-1, flag);
-
- subIdx = _items[idx]->subItems[subIdx + 6 * endIdx * _items[idx]->statics.size()]->staticsIndex;
- }
-
- return res;
-}
-void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) {
- if (getItemIndexById(ani->_id) == -1)
- return;
-
- if (ani->_movement) {
- ani->queueMessageQueue(0);
- ani->_movement->gotoLastFrame();
- ani->_statics = ani->_movement->_staticsObj2;
-
- int x = ani->_movement->_ox;
- int y = ani->_movement->_oy;
-
- ani->_movement = 0;
-
- ani->setOXY(x, y);
- }
-
- if (ani->_statics) {
- Common::Point point;
-
- getPoint(&point, ani->_id, ani->_statics->_staticsId, staticsId);
-
- ani->setOXY(ani->_ox + point.x, ani->_oy + point.y);
-
- ani->_statics = ani->getStaticsById(staticsId);
- }
-}
-
-Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, int staticsId2) {
- int idx = getItemIndexById(objectId);
-
- if (idx == -1) {
- point->x = -1;
- point->y = -1;
- } else {
- int st1idx = getStaticsIndexById(idx, staticsId1);
- int st2idx = getStaticsIndexById(idx, staticsId2);
-
- if (st1idx == st2idx) {
- point->x = 0;
- point->y = 0;
- } else {
- int subidx = st1idx + st2idx * _items[idx]->statics.size();
-
- if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, st1idx, st2idx, false, true);
-
- if (!_items[idx]->subItems[subidx]->movement) {
- clearMovements2(idx);
- recalcOffsets(idx, st1idx, st2idx, true, false);
- }
- }
-
- MGMSubItem *sub = _items[idx]->subItems[subidx];
-
- if (sub->movement) {
- point->x = sub->x;
- point->y = sub->y;
- } else {
- point->x = 0;
- point->y = 0;
- }
- }
- }
-
- return point;
-}
-
-int MGM::getStaticsIndexById(int idx, int16 id) {
- if (!_items[idx]->statics.size())
- return -1;
-
- for (uint i = 0; i < _items[idx]->statics.size(); i++) {
- if (_items[idx]->statics[i]->_staticsId == id)
- return i;
- }
-
- return 0;
-}
-
-int MGM::getStaticsIndex(int idx, Statics *st) {
- if (!_items[idx]->statics.size())
- return -1;
-
- for (uint i = 0; i < _items[idx]->statics.size(); i++) {
- if (_items[idx]->statics[i] == st)
- return i;
- }
-
- return 0;
-}
-
-void MGM::clearMovements2(int idx) {
- _items[idx]->movements2.clear();
-}
-
-int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
- MGMItem *item = _items[idx];
- int subIdx = st1idx + st2idx * item->statics.size();
-
- if (st1idx == st2idx) {
- memset(&item->subItems[subIdx], 0, sizeof(item->subItems[subIdx]));
- return 0;
- }
-
- if (item->subItems[subIdx])
- return item->subItems[subIdx]->field_8;
-
- Common::Point point;
-
- for (uint i = 0; i < item->movements1.size(); i++) {
- Movement *mov = item->movements1[i];
-
- if (mov->_staticsObj1 == item->statics[st1idx]) {
- if (!item->movements2[i] && (!flop || mov->_field_50)) {
- item->movements2[i] = 1;
-
- int stidx = getStaticsIndex(idx, item->movements1[i]->_staticsObj2);
- int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
- int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
- int newsz = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C;
-
- if (recalc >= 0) {
- if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1 ||
- (item->subItems[subIdx]->field_8 == recalc + 1 && item->subItems[subIdx]->field_C > newsz)) {
- item->subItems[subIdx]->movement = mov;
- item->subItems[subIdx]->staticsIndex = stidx;
- item->subItems[subIdx]->field_8 = recalc + 1;
- item->subItems[subIdx]->field_C = newsz;
-
- mov->calcSomeXY(point, 0, -1);
-
- item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x + point.x;
- item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y + point.y;
- }
- }
- }
- } else if (flip) {
- if (mov->_staticsObj2 == item->statics[st1idx]) {
- if (!item->movements2[i] && (!flop || mov->_field_50)) {
- item->movements2[i] = 1;
-
- int stidx = getStaticsIndex(idx, mov->_staticsObj1);
- int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop);
-
- if (recalc >= 0) {
- if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1) {
- item->subItems[subIdx]->movement = mov;
- item->subItems[subIdx]->staticsIndex = stidx;
- item->subItems[subIdx]->field_8 = recalc + 1;
-
- int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
-
- item->subItems[subIdx]->field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C;
-
- mov->calcSomeXY(point, 0, -1);
-
- item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x - point.x;
- item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y - point.y;
- }
- }
- }
- }
- }
- }
-
- if (item->subItems[subIdx]->movement)
- return item->subItems[subIdx]->field_8;
-
- return -1;
-}
-
-int MGM::refreshOffsets(int objectId, int idx1, int idx2) {
- int idx = getItemIndexById(objectId);
-
- if (idx != -1) {
- int from = getStaticsIndexById(idx, idx1);
- int to = getStaticsIndexById(idx, idx2);
-
- MGMSubItem *sub = _items[idx]->subItems[from + to * _items[idx]->statics.size()];
-
- if (sub->movement) {
- idx = sub->field_8;
- } else {
- clearMovements2(idx);
- idx = recalcOffsets(idx, from, to, 0, 1);
- }
- }
-
- return idx;
-}
-
-Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) {
- Common::Point point;
-
- mov->calcSomeXY(point, 0, -1);
- int p1x = point.x;
- int p1y = point.y;
-
- int newmult = 0;
- int oldlen = *len;
-
- if (abs(p1y) > abs(p1x)) {
- if (mov->calcSomeXY(point, 0, -1)->y)
- newmult = (int)((double)y / mov->calcSomeXY(point, 0, -1)->y);
- } else if (mov->calcSomeXY(point, 0, -1)->x) {
- newmult = (int)((double)x / mov->calcSomeXY(point, 0, -1)->x);
- }
-
- if (newmult < 0)
- newmult = 0;
-
- *mult = newmult;
-
- int phase = 1;
- int sz;
-
- if (flag) {
- if (abs(p1y) > abs(p1x)) {
- while (abs(p1y * newmult + mov->calcSomeXY(point, 0, phase)->y) < abs(y)) {
- sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
-
- if (phase > sz)
- break;
-
- phase++;
- }
- } else {
- while (abs(p1x * newmult + mov->calcSomeXY(point, 0, phase)->x) < abs(x)) {
- sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
-
- if (phase >= sz)
- break;
-
- phase++;
- }
- }
-
- *len = phase - 1;
- } else {
- *len = -1;
- }
-
- int p2x = 0;
- int p2y = 0;
-
- if (!oldlen)
- oldlen = -1;
-
- if (oldlen > 0) {
- ++*mult;
-
- mov->calcSomeXY(point, 0, oldlen);
- p2x = point.x;
- p2y = point.y;
-
- if (abs(p1y) > abs(p1x))
- p2x = p1x;
- else
- p2y = p1y;
- }
-
- pRes->x = p2x + p1x * newmult;
- pRes->y = p2y + p1y * newmult;
-
- return pRes;
-}
-
-ExCommand2 *MGM::buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) {
- uint cnt;
-
- if (mov->_currMovement)
- cnt = mov->_currMovement->_dynamicPhases.size();
- else
- cnt = mov->_dynamicPhases.size();
-
- if (len > 0 && cnt > (uint)len)
- cnt = len;
-
- Common::Point **points = (Common::Point **)malloc(sizeof(Common::Point *) * cnt);
-
- for (uint i = 0; i < cnt; i++) {
- int flags = mov->getDynamicPhaseByIndex(i)->getDynFlags();
-
- points[i] = new Common::Point;
-
- if (flags & 1) {
- points[i]->x = x1 + x2->x;
-
- y2->x -= x2->x;
-
- if (!y2->x)
- x2->x = 0;
- }
-
- if (flags & 2) {
- points[i]->y = y1 + x2->y;
-
- y2->y -= x2->y;
-
- if (!y2->y)
- x2->y = 0;
- }
- }
-
- ExCommand2 *ex = new ExCommand2(20, objId, points, cnt);
- ex->_excFlags = 2;
- ex->_messageNum = mov->_id;
- ex->_field_14 = len;
- ex->_field_24 = 1;
- ex->_keyCode = -1;
-
- for (uint i = 0; i < cnt; i++)
- delete points[i];
-
- free(points);
-
- return ex;
-}
-
MovGraphLink::MovGraphLink() {
_distance = 0;
_angle = 0;
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 2cbf999f86..c488039e22 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -23,14 +23,13 @@
#ifndef FULLPIPE_MOTION_H
#define FULLPIPE_MOTION_H
+#include "fullpipe/mgm.h"
+
namespace Fullpipe {
-class Statics;
-class Movement;
class MctlConnectionPoint;
class MovGraphLink;
class MessageQueue;
-class ExCommand2;
struct MovArr;
struct MovItem;
@@ -124,67 +123,6 @@ public:
MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj; }
};
-struct MGMSubItem {
- Movement *movement;
- int staticsIndex;
- int field_8;
- int field_C;
- int x;
- int y;
-
- MGMSubItem();
-};
-
-struct MGMItem {
- int16 objId;
- Common::Array<MGMSubItem *> subItems;
- Common::Array<Statics *> statics;
- Common::Array<Movement *> movements1;
- Common::Array<int> movements2;
-
- MGMItem();
-};
-
-struct MGMInfo {
- StaticANIObject *ani;
- int staticsId1;
- int staticsId2;
- int movementId;
- int field_10;
- int x1;
- int y1;
- int field_1C;
- int x2;
- int y2;
- int flags;
-
- MGMInfo() { memset(this, 0, sizeof(MGMInfo)); }
-};
-
-class MGM : public CObject {
-public:
- Common::Array<MGMItem *> _items;
-
-public:
- void clear();
- void addItem(int objId);
- void rebuildTables(int objId);
- int getItemIndexById(int objId);
-
- MessageQueue *genMovement(MGMInfo *mgminfo);
- void updateAnimStatics(StaticANIObject *ani, int staticsId);
- Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
- int getStaticsIndexById(int idx, int16 id);
- int getStaticsIndex(int idx, Statics *st);
- void clearMovements2(int idx);
- int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
- Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag);
- ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
- MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
- int countPhases(int idx, int subIdx, int subOffset, int flag);
- int refreshOffsets(int objectId, int idx1, int idx2);
-};
-
struct MctlLadderMovementVars {
int varUpGo;
int varDownGo;
@@ -370,7 +308,7 @@ public:
MovGraphNode *calcOffset(int ox, int oy);
int getItemIndexByStaticAni(StaticANIObject *ani);
Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2);
- void shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
+ void findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
Common::Array<MovItem *> *calcMovItems(MovArr *movarr1, MovArr *movarr2, int *listCount);
void genMovItem(MovItem *movitem, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2);
bool calcChunk(int idx, int x, int y, MovArr *arr, int a6);
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 1247d9380e..8463b3ab40 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -654,7 +654,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
g_fp->_globalPalette = _palette->_data;
}
- debug(8, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
+ debug(1, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
if (_picObjList.size() > 2) { // We need to z-sort them
objectList_sortByPriority(_picObjList, true);
@@ -666,11 +666,17 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
if (maxPri == -1)
maxPri = 60000;
- debug(8, "-> Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
+ debug(1, "-> Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
Common::Point point;
- debug(8, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size());
+ debug(1, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size());
+
+ for (uint i = 0; i < _picObjList.size(); i++) {
+ debug(1, "%d: %d", i, ((PictureObject *)_picObjList[i])->_priority);
+ }
+
+
if (drawBg && _bigPictureArray1Count && _picObjList.size()) {
_bigPictureArray[0][0]->getDimensions(&point);
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 8639f59418..b544eff2db 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -64,6 +64,7 @@ Game::Game(MADSEngine *vm)
_loadGameSlot = -1;
_lastSave = -1;
_saveFile = nullptr;
+ _saveThumb = nullptr;
_statusFlag = 0;
_sectionHandler = nullptr;
_sectionNumber = 1;
@@ -93,6 +94,11 @@ Game::Game(MADSEngine *vm)
}
Game::~Game() {
+ if (_saveThumb) {
+ _saveThumb->free();
+ delete _saveThumb;
+ }
+
delete _saveFile;
delete _surface;
delete _sectionHandler;
@@ -548,16 +554,14 @@ void Game::writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &hea
out->write(header._saveName.c_str(), header._saveName.size());
out->writeByte('\0');
- // Get the active palette
- uint8 thumbPalette[256 * 3];
- g_system->getPaletteManager()->grabPalette(thumbPalette, 0, 256);
-
- // Create a thumbnail and save it
- Graphics::Surface *thumb = new Graphics::Surface();
- ::createThumbnail(thumb, _vm->_screen.getData(), MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, thumbPalette);
- Graphics::saveThumbnail(*out, *thumb);
- thumb->free();
- delete thumb;
+ // Handle the thumbnail. If there's already one set by the game, create one
+ if (!_saveThumb)
+ createThumbnail();
+ Graphics::saveThumbnail(*out, *_saveThumb);
+
+ _saveThumb->free();
+ delete _saveThumb;
+ _saveThumb = nullptr;
// Write out the save date/time
TimeDate td;
@@ -570,4 +574,16 @@ void Game::writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &hea
out->writeUint32LE(_vm->_events->getFrameCounter());
}
+void Game::createThumbnail() {
+ if (_saveThumb) {
+ _saveThumb->free();
+ delete _saveThumb;
+ }
+
+ uint8 thumbPalette[PALETTE_SIZE];
+ _vm->_palette->grabPalette(thumbPalette, 0, PALETTE_COUNT);
+ _saveThumb = new Graphics::Surface();
+ ::createThumbnail(_saveThumb, _vm->_screen.getData(), MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, thumbPalette);
+}
+
} // End of namespace MADS
diff --git a/engines/mads/game.h b/engines/mads/game.h
index 08cd7e7843..1a61fc8ac8 100644
--- a/engines/mads/game.h
+++ b/engines/mads/game.h
@@ -82,6 +82,7 @@ protected:
int _lastSave;
Common::String _saveName;
Common::InSaveFile *_saveFile;
+ Graphics::Surface *_saveThumb;
/**
* Constructor
@@ -226,6 +227,11 @@ public:
* Read in a savegame header
*/
static bool readSavegameHeader(Common::InSaveFile *in, MADSSavegameHeader &header);
+
+ /**
+ * Creates a temporary thumbnail for use in saving games
+ */
+ void createThumbnail();
};
} // End of namespace MADS
diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp
index 9b2d6f3114..d41696044b 100644
--- a/engines/mads/messages.cpp
+++ b/engines/mads/messages.cpp
@@ -546,10 +546,10 @@ void TextDisplayList::draw(MSurface *s) {
for (uint idx = 0; idx < size(); ++idx) {
TextDisplay &td = (*this)[idx];
if (td._active && (td._expire >= 0)) {
+ Common::Point destPos(td._bounds.left + _vm->_screen._offset.x,
+ td._bounds.top + _vm->_screen._offset.y);
td._font->setColors(0xFF, td._color1, td._color2, 0);
- td._font->writeString(s, td._msg,
- Common::Point(td._bounds.left, td._bounds.top),
- td._spacing, td._bounds.width());
+ td._font->writeString(s, td._msg, destPos, td._spacing, td._bounds.width());
}
}
}
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 36858a4940..80ce6cdad4 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -23,6 +23,10 @@
#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/util.h"
+#include "common/translation.h"
+
+#include "gui/saveload.h"
+
#include "mads/mads.h"
#include "mads/screen.h"
#include "mads/msurface.h"
@@ -266,15 +270,30 @@ bool DialogsNebular::commandCheck(const char *idStr, Common::String &valStr,
void DialogsNebular::showDialog() {
switch (_pendingDialog) {
- case DIALOG_GAME_MENU:
- //GameMenuDialog::show();
- break;
case DIALOG_DIFFICULTY: {
-/*
DifficultyDialog *dlg = new DifficultyDialog(_vm);
dlg->show();
delete dlg;
-*/
+ break;
+ }
+ case DIALOG_GAME_MENU: {
+ GameMenuDialog *dlg = new GameMenuDialog(_vm);
+ dlg->show();
+ delete dlg;
+ break;
+ }
+ case DIALOG_SAVE: {
+ showScummVMSaveDialog();
+ break;
+ }
+ case DIALOG_RESTORE: {
+ showScummVMRestoreDialog();
+ break;
+ }
+ case DIALOG_OPTIONS: {
+ OptionsDialog *dlg = new OptionsDialog(_vm);
+ dlg->show();
+ delete dlg;
break;
}
default:
@@ -282,6 +301,42 @@ void DialogsNebular::showDialog() {
}
}
+void DialogsNebular::showScummVMSaveDialog() {
+ Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
+ Scene *scene = &(game._scene);
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+
+ int slot = dialog->runModalWithCurrentTarget();
+ if (slot >= 0) {
+ Common::String desc = dialog->getResultString();
+
+ if (desc.empty()) {
+ // create our own description for the saved game, the user didn't enter it
+ desc = dialog->createDefaultSaveDescription(slot);
+ }
+
+ scene->_spriteSlots.reset();
+ _vm->_screen._offset.y = 0;
+ scene->loadScene(scene->_currentSceneId, game._aaName, true);
+ scene->_userInterface.noInventoryAnim();
+ game._scene.drawElements(kTransitionFadeIn, false);
+
+ game.saveGame(slot, desc);
+ }
+}
+
+void DialogsNebular::showScummVMRestoreDialog() {
+ Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+
+ int slot = dialog->runModalWithCurrentTarget();
+ if (slot >= 0) {
+ game._loadGameSlot = slot;
+ game._scene._currentSceneId = -1;
+ game._currentSectionNumber = -1;
+ }
+}
+
/*------------------------------------------------------------------------*/
CopyProtectionDialog::CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong) :
@@ -493,10 +548,10 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
Game &game = *_vm->_game;
Scene &scene = game._scene;
- _v1 = 0;
- _v2 = 0;
- _v3 = false;
- _selectedLine = 0;
+ _tempLine = 0;
+ _movedFlag = false;
+ _redrawFlag = false;
+ _selectedLine = -1;
_dirFlag = false;
_textLineCount = 0;
_screenId = 920;
@@ -516,7 +571,7 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
int currentSceneId = scene._currentSceneId;
int priorSceneId = scene._priorSceneId;
- if (_vm->_dialogs->_pendingDialog == DIALOG_DIFFICULTY) {
+ if (_vm->_dialogs->_pendingDialog) {
palFlag = true;
} else {
_vm->_palette->initPalette();
@@ -526,7 +581,7 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
scene._priorSceneId = priorSceneId;
scene._currentSceneId = currentSceneId;
scene._nextSceneId = nextSceneId;
- scene._posAdjust.y = 22;
+ _vm->_screen._offset.y = 22;
_vm->_sound->pauseNewCommands();
_vm->_events->initVars();
game._kernelMode = KERNEL_ROOM_INIT;
@@ -544,7 +599,8 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
}
_vm->_screen.empty();
- _vm->_screen.hLine(0, 0, MADS_SCREEN_WIDTH, 2);
+ _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2);
+ _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2);
game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition;
game._trigger = 0;
@@ -560,9 +616,13 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
_lineIndex = -1;
}
+ScreenDialog::~ScreenDialog() {
+ _vm->_screen._offset.y = 0;
+}
+
void ScreenDialog::clearLines() {
Scene &scene = _vm->_game->_scene;
- _v2 = 0;
+ _movedFlag = false;
_lines.clear();
scene._spriteSlots.fullRefresh(true);
}
@@ -590,12 +650,10 @@ void ScreenDialog::setClickableLines() {
void ScreenDialog::addQuote(int id1, int id2, DialogTextAlign align,
const Common::Point &pt, Font *font) {
- Common::String msg = _vm->_game->getQuote(id1);
+ Common::String msg = _vm->_game->getQuote(id1).c_str(); // c_str() because we need a copy
- if (id2 > 0) {
- msg += " ";
+ if (id2 > 0)
msg += _vm->_game->getQuote(id2);
- }
addLine(msg, align, pt, font);
}
@@ -643,6 +701,10 @@ void ScreenDialog::addLine(const Common::String &msg, DialogTextAlign align,
int xOffset;
switch (align) {
+ case ALIGN_NONE:
+ // No adjustment
+ break;
+
case ALIGN_CENTER:
xOffset = (MADS_SCREEN_WIDTH / 2) - font->getWidth(msg, -1) / 2;
line->_pos.x += xOffset;
@@ -655,6 +717,10 @@ void ScreenDialog::addLine(const Common::String &msg, DialogTextAlign align,
xOffset = (MADS_SCREEN_WIDTH / 2) - font->getWidth(
Common::String(msgP, ch), line->_widthAdjust);
line->_pos.x += xOffset;
+
+ Common::String newMsg = msg.c_str();
+ newMsg.deleteChar(ch - msgP);
+ line->_msg = newMsg;
}
break;
}
@@ -672,7 +738,7 @@ void ScreenDialog::addLine(const Common::String &msg, DialogTextAlign align,
}
void ScreenDialog::initVars() {
- _v1 = -1;
+ _tempLine = -1;
_selectedLine = -1;
_lineIndex = 0;
_textLineCount = 0;
@@ -704,11 +770,17 @@ void ScreenDialog::chooseBackground() {
void ScreenDialog::setFrame(int frameNumber, int depth) {
Scene &scene = _vm->_game->_scene;
+ SpriteAsset *menuSprites = scene._sprites[_menuSpritesIndex];
+ MSprite *frame = menuSprites->getFrame(frameNumber - 1);
+
SpriteSlot &spriteSlot = scene._spriteSlots[scene._spriteSlots.add()];
spriteSlot._flags = IMG_UPDATE;
spriteSlot._seqIndex = 1;
spriteSlot._spritesIndex = _menuSpritesIndex;
spriteSlot._frameNumber = frameNumber;
+ spriteSlot._position = frame->_offset;
+ spriteSlot._depth = depth;
+ spriteSlot._scale = 100;
}
void ScreenDialog::show() {
@@ -716,13 +788,13 @@ void ScreenDialog::show() {
while (_selectedLine < 1 && !_vm->shouldQuit()) {
handleEvents();
- if (_v3) {
- if (!_v1)
- _v1 = -1;
+ if (_redrawFlag) {
+ if (!_tempLine)
+ _tempLine = -1;
refreshText();
scene.drawElements(_vm->_game->_fx, _vm->_game->_fx);
- _v3 = false;
+ _redrawFlag = false;
}
_vm->_events->waitForNextFrame();
@@ -734,7 +806,7 @@ void ScreenDialog::handleEvents() {
ScreenObjects &screenObjects = _vm->_game->_screenObjects;
EventsManager &events = *_vm->_events;
Nebular::DialogsNebular &dialogs = *(Nebular::DialogsNebular *)_vm->_dialogs;
- int v1 = _v1;
+ int tempLine = _tempLine;
// Mark all the lines as initially unselected
for (uint i = 0; i < _lines.size(); ++i)
@@ -746,7 +818,7 @@ void ScreenDialog::handleEvents() {
// Scan for objects in the dialog
int objIndex = screenObjects.scan(events.currentPos() - _vm->_screen._offset, LAYER_GUI);
- if (_v2) {
+ if (_movedFlag) {
int yp = events.currentPos().y - _vm->_screen._offset.y;
if (yp < screenObjects[1]._bounds.top) {
if (!events._mouseReleased)
@@ -762,7 +834,7 @@ void ScreenDialog::handleEvents() {
}
int line = -1;
- if (objIndex > 0 || events._mouseButtons) {
+ if (objIndex > 0 && (events._mouseStatus || events._mouseReleased)) {
line = screenObjects[objIndex]._descId;
if (dialogs._pendingDialog == DIALOG_SAVE || dialogs._pendingDialog == DIALOG_RESTORE) {
if (line > 7 && line <= 14) {
@@ -770,9 +842,9 @@ void ScreenDialog::handleEvents() {
line -= 7;
}
- int v2 = (line > 0 && line < 8) ? 1 : 0;
+ bool movedFlag = line > 0 && line < 8;
if (events._mouseMoved)
- _v2 = v2;
+ _movedFlag = movedFlag;
}
if (screenObjects[objIndex]._category == CAT_COMMAND) {
@@ -786,14 +858,14 @@ void ScreenDialog::handleEvents() {
line = -1;
if (events._mouseReleased) {
- if (!_v2 || line <= 18)
+ if (!_movedFlag || line <= 18)
_selectedLine = line;
- _v3 = true;
+ _redrawFlag = true;
}
- _v1 = line;
- if (v1 == line || _selectedLine >= 0)
- _v3 = true;
+ _tempLine = line;
+ if (tempLine != line || _selectedLine >= 0)
+ _redrawFlag = true;
}
void ScreenDialog::refreshText() {
@@ -861,13 +933,13 @@ void DifficultyDialog::show() {
switch (_selectedLine) {
case 1:
- game._difficulty = Nebular::DIFFICULTY_HARD;
+ game._difficulty = Nebular::DIFFICULTY_EASY;
break;
case 2:
game._difficulty = Nebular::DIFFICULTY_MEDIUM;
break;
case 3:
- game._difficulty = Nebular::DIFFICULTY_EASY;
+ game._difficulty = Nebular::DIFFICULTY_HARD;
break;
default:
_vm->quitGame();
@@ -878,14 +950,153 @@ void DifficultyDialog::show() {
GameMenuDialog::GameMenuDialog(MADSEngine *vm) : ScreenDialog(vm) {
setFrame(1, 2);
+ setLines();
+ setClickableLines();
}
-void GameMenuDialog::addLines() {
- initVars();
+void GameMenuDialog::setLines() {
Font *font = _vm->_font->getFont(FONT_CONVERSATION);
- int top = 78 - (font->getHeight() + 2) * 12;
- addQuote(10, 0, ALIGN_CENTER, Common::Point(0, top), font);
- // TODO
+
+ int yp = 64 - ((font->getHeight() + 1) * 4 + 6) / 2;
+
+ addQuote(10, 0, ALIGN_CENTER, Common::Point(0, yp), font);
+ yp += 6;
+
+ for (int id = 11; id <= 15; ++id) {
+ yp += font->getHeight();
+ addQuote(id, 0, ALIGN_CENTER, Common::Point(0, yp));
+ }
+}
+
+void GameMenuDialog::show() {
+ ScreenDialog::show();
+
+ switch (_selectedLine) {
+ case 1:
+ _vm->_dialogs->_pendingDialog = DIALOG_SAVE;
+ _vm->_dialogs->showDialog();
+ break;
+ case 2:
+ _vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
+ _vm->_dialogs->showDialog();
+ break;
+ case 3:
+ _vm->_dialogs->_pendingDialog = DIALOG_OPTIONS;
+ _vm->_dialogs->showDialog();
+ break;
+ case 4:
+ // Resume game
+ break;
+ case 5:
+ default:
+ _vm->quitGame();
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+OptionsDialog::OptionsDialog(MADSEngine *vm) : ScreenDialog(vm) {
+ setFrame(2, 2);
+ setLines();
+ setClickableLines();
+}
+
+int OptionsDialog::getOptionQuote(int option) {
+ Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
+
+ // TODO: Hook the rest of the options to the current config
+ switch (option) {
+ case 17: // Music
+ return 24; // 24: ON, 25: OFF
+ case 18: // Sound
+ return 26; // 26: ON, 27: OFF
+ case 19: // Interface
+ return !_vm->_easyMouse ? 28 : 29; // 28: Standard, 29: Easy
+ case 20: // Inventory
+ return _vm->_invObjectsAnimated ? 30 : 31; // 30: Spinning, 31: Still
+ case 21: // Text window
+ return !_vm->_textWindowStill ? 32 : 33; // 32: Animated, 33: Still
+ case 22: // Screen fade
+ return 34 + _vm->_screenFade; // 34: Smooth, 35: Medium, 36: Fast
+ case 23: // Storyline
+ return (game._storyMode == STORYMODE_NAUGHTY) ? 37 : 38; // 37: Naughty, 38: Nice
+ default:
+ error("getOptionQuote: Unknown option");
+ }
+}
+
+void OptionsDialog::setLines() {
+ Font *font = _vm->_font->getFont(FONT_CONVERSATION);
+
+ int yp = 40 - ((font->getHeight() + 1) * 4 + 6) / 2;
+
+ addQuote(16, 0, ALIGN_CENTER, Common::Point(0, yp), font);
+ yp += 6;
+
+ for (int id = 17; id <= 23; ++id) {
+ yp += font->getHeight();
+ addQuote(id, getOptionQuote(id), ALIGN_AT_CENTER, Common::Point(0, yp));
+ }
+
+ yp += 28;
+ addQuote(1, 0, ALIGN_NONE, Common::Point(90, yp));
+ addQuote(2, 0, ALIGN_NONE, Common::Point(190, yp));
+}
+
+void OptionsDialog::show() {
+ Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
+ do {
+ _selectedLine = 0;
+ ScreenDialog::show();
+
+ switch (_selectedLine) {
+ case 1: // Music
+ warning("STUB: Music toggle");
+ break;
+ case 2: // Sound
+ warning("STUB: Sound toggle");
+ break;
+ case 3: // Interface
+ _vm->_easyMouse = !_vm->_easyMouse;
+ break;
+ case 4: // Inventory
+ _vm->_invObjectsAnimated = !_vm->_invObjectsAnimated;
+ break;
+ case 5: // Text window
+ _vm->_textWindowStill = !_vm->_textWindowStill;
+ break;
+ case 6: // Screen fade
+ if (_vm->_screenFade == SCREEN_FADE_FAST)
+ _vm->_screenFade = SCREEN_FADE_MEDIUM;
+ else if (_vm->_screenFade == SCREEN_FADE_MEDIUM)
+ _vm->_screenFade = SCREEN_FADE_SMOOTH;
+ else
+ _vm->_screenFade = SCREEN_FADE_FAST;
+ break;
+ case 7: // Storyline
+ game._storyMode = (game._storyMode == STORYMODE_NAUGHTY) ? STORYMODE_NICE : STORYMODE_NAUGHTY;
+ break;
+ default:
+ break;
+ }
+
+ // Reload menu
+ _lineIndex = -1;
+ clearLines();
+ setLines();
+ setClickableLines();
+ } while (_selectedLine <= 7);
+
+ switch (_selectedLine) {
+ case 8: // Done
+ // TODO: Copy from temporary config
+ break;
+ case 9: // Cancel
+ // TODO: Ignore all changes to temporary config
+ break;
+ default:
+ break;
+ }
}
} // End of namespace Nebular
diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h
index a144ee9d83..44412797a1 100644
--- a/engines/mads/nebular/dialogs_nebular.h
+++ b/engines/mads/nebular/dialogs_nebular.h
@@ -46,6 +46,10 @@ private:
bool textNoun(Common::String &dest, int nounId, const Common::String &source);
bool commandCheck(const char *idStr, Common::String &valStr, const Common::String &command);
+
+ void showScummVMSaveDialog();
+ void showScummVMRestoreDialog();
+
public:
virtual void showDialog();
@@ -99,7 +103,7 @@ public:
virtual ~PictureDialog();
};
-enum DialogTextAlign { ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, ALIGN_RIGHT = -3 };
+enum DialogTextAlign { ALIGN_NONE = 0, ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, ALIGN_RIGHT = -3 };
enum DialogState { DLGSTATE_UNSELECTED = 0, DLGSTATE_SELECTED = 1, DLGSTATE_FOCUSED = 2 };
@@ -119,9 +123,9 @@ class ScreenDialog {
protected:
MADSEngine *_vm;
Common::Array<DialogLine> _lines;
- int _v1;
- int _v2;
- bool _v3;
+ int _tempLine;
+ bool _movedFlag;
+ bool _redrawFlag;
int _selectedLine;
bool _dirFlag;
int _screenId;
@@ -182,7 +186,7 @@ public:
/**
* Destructor
*/
- virtual ~ScreenDialog() {}
+ virtual ~ScreenDialog();
/**
* Show the dialog
@@ -193,7 +197,7 @@ public:
class DifficultyDialog : public ScreenDialog {
private:
/**
- * Set the lines for the dialog
+ * Set the lines for the dialog
*/
void setLines();
public:
@@ -208,12 +212,36 @@ public:
class GameMenuDialog : public ScreenDialog {
private:
/**
- * Add the lines for the Game Menu dialog
+ * Set the lines for the dialog
*/
- void addLines();
+ void setLines();
public:
GameMenuDialog(MADSEngine *vm);
+ /**
+ * Show the dialog
+ */
+ virtual void show();
+};
+
+class OptionsDialog : public ScreenDialog {
+private:
+ /**
+ * Set the lines for the dialog
+ */
+ void setLines();
+
+ /**
+ * Gets the quote to be shown for an option
+ */
+ int getOptionQuote(int option);
+public:
+ OptionsDialog(MADSEngine *vm);
+
+ /**
+ * Show the dialog
+ */
+ virtual void show();
};
} // End of namespace Nebular
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index d6d7a07e52..8fddf8b9c4 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -22,6 +22,7 @@
#include "common/scummsys.h"
#include "common/config-manager.h"
+#include "graphics/scaler.h"
#include "mads/mads.h"
#include "mads/game.h"
#include "mads/screen.h"
@@ -310,6 +311,11 @@ void GameNebular::setSectionHandler() {
void GameNebular::checkShowDialog() {
if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) {
_player.releasePlayerSprites();
+
+ // Make a thumbnail in case it's needed for making a savegame
+ _vm->_game->createThumbnail();
+
+ // Show the dialog
_vm->_dialogs->showDialog();
_vm->_dialogs->_pendingDialog = DIALOG_NONE;
}
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index 6039135794..14f36756de 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -1121,8 +1121,6 @@ void Scene804::actions() {
} else {
_action._inProgress = false;
- //saveGame("REX000.SAV");
-
_vm->_dialogs->show(80424);
_pullThrottleReally = true;
_scene->_kernelMessages.add(Common::Point(78, 75), 0x1110, 0, 0,
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index ffeed6cda8..639f297f86 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -346,7 +346,7 @@ void Scene::loop() {
// Handle drawing a game frame
doFrame();
- // TODO: Verify correctness of frame wait
+ // Wait for the next frame
_vm->_events->waitForNextFrame();
if (_vm->_dialogs->_pendingDialog != DIALOG_NONE && !_vm->_game->_trigger
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 7e8710db56..ab5dff56ff 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -212,9 +212,11 @@ void DirtyAreas::copy(MSurface *srcSurface, MSurface *destSurface, const Common:
Common::Rect bounds(srcBounds.left + posAdjust.x, srcBounds.top + posAdjust.y,
srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y);
+ Common::Point destPos(bounds.left + _vm->_screen._offset.x,
+ bounds.top + _vm->_screen._offset.y);
if ((*this)[i]._active && bounds.isValidRect()) {
- srcSurface->copyTo(destSurface, bounds, Common::Point(bounds.left, bounds.top));
+ srcSurface->copyTo(destSurface, bounds, destPos);
}
}
}
@@ -628,21 +630,28 @@ void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag
case kTransitionBoxInBottomRight:
case kTransitionBoxInTopLeft:
case kTransitionBoxInTopRight:
- error("TODO: transition");
+ warning("TODO: box transition");
+ transition(kTransitionFadeIn, surfaceFlag);
break;
case kTransitionPanLeftToRight:
case kTransitionPanRightToLeft:
- error("TODO: transition");
+ warning("TODO: pan transition");
+ transition(kTransitionFadeIn, surfaceFlag);
+ break;
case kTransitionCircleIn1:
case kTransitionCircleIn2:
case kTransitionCircleIn3:
case kTransitionCircleIn4:
- error("TODO circle transition");
+ warning("TODO circle transition");
+ transition(kTransitionFadeIn, surfaceFlag);
+ break;
case kCenterVertTransition:
- error("TODO: center vert transition");
+ warning("TODO: center vert transition");
+ transition(kTransitionFadeIn, surfaceFlag);
+ break;
default:
// Quick transitions
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index cd358077b5..2bf13eeb5a 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -331,6 +331,8 @@ void SpriteSlots::drawSprites(MSurface *s) {
xp = slot._position.x - (sprite->w / 2) - scene._posAdjust.x;
yp = slot._position.y - sprite->h - scene._posAdjust.y + 1;
}
+ xp += _vm->_screen._offset.x;
+ yp += _vm->_screen._offset.y;
if (slot._depth > 1) {
// Draw the frame with depth processing
diff --git a/engines/neverhood/graphics.cpp b/engines/neverhood/graphics.cpp
index 939428ed19..89792d2659 100644
--- a/engines/neverhood/graphics.cpp
+++ b/engines/neverhood/graphics.cpp
@@ -114,7 +114,15 @@ void BaseSurface::drawMouseCursorResource(MouseCursorResource &mouseCursorResour
}
void BaseSurface::copyFrom(Graphics::Surface *sourceSurface, int16 x, int16 y, NDrawRect &sourceRect) {
- // Copy a rectangle from sourceSurface, no clipping is performed, 0 is the transparent color
+ // Copy a rectangle from sourceSurface, 0 is the transparent color
+ // Clipping is performed against the right/bottom border since x, y will always be >= 0
+
+ if (x + sourceRect.width > _surface->w)
+ sourceRect.width = _surface->w - x - 1;
+
+ if (y + sourceRect.height > _surface->h)
+ sourceRect.height = _surface->h - y - 1;
+
byte *source = (byte*)sourceSurface->getBasePtr(sourceRect.x, sourceRect.y);
byte *dest = (byte*)_surface->getBasePtr(x, y);
int height = sourceRect.height;
diff --git a/engines/neverhood/modules/module1600_sprites.cpp b/engines/neverhood/modules/module1600_sprites.cpp
index 09e3d0afe1..6a4de86517 100644
--- a/engines/neverhood/modules/module1600_sprites.cpp
+++ b/engines/neverhood/modules/module1600_sprites.cpp
@@ -30,6 +30,8 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
createSurface(200, 556, 328);
_x = x;
_y = y;
+ _destX = x;
+ _destY = y;
_inMainArea = false;
_exitDirection = 0;
@@ -48,6 +50,7 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
_soundCounter = 0;
_pathPoints = NULL;
_currMoveDirection = 0;
+ _newMoveDirection = 0;
startAnimation(0xD4220027, 0, -1);
setDoDeltaX(getGlobalVar(V_CAR_DELTA_X));
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 72187a1a13..2f72e7a13c 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -595,6 +595,30 @@ static const SAGAGameDescription gameDescriptions[] = {
ITEPatch_Files,
},
+ // Inherit the earth - Chinese Disk version
+ {
+ {
+ "ite",
+ "Floppy",
+ {
+ {"ite.rsc", GAME_RESOURCEFILE, "8f4315a9bb10ec839253108a032c8b54", 8901704},
+ {"scripts.rsc", GAME_SCRIPTFILE, "516f7330f8410057b834424ea719d1ef", 281071},
+ { NULL, 0, NULL, 0}
+ },
+ Common::ZH_CNA,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NOSPEECH)
+ },
+ GID_ITE,
+ GF_ITE_FLOPPY,
+ ITE_DEFAULT_SCENE,
+ &ITE_Resources,
+ ARRAYSIZE(ITE_GameFonts),
+ ITE_GameFonts,
+ ITEPatch_Files,
+ },
+
// ITE Amiga versions /////////////////////////////////////////////////////////////////////////////////////
// TODO: Add the Amiga versions here (not supported yet)
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index ae80f306af..8accf39129 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Fri Sep 27 05:44:12 2013
+ This file was generated by the md5table tool on Wed Jun 25 09:07:50 2014
DO NOT EDIT MANUALLY!
*/
@@ -194,6 +194,7 @@ static const MD5Table md5table[] = {
{ "45152f7cf2ba8f43cf8a8ea2e740ae09", "monkey", "VGA", "VGA", 8357, Common::ES_ESP, Common::kPlatformDOS },
{ "4521138d15d1fd7649c31fb981746231", "pajama2", "HE 98.5", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown },
{ "4522564b3c31aaf218b6a96826a549fd", "maze", "HE 99", "", -1, Common::EN_USA, Common::kPlatformWindows },
+ { "45adb5065e77559196dc0477e0f91fb9", "freddi3", "HE 99", "", -1, Common::EN_GRB, Common::kPlatformWindows },
{ "46b53fd430adcfbed791b48a0d4b079f", "funpack", "", "", -1, Common::EN_ANY, Common::kPlatformDOS },
{ "470c45b636139bb40716daa1c7edaad0", "loom", "EGA", "EGA", -1, Common::DE_DEU, Common::kPlatformDOS },
{ "477dbafbd66a53c98416dc01aef019ad", "monkey", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformDOS },
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index de79630376..8c6369a790 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -233,7 +233,7 @@ uint RenderedImage::getPixel(int x, int y) {
// -----------------------------------------------------------------------------
bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, uint color, int width, int height, RectangleList *updateRects) {
- _surface.blit(*_backSurface, posX, posY, flipping, pPartRect, color, width, height);
+ _surface.blit(*_backSurface, posX, posY, (((flipping & 1) ? Graphics::FLIP_V : 0) | ((flipping & 2) ? Graphics::FLIP_H : 0)), pPartRect, color, width, height);
return true;
}
diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index ca26b2679a..efb28149a5 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -35,9 +35,13 @@
*
*/
-// TODO: Find a better solution for this.
-#define TS_RGB(R,G,B) (((R) << 24) | ((G) << 16) | (B << 8) | (A)
+#ifdef SCUMM_LITTLE_ENDIAN
+#define TS_RGB(R,G,B) ((0xff << 24) | ((R) << 16) | ((G) << 8) | (B))
#define TS_ARGB(A,R,G,B) (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#else
+#define TS_RGB(R,G,B) (((R) << 24) | ((G) << 16) | (B << 8) | 0xff)
+#define TS_ARGB(A,R,G,B) (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#endif
namespace Graphics {
diff --git a/ports.mk b/ports.mk
index 21ad738373..32b1e67b5c 100644
--- a/ports.mk
+++ b/ports.mk
@@ -341,33 +341,5 @@ ifdef DIST_FILES_ENGINEDATA
endif
cp $(DIST_FILES_DOCS) $(AOS4PATH)
-#
-# PlayStation 3 specific
-#
-ps3pkg: $(EXECUTABLE)
- $(STRIP) $(EXECUTABLE)
- sprxlinker $(EXECUTABLE)
- mkdir -p ps3pkg/USRDIR/data/
- mkdir -p ps3pkg/USRDIR/doc/
- mkdir -p ps3pkg/USRDIR/saves/
- make_self_npdrm "$(EXECUTABLE)" ps3pkg/USRDIR/EBOOT.BIN UP0001-SCUM12000_00-0000000000000000
- cp $(DIST_FILES_THEMES) ps3pkg/USRDIR/data/
-ifdef DIST_FILES_ENGINEDATA
- cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/
-endif
- cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/
- cp $(srcdir)/dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/
- cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/
- cp $(srcdir)/dists/ps3/ICON0.PNG ps3pkg/
- cp $(srcdir)/dists/ps3/PIC1.PNG ps3pkg/
- sfo.py -f $(srcdir)/dists/ps3/sfo.xml ps3pkg/PARAM.SFO
- pkg.py --contentid UP0001-SCUM12000_00-0000000000000000 ps3pkg/ scummvm-ps3.pkg
-
-ps3run: $(EXECUTABLE)
- $(STRIP) $(EXECUTABLE)
- sprxlinker $(EXECUTABLE)
- make_self $(EXECUTABLE) $(EXECUTABLE).self
- ps3load $(EXECUTABLE).self
-
# Mark special targets as phony
-.PHONY: deb bundle osxsnap win32dist install uninstall ps3pkg ps3run
+.PHONY: deb bundle osxsnap win32dist install uninstall