summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/qasteroids/toplevel.cpp9
-rw-r--r--noncore/games/qasteroids/view.cpp14
2 files changed, 10 insertions, 13 deletions
diff --git a/noncore/games/qasteroids/toplevel.cpp b/noncore/games/qasteroids/toplevel.cpp
index 9053d3d..d1e1fac 100644
--- a/noncore/games/qasteroids/toplevel.cpp
+++ b/noncore/games/qasteroids/toplevel.cpp
@@ -23,14 +23,15 @@
*/
// --- toplevel.cpp ---
#include "toplevel.h"
#include "ledmeter.h"
+#include <opie2/oresource.h>
+
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlcdnumber.h>
#include <sys/utsname.h>
@@ -182,13 +183,13 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
teleportsLCD->setFixedHeight( 18 );
hbd->addWidget( teleportsLCD );
hbd->addSpacing( 10 );
*/
label = new QLabel( mainWin );
- label->setPixmap( Resource::loadPixmap("qasteroids/powerups/brake.png") );
+ label->setPixmap( Opie::Core::OResource::loadPixmap("qasteroids/powerups/brake.png") );
label->setFixedWidth( 16 );
label->setPalette( pal );
hbd->addWidget( label );
brakesLCD = new QLCDNumber( 1, mainWin );
brakesLCD->setFrameStyle( QFrame::NoFrame );
@@ -197,13 +198,13 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
brakesLCD->setFixedHeight( 16 );
hbd->addWidget( brakesLCD );
hbd->addSpacing( 5 );
label = new QLabel( mainWin );
- label->setPixmap( Resource::loadPixmap("qasteroids/powerups/shield.png") );
+ label->setPixmap( Opie::Core::OResource::loadPixmap("qasteroids/powerups/shield.png") );
label->setFixedWidth( 16 );
label->setPalette( pal );
hbd->addWidget( label );
shieldLCD = new QLCDNumber( 1, mainWin );
shieldLCD->setFrameStyle( QFrame::NoFrame );
@@ -212,13 +213,13 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *_name, WFlags fl )
shieldLCD->setFixedHeight( 16 );
hbd->addWidget( shieldLCD );
hbd->addSpacing( 5 );
label = new QLabel( mainWin );
- label->setPixmap( Resource::loadPixmap("qasteroids/powerups/shoot.png") );
+ label->setPixmap( Opie::Core::OResource::loadPixmap("qasteroids/powerups/shoot.png") );
label->setFixedWidth( 16 );
label->setPalette( pal );
hbd->addWidget( label );
shootLCD = new QLCDNumber( 1, mainWin );
shootLCD->setFrameStyle( QFrame::NoFrame );
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 @@
*
* 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
@@ -92,14 +92,13 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
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;
@@ -245,16 +244,13 @@ void KAsteroidsView::brake( bool 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,