Diffstat (limited to 'noncore/games/parashoot/cannon.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/parashoot/cannon.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/noncore/games/parashoot/cannon.cpp b/noncore/games/parashoot/cannon.cpp index 330d850..2f4c353 100644 --- a/noncore/games/parashoot/cannon.cpp +++ b/noncore/games/parashoot/cannon.cpp @@ -1,83 +1,82 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** 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. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include <qtopia/resource.h> - +#include <opie2/oresource.h> #include "codes.h" #include "cannon.h" Cannon::Cannon(QCanvas* canvas) : QCanvasSprite(0, canvas) { shotsfired=0; index = 8; cannonx = 0; cannony = 0; cannonarray = new QCanvasPixmapArray(); - QString c0 = Resource::findPixmap("parashoot/can0001"); + QString c0 = Opie::Core::OResource::findPixmap("parashoot/can0001"); c0.replace(QRegExp("0001"),"%1"); cannonarray->readPixmaps(c0,17); setSequence(cannonarray); setFrame(index); reposition(); movedir = NoDir; moveDelay = 0; setAnimated(TRUE); show(); } void Cannon::advance(int stage) { if ( stage == 1 && moveDelay-- == 0 ) { if (movedir == Left) { if (index > 0) { setFrame(index-1); index--; } } if (movedir == Right) { if (index < 16) { setFrame(index+1); index++; } } moveDelay = 0; } } void Cannon::pointCannon(Direction dir) { movedir = dir; moveDelay = 0; advance(1); moveDelay = 1; } void Cannon::setCoords() { switch(index) { case 0: cannonx = barrelxpos-29; cannony = barrelypos-8; break; case 1: cannonx = barrelxpos-27; cannony = barrelypos-8; break; case 2: cannonx = barrelxpos-25; cannony = barrelypos-6; break; case 3: cannonx = barrelxpos-23; cannony = barrelypos-4; break; case 4: cannonx = barrelxpos-21; cannony = barrelypos-2; break; |