-rw-r--r-- | noncore/games/parashoot/base.cpp | 5 | ||||
-rw-r--r-- | noncore/games/parashoot/bullet.cpp | 5 | ||||
-rw-r--r-- | noncore/games/parashoot/cannon.cpp | 5 | ||||
-rw-r--r-- | noncore/games/parashoot/helicopter.cpp | 4 | ||||
-rw-r--r-- | noncore/games/parashoot/interface.cpp | 10 | ||||
-rw-r--r-- | noncore/games/parashoot/man.cpp | 7 |
6 files changed, 18 insertions, 18 deletions
diff --git a/noncore/games/parashoot/base.cpp b/noncore/games/parashoot/base.cpp index 5f3c79d..f232536 100644 --- a/noncore/games/parashoot/base.cpp +++ b/noncore/games/parashoot/base.cpp | |||
@@ -17,24 +17,23 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "codes.h" | 20 | #include "codes.h" |
21 | #include "base.h" | 21 | #include "base.h" |
22 | 22 | ||
23 | #include <qtopia/resource.h> | 23 | #include <opie2/oresource.h> |
24 | |||
25 | 24 | ||
26 | int damage; | 25 | int damage; |
27 | 26 | ||
28 | Base::Base(QCanvas* canvas) : | 27 | Base::Base(QCanvas* canvas) : |
29 | QCanvasSprite(0, canvas), | 28 | QCanvasSprite(0, canvas), |
30 | kaboom("landmine"), | 29 | kaboom("landmine"), |
31 | ohdear("crmble01") | 30 | ohdear("crmble01") |
32 | { | 31 | { |
33 | basearray = new QCanvasPixmapArray(); | 32 | basearray = new QCanvasPixmapArray(); |
34 | QString b0 = Resource::findPixmap("parashoot/b0001"); | 33 | QString b0 = Opie::Core::OResource::findPixmap("parashoot/b0001"); |
35 | b0.replace(QRegExp("0001"),"%1"); | 34 | b0.replace(QRegExp("0001"),"%1"); |
36 | basearray->readPixmaps(b0, 4); | 35 | basearray->readPixmaps(b0, 4); |
37 | setSequence(basearray); | 36 | setSequence(basearray); |
38 | setFrame(0); | 37 | setFrame(0); |
39 | move(2, canvas->height()-50); | 38 | move(2, canvas->height()-50); |
40 | setZ(10); | 39 | setZ(10); |
diff --git a/noncore/games/parashoot/bullet.cpp b/noncore/games/parashoot/bullet.cpp index 584f564..1f02251 100644 --- a/noncore/games/parashoot/bullet.cpp +++ b/noncore/games/parashoot/bullet.cpp | |||
@@ -20,25 +20,26 @@ | |||
20 | 20 | ||
21 | #include "codes.h" | 21 | #include "codes.h" |
22 | #include "bullet.h" | 22 | #include "bullet.h" |
23 | #include "man.h" | 23 | #include "man.h" |
24 | #include "helicopter.h" | 24 | #include "helicopter.h" |
25 | 25 | ||
26 | #include <qpe/resource.h> | 26 | #include <opie2/oresource.h> |
27 | |||
27 | #include <qpe/qmath.h> | 28 | #include <qpe/qmath.h> |
28 | 29 | ||
29 | 30 | ||
30 | int limit; | 31 | int limit; |
31 | int shotcount; | 32 | int shotcount; |
32 | int nobullets; | 33 | int nobullets; |
33 | 34 | ||
34 | Bullet::Bullet(QCanvas* canvas, double angle, int cannonx, int cannony) : | 35 | Bullet::Bullet(QCanvas* canvas, double angle, int cannonx, int cannony) : |
35 | QCanvasSprite(0, canvas), | 36 | QCanvasSprite(0, canvas), |
36 | bang("collide01") | 37 | bang("collide01") |
37 | { | 38 | { |
38 | QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Resource::findPixmap("parashoot/bullet")); | 39 | QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Opie::Core::OResource::findPixmap("parashoot/bullet")); |
39 | setSequence(bulletarray); | 40 | setSequence(bulletarray); |
40 | if (nobullets < limit) { | 41 | if (nobullets < limit) { |
41 | nobullets++; | 42 | nobullets++; |
42 | move(cannonx, cannony); | 43 | move(cannonx, cannony); |
43 | dy = 0; | 44 | dy = 0; |
44 | dx = 0; | 45 | dx = 0; |
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 | |||
@@ -15,27 +15,26 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qtopia/resource.h> | 21 | #include <opie2/oresource.h> |
22 | |||
23 | 22 | ||
24 | #include "codes.h" | 23 | #include "codes.h" |
25 | #include "cannon.h" | 24 | #include "cannon.h" |
26 | 25 | ||
27 | Cannon::Cannon(QCanvas* canvas) : | 26 | Cannon::Cannon(QCanvas* canvas) : |
28 | QCanvasSprite(0, canvas) | 27 | QCanvasSprite(0, canvas) |
29 | { | 28 | { |
30 | shotsfired=0; | 29 | shotsfired=0; |
31 | index = 8; | 30 | index = 8; |
32 | cannonx = 0; | 31 | cannonx = 0; |
33 | cannony = 0; | 32 | cannony = 0; |
34 | cannonarray = new QCanvasPixmapArray(); | 33 | cannonarray = new QCanvasPixmapArray(); |
35 | QString c0 = Resource::findPixmap("parashoot/can0001"); | 34 | QString c0 = Opie::Core::OResource::findPixmap("parashoot/can0001"); |
36 | c0.replace(QRegExp("0001"),"%1"); | 35 | c0.replace(QRegExp("0001"),"%1"); |
37 | cannonarray->readPixmaps(c0,17); | 36 | cannonarray->readPixmaps(c0,17); |
38 | setSequence(cannonarray); | 37 | setSequence(cannonarray); |
39 | setFrame(index); | 38 | setFrame(index); |
40 | 39 | ||
41 | reposition(); | 40 | reposition(); |
diff --git a/noncore/games/parashoot/helicopter.cpp b/noncore/games/parashoot/helicopter.cpp index 7d91cd1..42adc34 100644 --- a/noncore/games/parashoot/helicopter.cpp +++ b/noncore/games/parashoot/helicopter.cpp | |||
@@ -19,25 +19,25 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "helicopter.h" | 21 | #include "helicopter.h" |
22 | #include "man.h" | 22 | #include "man.h" |
23 | #include "codes.h" | 23 | #include "codes.h" |
24 | 24 | ||
25 | #include <qtopia/resource.h> | 25 | #include <opie2/oresource.h> |
26 | 26 | ||
27 | 27 | ||
28 | static QList<Helicopter> all; | 28 | static QList<Helicopter> all; |
29 | 29 | ||
30 | Helicopter::Helicopter(QCanvas* canvas) : | 30 | Helicopter::Helicopter(QCanvas* canvas) : |
31 | QCanvasSprite(0, canvas), | 31 | QCanvasSprite(0, canvas), |
32 | chikachika("aland01") | 32 | chikachika("aland01") |
33 | { | 33 | { |
34 | all.append(this); | 34 | all.append(this); |
35 | hits = 0; | 35 | hits = 0; |
36 | QCanvasPixmapArray* helicopterarray = new QCanvasPixmapArray(); | 36 | QCanvasPixmapArray* helicopterarray = new QCanvasPixmapArray(); |
37 | QString h0 = Resource::findPixmap("parashoot/helicopter0001"); | 37 | QString h0 = Opie::Core::OResource::findPixmap("parashoot/helicopter0001"); |
38 | h0.replace(QRegExp("0001"),"%1"); | 38 | h0.replace(QRegExp("0001"),"%1"); |
39 | helicopterarray->readPixmaps(h0,4 ); | 39 | helicopterarray->readPixmaps(h0,4 ); |
40 | 40 | ||
41 | setSequence(helicopterarray); | 41 | setSequence(helicopterarray); |
42 | setAnimated(true); | 42 | setAnimated(true); |
43 | move(canvas->width(), 5); | 43 | move(canvas->width(), 5); |
diff --git a/noncore/games/parashoot/interface.cpp b/noncore/games/parashoot/interface.cpp index 5c9b0ef..8ec7032 100644 --- a/noncore/games/parashoot/interface.cpp +++ b/noncore/games/parashoot/interface.cpp | |||
@@ -18,14 +18,15 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "interface.h" | 21 | #include "interface.h" |
22 | #include "man.h" | 22 | #include "man.h" |
23 | 23 | ||
24 | #include <opie2/oresource.h> | ||
25 | |||
24 | #include <qtopia/qpeapplication.h> | 26 | #include <qtopia/qpeapplication.h> |
25 | #include <qtopia/resource.h> | ||
26 | 27 | ||
27 | #include <qtoolbar.h> | 28 | #include <qtoolbar.h> |
28 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
29 | 30 | ||
30 | ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | 31 | ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : |
31 | QMainWindow(parent,name,f), | 32 | QMainWindow(parent,name,f), |
@@ -49,14 +50,15 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | |||
49 | setToolBarsMovable( FALSE ); | 50 | setToolBarsMovable( FALSE ); |
50 | 51 | ||
51 | QToolBar* toolbar = new QToolBar(this); | 52 | QToolBar* toolbar = new QToolBar(this); |
52 | toolbar->setHorizontalStretchable( TRUE ); | 53 | toolbar->setHorizontalStretchable( TRUE ); |
53 | 54 | ||
54 | setCaption( tr("ParaShoot") ); | 55 | setCaption( tr("ParaShoot") ); |
55 | new QToolButton( Resource::loadIconSet("new"), tr("New Game"), 0, | 56 | QToolButton *btn = new QToolButton( Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon), |
56 | this, SLOT(newGame()), toolbar, "New Game"); | 57 | tr("New Game"), 0, this, SLOT(newGame()), toolbar, "New Game"); |
58 | btn->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); | ||
57 | 59 | ||
58 | levelscore = new QLabel(toolbar); | 60 | levelscore = new QLabel(toolbar); |
59 | levelscore->setBackgroundMode( PaletteButton ); | 61 | levelscore->setBackgroundMode( PaletteButton ); |
60 | levelscore->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); | 62 | levelscore->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); |
61 | toolbar->setStretchableWidget( levelscore ); | 63 | toolbar->setStretchableWidget( levelscore ); |
62 | showScore(0,0); | 64 | showScore(0,0); |
@@ -76,13 +78,13 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | |||
76 | void ParaShoot::resizeEvent(QResizeEvent *) | 78 | void ParaShoot::resizeEvent(QResizeEvent *) |
77 | { | 79 | { |
78 | QSize s = centralWidget()->size(); | 80 | QSize s = centralWidget()->size(); |
79 | int fw = style().defaultFrameWidth(); | 81 | int fw = style().defaultFrameWidth(); |
80 | canvas.resize( s.width() - fw - 2, s.height() - fw - 2); | 82 | canvas.resize( s.width() - fw - 2, s.height() - fw - 2); |
81 | 83 | ||
82 | QImage bgimage = Resource::loadImage("parashoot/sky"); | 84 | QImage bgimage = Opie::Core::OResource::loadImage("parashoot/sky"); |
83 | QPixmap bgpixmap; | 85 | QPixmap bgpixmap; |
84 | 86 | ||
85 | bgpixmap.convertFromImage(bgimage.smoothScale(canvas.width(), | 87 | bgpixmap.convertFromImage(bgimage.smoothScale(canvas.width(), |
86 | canvas.height()), QPixmap::Auto); | 88 | canvas.height()), QPixmap::Auto); |
87 | canvas.setBackgroundPixmap(bgpixmap); | 89 | canvas.setBackgroundPixmap(bgpixmap); |
88 | 90 | ||
diff --git a/noncore/games/parashoot/man.cpp b/noncore/games/parashoot/man.cpp index 0a151b0..080615e 100644 --- a/noncore/games/parashoot/man.cpp +++ b/noncore/games/parashoot/man.cpp | |||
@@ -19,23 +19,22 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "codes.h" | 21 | #include "codes.h" |
22 | #include "man.h" | 22 | #include "man.h" |
23 | #include "base.h" | 23 | #include "base.h" |
24 | 24 | ||
25 | #include <qtopia/resource.h> | 25 | #include <opie2/oresource.h> |
26 | |||
27 | 26 | ||
28 | int mancount; | 27 | int mancount; |
29 | 28 | ||
30 | Man::Man(QCanvas* canvas) : | 29 | Man::Man(QCanvas* canvas) : |
31 | QCanvasSprite(0, canvas), | 30 | QCanvasSprite(0, canvas), |
32 | splat("lose") // No tr | 31 | splat("lose") // No tr |
33 | { | 32 | { |
34 | manarray = new QCanvasPixmapArray(); | 33 | manarray = new QCanvasPixmapArray(); |
35 | QString m0 = Resource::findPixmap("parashoot/man0001"); | 34 | QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001"); |
36 | m0.replace(QRegExp("0001"),"%1"); | 35 | m0.replace(QRegExp("0001"),"%1"); |
37 | manarray->readPixmaps(m0, 7); | 36 | manarray->readPixmaps(m0, 7); |
38 | setSequence(manarray); | 37 | setSequence(manarray); |
39 | setAnimated(true); | 38 | setAnimated(true); |
40 | mancount++; | 39 | mancount++; |
41 | dead = false; | 40 | dead = false; |
@@ -44,13 +43,13 @@ Man::Man(QCanvas* canvas) : | |||
44 | 43 | ||
45 | Man::Man(QCanvas* canvas, int x, int y) : | 44 | Man::Man(QCanvas* canvas, int x, int y) : |
46 | QCanvasSprite(0, canvas), | 45 | QCanvasSprite(0, canvas), |
47 | splat("bang") // No tr | 46 | splat("bang") // No tr |
48 | { | 47 | { |
49 | manarray = new QCanvasPixmapArray(); | 48 | manarray = new QCanvasPixmapArray(); |
50 | QString m0 = Resource::findPixmap("parashoot/man0001"); | 49 | QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001"); |
51 | m0.replace(QString("0001"),"%1"); | 50 | m0.replace(QString("0001"),"%1"); |
52 | manarray->readPixmaps(m0, 7); | 51 | manarray->readPixmaps(m0, 7); |
53 | setSequence(manarray); | 52 | setSequence(manarray); |
54 | move(x, y); | 53 | move(x, y); |
55 | setFrame(5); | 54 | setFrame(5); |
56 | setZ(300); | 55 | setZ(300); |