summaryrefslogtreecommitdiff
path: root/noncore/games/parashoot/cannon.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/parashoot/cannon.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/parashoot/cannon.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/games/parashoot/cannon.cpp b/noncore/games/parashoot/cannon.cpp
index 3c0a5fe..5671351 100644
--- a/noncore/games/parashoot/cannon.cpp
+++ b/noncore/games/parashoot/cannon.cpp
@@ -1,10 +1,10 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
@@ -15,13 +15,13 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
-#include <qpe/resource.h>
+#include <qtopia/resource.h>
#include <qregexp.h>
#include "codes.h"
#include "cannon.h"
@@ -35,16 +35,15 @@ shotsfired=0;
cannonarray = new QCanvasPixmapArray();
QString c0 = Resource::findPixmap("parashoot/can0001");
c0.replace(QRegExp("0001"),"%1");
cannonarray->readPixmaps(c0,17);
setSequence(cannonarray);
setFrame(index);
- move(canvas->width()/2-20, canvas->height()-32);
- // co ords for barrel of cannon when upright
- barrelypos = canvas->height()-32;
- barrelxpos = canvas->width()/2;
+
+ reposition();
+
movedir = NoDir;
moveDelay = 0;
setAnimated(TRUE);
show();
}
@@ -135,6 +134,17 @@ Cannon::~Cannon()
}
int Cannon::rtti() const
{
return cannon_rtti;
}
+
+void Cannon::reposition(void)
+{
+ move(canvas()->width()/2-20, canvas()->height()-32);
+ // co ords for barrel of cannon when upright
+ barrelypos = canvas()->height()-32;
+ barrelxpos = canvas()->width()/2;
+
+ setFrame(index);
+ setCoords();
+}