aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-09 23:30:25 +0200
committerEugene Sandulenko2014-01-10 00:42:20 +0200
commit919aca7f9be168fb7ba39ed76ec0d3b7fd51577e (patch)
treee4368b33155b36f9418a3380eadba392906d8bda /engines
parenta5b4db83522b6267dbd806f696bcde02eed03605 (diff)
downloadscummvm-rg350-919aca7f9be168fb7ba39ed76ec0d3b7fd51577e.tar.gz
scummvm-rg350-919aca7f9be168fb7ba39ed76ec0d3b7fd51577e.tar.bz2
scummvm-rg350-919aca7f9be168fb7ba39ed76ec0d3b7fd51577e.zip
FULLPIPE: Implement sceneHandler33_clickZones()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/scenes/scene33.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/engines/fullpipe/scenes/scene33.cpp b/engines/fullpipe/scenes/scene33.cpp
index 838cb526e8..35446f8fea 100644
--- a/engines/fullpipe/scenes/scene33.cpp
+++ b/engines/fullpipe/scenes/scene33.cpp
@@ -103,8 +103,31 @@ void sceneHandler33_handleDown() {
warning("STUB: sceneHandler33_handleDown(");
}
+void sceneHandler33_zoneClickProcess(StaticANIObject *ani) {
+ warning("STUB: sceneHandler33_zoneClickProcess()");
+}
+
void sceneHandler33_clickZones(ExCommand *cmd) {
- warning("STUB: sceneHandler33_clickZones(cmd)");
+ StaticANIObject *closest = 0;
+ double mindist = 1e10;
+
+ for (uint i = 0; i < g_fp->_currentScene->_staticANIObjectList1.size(); i++) {
+ StaticANIObject *ani = (StaticANIObject *)g_fp->_currentScene->_staticANIObjectList1[i];
+
+ if (ani->_id == ANI_VENT_33) {
+ int dx = ani->_ox - cmd->_sceneClickX;
+ int dy = ani->_oy - cmd->_sceneClickY;
+ double dist = sqrt((double)(dx * dx + dy * dy));
+
+ if (dist < mindist) {
+ mindist = dist;
+ closest = ani;
+ }
+ }
+ }
+
+ if (closest)
+ sceneHandler33_zoneClickProcess(closest);
}
int sceneHandler33(ExCommand *cmd) {