summaryrefslogtreecommitdiff
path: root/noncore/games/qasteroids/view.cpp
Side-by-side diff
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
@@ -15,31 +15,31 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************//*
* KAsteroids - Copyright (c) Martin R. Jones 1997
*
* Part of the KDE project
*/
#include "view.h"
-#include <qpe/resource.h>
-
+#include <opie2/oresource.h>
+#include <qpe/qpeapplication.h>
#include <stdlib.h>
#include <math.h>
-#define IMG_BACKGROUND "qasteroids/bg.png"
+#define IMG_BACKGROUND "qasteroids/bg"
#define REFRESH_DELAY 33
#define SHIP_SPEED 0.3
#define MISSILE_SPEED 10.0
#define SHIP_STEPS 64
#define ROTATE_RATE 2
#define SHIELD_ON_COST 1
#define SHIELD_HIT_COST 30
#define BRAKE_ON_COST 4
#define MAX_ROCK_SPEED 2.5
#define MAX_POWERUP_SPEED 1.5
@@ -86,26 +86,25 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
: QWidget( parent, name ),
field(200, 200),
view(&field,this)
{
view.setVScrollBarMode( QScrollView::AlwaysOff );
view.setHScrollBarMode( QScrollView::AlwaysOff );
rocks.setAutoDelete( TRUE );
missiles.setAutoDelete( TRUE );
bits.setAutoDelete( TRUE );
powerups.setAutoDelete( TRUE );
exhaust.setAutoDelete( TRUE );
- QPixmap pm( Resource::loadPixmap(IMG_BACKGROUND) );
- field.setBackgroundPixmap( pm );
+ field.setBackgroundPixmap( Opie::Core::OResource::loadPixmap(IMG_BACKGROUND) );
textSprite = new QCanvasText( &field );
QFont font( "helvetica", 14 );
textSprite->setFont( font );
shield = 0;
shieldOn = FALSE;
refreshRate = REFRESH_DELAY;
readSprites();
shieldTimer = new QTimer( this );
@@ -239,28 +238,25 @@ void KAsteroidsView::brake( bool b )
thrustShip = FALSE;
rotateRate = ROTATE_RATE;
}
brakeShip = b;
}
}
// - - -
void KAsteroidsView::readSprites()
{
- QString sprites_prefix = Resource::findPixmap( IMG_BACKGROUND );
- int sep = sprites_prefix.findRev( "/" );
-
- sprites_prefix.truncate( sep );
+ QString sprites_prefix = QPEApplication::qpeDir() + "pics/qasteroids";
int i = 0;
while ( kas_animations[i].id )
{
animation.insert( kas_animations[i].id,
new QCanvasPixmapArray( sprites_prefix + "/" + kas_animations[i].path,
kas_animations[i].frames ) );
i++;
}
ship = new QCanvasSprite( animation[ID_SHIP], &field );
ship->hide();