X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=ship.cpp;h=85f0c8b64ae65c6ae45a82e19ad6a40241876557;hb=01cbfac4e5fd656a5cb6700d430b87f636a32914;hp=040e776484253eec93fff1b26ab60acc0d7e567c;hpb=0493211fef444777dca7855c0346c914fae47667;p=ghostsoverboard
diff --git a/ship.cpp b/ship.cpp
index 040e776..85f0c8b 100644
--- a/ship.cpp
+++ b/ship.cpp
@@ -1,12 +1,43 @@
+/**************************************************************************
+ Ghosts Overboard - a game for Maemo 5
+
+ Copyright (C) 2011 Heli Hyvättinen
+
+ This file is part of Ghosts Overboard
+
+ Ghosts Overboard 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, see .
+
+**************************************************************************/
+
+
#include "ship.h"
#include
+#include
+#include
+#include
+
+
+
+QTM_USE_NAMESPACE
+
Ship::Ship(QList pixmapList, QGraphicsItem *parent) :
OrientationControlledGraphicsPixmapObject(pixmapList.at(0),parent)
{
shipImages_ = pixmapList;
ghostsAboard_ = 0;
-
+ vibrationActive_ = false;
}
bool Ship::handleCollisions()
@@ -64,5 +95,37 @@ void Ship::dropAllGhosts()
emit droppingGhosts(ghostsAboard_);
ghostsAboard_ = 0;
updateShipImage();
+
+ //vibrate
+
+ if (vibrationActive_)
+ {
+
+ // This is for fremantle
+// QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.mce","/com/nokia/mce/request","com.nokia.mce.request","req_vibrator_pattern_activate");
+
+// QList arguments;
+
+// arguments.append("PatternChatAndEmail");
+
+// message.setArguments(arguments);
+
+// message = QDBusConnection::systemBus().call(message);
+
+ //qDebug() << message;
+
+
+ //This is for Harmattan
+
+ QFeedbackHapticsEffect vibrationEffect;
+ vibrationEffect.setDuration(1000);
+ vibrationEffect.setIntensity(1.0);
+ vibrationEffect.start();
+
+ }
}
+void Ship::setVibrationActivate(bool on)
+{
+ vibrationActive_ = on;
+}