summaryrefslogtreecommitdiff
path: root/noncore/games/qasteroids/view.cpp
Unidiff
Diffstat (limited to 'noncore/games/qasteroids/view.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/qasteroids/view.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/noncore/games/qasteroids/view.cpp b/noncore/games/qasteroids/view.cpp
index 3a4d410..6cab700 100644
--- a/noncore/games/qasteroids/view.cpp
+++ b/noncore/games/qasteroids/view.cpp
@@ -21,19 +21,19 @@
21 * 21 *
22 * Part of the KDE project 22 * Part of the KDE project
23 */ 23 */
24 24
25#include "view.h" 25#include "view.h"
26 26
27#include <qpe/resource.h> 27#include <opie2/oresource.h>
28 28#include <qpe/qpeapplication.h>
29 29
30#include <stdlib.h> 30#include <stdlib.h>
31#include <math.h> 31#include <math.h>
32 32
33#define IMG_BACKGROUND "qasteroids/bg.png" 33#define IMG_BACKGROUND "qasteroids/bg"
34 34
35#define REFRESH_DELAY 33 35#define REFRESH_DELAY 33
36#define SHIP_SPEED 0.3 36#define SHIP_SPEED 0.3
37#define MISSILE_SPEED 10.0 37#define MISSILE_SPEED 10.0
38#define SHIP_STEPS 64 38#define SHIP_STEPS 64
39#define ROTATE_RATE 2 39#define ROTATE_RATE 2
@@ -92,14 +92,13 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
92 rocks.setAutoDelete( TRUE ); 92 rocks.setAutoDelete( TRUE );
93 missiles.setAutoDelete( TRUE ); 93 missiles.setAutoDelete( TRUE );
94 bits.setAutoDelete( TRUE ); 94 bits.setAutoDelete( TRUE );
95 powerups.setAutoDelete( TRUE ); 95 powerups.setAutoDelete( TRUE );
96 exhaust.setAutoDelete( TRUE ); 96 exhaust.setAutoDelete( TRUE );
97 97
98 QPixmap pm( Resource::loadPixmap(IMG_BACKGROUND) ); 98 field.setBackgroundPixmap( Opie::Core::OResource::loadPixmap(IMG_BACKGROUND) );
99 field.setBackgroundPixmap( pm );
100 99
101 textSprite = new QCanvasText( &field ); 100 textSprite = new QCanvasText( &field );
102 QFont font( "helvetica", 14 ); 101 QFont font( "helvetica", 14 );
103 textSprite->setFont( font ); 102 textSprite->setFont( font );
104 103
105 shield = 0; 104 shield = 0;
@@ -245,16 +244,13 @@ void KAsteroidsView::brake( bool b )
245} 244}
246 245
247// - - - 246// - - -
248 247
249void KAsteroidsView::readSprites() 248void KAsteroidsView::readSprites()
250{ 249{
251 QString sprites_prefix = Resource::findPixmap( IMG_BACKGROUND ); 250 QString sprites_prefix = QPEApplication::qpeDir() + "pics/qasteroids";
252 int sep = sprites_prefix.findRev( "/" );
253
254 sprites_prefix.truncate( sep );
255 251
256 int i = 0; 252 int i = 0;
257 while ( kas_animations[i].id ) 253 while ( kas_animations[i].id )
258 { 254 {
259 animation.insert( kas_animations[i].id, 255 animation.insert( kas_animations[i].id,
260 new QCanvasPixmapArray( sprites_prefix + "/" + kas_animations[i].path, 256 new QCanvasPixmapArray( sprites_prefix + "/" + kas_animations[i].path,