-rw-r--r-- | noncore/games/backgammon/backgammon.cpp | 34 | ||||
-rw-r--r-- | noncore/games/fifteen/fifteen.cpp | 16 | ||||
-rw-r--r-- | noncore/games/mindbreaker/config.in | 2 | ||||
-rw-r--r-- | noncore/games/mindbreaker/mindbreaker.cpp | 15 | ||||
-rw-r--r-- | noncore/games/mindbreaker/opie-mindbreaker.control | 2 | ||||
-rw-r--r-- | noncore/games/minesweep/minesweep.cpp | 5 | ||||
-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 | ||||
-rw-r--r-- | noncore/games/solitaire/canvascard.cpp | 51 | ||||
-rw-r--r-- | noncore/games/solitaire/canvascardgame.h | 1 | ||||
-rw-r--r-- | noncore/games/solitaire/canvascardwindow.cpp | 7 | ||||
-rw-r--r-- | noncore/games/tetrix/qtetrix.cpp | 4 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 22 | ||||
-rw-r--r-- | noncore/games/zlines/ballpainter.cpp | 4 |
18 files changed, 97 insertions, 102 deletions
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp index c286a36..31835f8 100644 --- a/noncore/games/backgammon/backgammon.cpp +++ b/noncore/games/backgammon/backgammon.cpp @@ -6,11 +6,11 @@ #include "themedialog.h" /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> -#include <qpe/resource.h> using namespace Opie::Core; /* QT */ #include <qfile.h> @@ -26,9 +26,9 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) { if (!name) setName("BackGammon"); setCaption(tr( "Backgammon") ); - setIcon( Resource::loadPixmap( "backgammon" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "backgammon" ) ); //general counter varaible int a=0; //the game engine move=new MoveEngine(); @@ -168,15 +168,15 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) //the pieces p1=new CanvasImageItem*[15]; p1_side=new CanvasImageItem*[15]; - QImage piece_1_all(Resource::loadImage("backgammon/pieces/"+piecesA_name)); + QImage piece_1_all(Opie::Core::OResource::loadImage("backgammon/pieces/"+piecesA_name)); QImage piece_1_front=piece_1_all.copy(0,0,15,15); QImage piece_1_side=piece_1_all.copy(0,15,15,5); p2=new CanvasImageItem*[15]; p2_side=new CanvasImageItem*[15]; - QImage piece_2_all(Resource::loadImage("backgammon/pieces/"+piecesB_name)); + QImage piece_2_all(Opie::Core::OResource::loadImage("backgammon/pieces/"+piecesB_name)); QImage piece_2_front=piece_2_all.copy(0,0,15,15); QImage piece_2_side=piece_2_all.copy(0,15,15,5); @@ -194,15 +194,15 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) } draw(); //the dice - QImage dicebgA_all(Resource::loadImage("backgammon/dice/"+diceA_name)); + QImage dicebgA_all(Opie::Core::OResource::loadImage("backgammon/dice/"+diceA_name)); diceA1=new CanvasImageItem*[7]; diceA2=new CanvasImageItem*[7]; - QImage dicebgB_all(Resource::loadImage("backgammon/dice/"+diceB_name)); + QImage dicebgB_all(Opie::Core::OResource::loadImage("backgammon/dice/"+diceB_name)); diceB1=new CanvasImageItem*[7]; diceB2=new CanvasImageItem*[7]; - QImage oddsbg_all=(Resource::loadImage("backgammon/odds/"+odds_name)); + QImage oddsbg_all=(Opie::Core::OResource::loadImage("backgammon/odds/"+odds_name)); //oddsDice=new CanvasImageItem*[6]; for(a=0;a<7;a++) @@ -246,27 +246,27 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) } //oddsDice[0]->show(); //set the board - QImage boardbg(Resource::loadImage("backgammon/boards/"+board_name)); + QImage boardbg(Opie::Core::OResource::loadImage("backgammon/boards/"+board_name)); board=new CanvasImageItem(boardbg,area); board->setX(0); board->setY(0); board->setZ(0); board->setSize(235-2,200-2); board->show(); //the table - QImage tablebg(Resource::loadImage("backgammon/table/"+table_name)); + QImage tablebg(Opie::Core::OResource::loadImage("backgammon/table/"+table_name)); table=new CanvasImageItem(tablebg,area); table->setX(0); table->setY(200-2); table->setZ(0); table->setSize(235-2,20); table->show(); //the no move marker - QImage nomovebg(Resource::loadImage("backgammon/no_move")); + QImage nomovebg(Opie::Core::OResource::loadImage("backgammon/no_move")); nomove_marker=new CanvasImageItem(nomovebg,area); nomove_marker->setX(0); nomove_marker->setY(200); nomove_marker->setZ(2); @@ -923,19 +923,19 @@ void BackGammon::autoroll_dice2() } void BackGammon::applytheme() { - QImage boardbg(Resource::loadImage("backgammon/boards/"+board_name)); + QImage boardbg(Opie::Core::OResource::loadImage("backgammon/boards/"+board_name)); board->setImage(boardbg); - QImage tablebg(Resource::loadImage("backgammon/table/"+table_name)); + QImage tablebg(Opie::Core::OResource::loadImage("backgammon/table/"+table_name)); table->setImage(tablebg); - QImage piece_1_all(Resource::loadImage("backgammon/pieces/"+piecesA_name)); + QImage piece_1_all(Opie::Core::OResource::loadImage("backgammon/pieces/"+piecesA_name)); QImage piece_1_front=piece_1_all.copy(0,0,15,15); QImage piece_1_side=piece_1_all.copy(0,15,15,5); - QImage piece_2_all(Resource::loadImage("backgammon/pieces/"+piecesB_name)); + QImage piece_2_all(Opie::Core::OResource::loadImage("backgammon/pieces/"+piecesB_name)); QImage piece_2_front=piece_2_all.copy(0,0,15,15); QImage piece_2_side=piece_2_all.copy(0,15,15,5); int a=0; @@ -948,11 +948,11 @@ void BackGammon::applytheme() p2_side[a]->setImage(piece_2_side); } draw(); - QImage dicebgA_all(Resource::loadImage("backgammon/dice/"+diceA_name)); - QImage dicebgB_all(Resource::loadImage("backgammon/dice/"+diceB_name)); - QImage oddsbg_all=(Resource::loadImage("backgammon/odds/"+odds_name)); + QImage dicebgA_all(Opie::Core::OResource::loadImage("backgammon/dice/"+diceA_name)); + QImage dicebgB_all(Opie::Core::OResource::loadImage("backgammon/dice/"+diceB_name)); + QImage oddsbg_all=(Opie::Core::OResource::loadImage("backgammon/odds/"+odds_name)); for(a=0;a<7;a++) { QImage dicebgA=dicebgA_all.copy(a*25,0,25,25); diff --git a/noncore/games/fifteen/fifteen.cpp b/noncore/games/fifteen/fifteen.cpp index bb57ee1..c41c0a4 100644 --- a/noncore/games/fifteen/fifteen.cpp +++ b/noncore/games/fifteen/fifteen.cpp @@ -22,10 +22,10 @@ #include "fifteenconfigdialog.h" #include <opie2/ofileselector.h> +#include <opie2/oresource.h> -#include <qtopia/resource.h> #include <qtopia/config.h> #include <qtopia/qpeapplication.h> #include <qvbox.h> @@ -51,8 +51,9 @@ FifteenMainWindow::FifteenMainWindow(QWidget *parent, const char* name, WFlags f toolbar->setHorizontalStretchable( FALSE ); QMenuBar *menubar = new QMenuBar( toolbar ); menubar->setMargin(0); QPopupMenu *game = new QPopupMenu( this ); + menubar->insertItem( tr( "Game" ), game ); QWidget *spacer = new QWidget( toolbar ); spacer->setBackgroundMode( PaletteButton ); toolbar->setStretchableWidget( spacer ); @@ -64,28 +65,19 @@ FifteenMainWindow::FifteenMainWindow(QWidget *parent, const char* name, WFlags f setCentralWidget(vbox); - QAction *a = new QAction( tr( "Randomize" ), Resource::loadPixmap( "new" ), + QAction *a = new QAction( tr( "Randomize" ), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), table, SLOT( slotRandomize() ) ); a->addTo( game ); a->addTo( toolbar ); - a = new QAction( tr("Configure"), Resource::loadPixmap( "SettingsIcon" ), + a = new QAction( tr("Configure"), Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated()), table, SLOT( slotConfigure()) ); a->addTo( game ); - - /* This is pointless and confusing. - a = new QAction( tr( "Solve" ), Resource::loadIconSet( "repeat" ), - QString::null, 0, this, 0 ); - connect( a, SIGNAL( activated() ), table, SLOT( slotReset() ) ); - a->addTo( game ); - a->addTo( toolbar ); - */ - menubar->insertItem( tr( "Game" ), game ); } diff --git a/noncore/games/mindbreaker/config.in b/noncore/games/mindbreaker/config.in index b97a9e8..e3c0812 100644 --- a/noncore/games/mindbreaker/config.in +++ b/noncore/games/mindbreaker/config.in @@ -1,4 +1,4 @@ config MINDBREAKER boolean "opie-mindbreaker (crack the coloured code)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE diff --git a/noncore/games/mindbreaker/mindbreaker.cpp b/noncore/games/mindbreaker/mindbreaker.cpp index 1f554d2..aa4afd7 100644 --- a/noncore/games/mindbreaker/mindbreaker.cpp +++ b/noncore/games/mindbreaker/mindbreaker.cpp @@ -19,9 +19,10 @@ **********************************************************************/ #include "mindbreaker.h" -#include <qtopia/resource.h> +#include <opie2/oresource.h> + #include <qtopia/config.h> #include <qtopia/qpeapplication.h> #include <qtoolbar.h> @@ -138,9 +139,9 @@ QVector<QImage> Peg::normalPegs; QVector<QImage> Peg::specialPegs; void Peg::buildImages() { - QImage pegs = Resource::loadImage("mindbreaker/pegs"); + QImage pegs = Opie::Core::OResource::loadImage("mindbreaker/pegs"); int x = 0; int y = 0; int i; eggLevel = 0; @@ -156,9 +157,9 @@ void Peg::buildImages() smoothScale(adjusted_peg_size, adjusted_peg_size) )); x += peg_size; } - QImage image = Resource::loadImage("mindbreaker/mindbreaker"); + QImage image = Opie::Core::OResource::loadImage("mindbreaker/mindbreaker"); /* copy from master image to functional images */ x = 0; y = panel_height; normalPegs.insert(8, @@ -288,11 +289,11 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags ) QToolBar *tb = new QToolBar(this); tb->setHorizontalStretchable( TRUE ); - QIconSet newicon = Resource::loadIconSet("new"); - new QToolButton(newicon, tr("New Game"), 0, - board, SLOT(clear()), tb, "NewGame"); + QToolButton *btn = new QToolButton( Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon), tr("New Game"), 0, + board, SLOT(clear()), tb, "NewGame"); + btn->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); score = new QToolButton(tb); score->setText(""); score->setMaximumHeight(20); @@ -482,9 +483,9 @@ void MindBreakerBoard::doFixSize() setupBoardSize(s.width() - fw, s.height() - fw); canvas()->resize(s.width() - fw, s.height() - fw); Peg::buildImages(); // must be done BEFORE any pegs are made - QImage image = Resource::loadImage("mindbreaker/mindbreaker"); + QImage image = Opie::Core::OResource::loadImage("mindbreaker/mindbreaker"); /* copy from master image to functional images */ int x = 0; int y = 0; diff --git a/noncore/games/mindbreaker/opie-mindbreaker.control b/noncore/games/mindbreaker/opie-mindbreaker.control index 5b342da..d3826fd 100644 --- a/noncore/games/mindbreaker/opie-mindbreaker.control +++ b/noncore/games/mindbreaker/opie-mindbreaker.control @@ -3,8 +3,8 @@ Files: plugins/application/libmindbreaker.so* bin/mindbreaker apps/Games/mindbre Priority: optional Section: opie/games Maintainer: Martin Imobersteg <imm@gmx.ch> Architecture: arm -Depends: task-opie-minimal +Depends: task-opie-minimal, libopiecore2 Description: Game: crack the coloured code A game for the Opie environment. Version: $QPE_VERSION$EXTRAVERSION diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp index c14609d..18449ff 100644 --- a/noncore/games/minesweep/minesweep.cpp +++ b/noncore/games/minesweep/minesweep.cpp @@ -20,10 +20,11 @@ #include "minesweep.h" #include "minefield.h" +#include <opie2/oresource.h> + #include <qtopia/qpeapplication.h> -#include <qtopia/resource.h> #include <qtopia/config.h> #include <qtoolbar.h> #include <qmenubar.h> @@ -241,9 +242,9 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) { srand(::time(0)); setCaption( tr("Mine Sweep") ); QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); - setIcon( Resource::loadPixmap( "minesweep/MineSweep" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "minesweep/MineSweep" ) ); QToolBar *toolBar = new QToolBar( this ); toolBar->setHorizontalStretchable( TRUE ); 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 @@ -19,10 +19,9 @@ **********************************************************************/ #include "codes.h" #include "base.h" -#include <qtopia/resource.h> - +#include <opie2/oresource.h> int damage; Base::Base(QCanvas* canvas) : @@ -30,9 +29,9 @@ Base::Base(QCanvas* canvas) : kaboom("landmine"), ohdear("crmble01") { basearray = new QCanvasPixmapArray(); - QString b0 = Resource::findPixmap("parashoot/b0001"); + QString b0 = Opie::Core::OResource::findPixmap("parashoot/b0001"); b0.replace(QRegExp("0001"),"%1"); basearray->readPixmaps(b0, 4); setSequence(basearray); setFrame(0); 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 @@ -22,9 +22,10 @@ #include "bullet.h" #include "man.h" #include "helicopter.h" -#include <qpe/resource.h> +#include <opie2/oresource.h> + #include <qpe/qmath.h> int limit; @@ -34,9 +35,9 @@ int nobullets; Bullet::Bullet(QCanvas* canvas, double angle, int cannonx, int cannony) : QCanvasSprite(0, canvas), bang("collide01") { - QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Resource::findPixmap("parashoot/bullet")); + QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Opie::Core::OResource::findPixmap("parashoot/bullet")); setSequence(bulletarray); if (nobullets < limit) { nobullets++; move(cannonx, cannony); 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 @@ -17,10 +17,9 @@ ** not clear to you. ** **********************************************************************/ -#include <qtopia/resource.h> - +#include <opie2/oresource.h> #include "codes.h" #include "cannon.h" @@ -31,9 +30,9 @@ 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); 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 @@ -21,9 +21,9 @@ #include "helicopter.h" #include "man.h" #include "codes.h" -#include <qtopia/resource.h> +#include <opie2/oresource.h> static QList<Helicopter> all; @@ -33,9 +33,9 @@ Helicopter::Helicopter(QCanvas* canvas) : { all.append(this); hits = 0; QCanvasPixmapArray* helicopterarray = new QCanvasPixmapArray(); - QString h0 = Resource::findPixmap("parashoot/helicopter0001"); + QString h0 = Opie::Core::OResource::findPixmap("parashoot/helicopter0001"); h0.replace(QRegExp("0001"),"%1"); helicopterarray->readPixmaps(h0,4 ); setSequence(helicopterarray); 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 @@ -20,10 +20,11 @@ #include "interface.h" #include "man.h" +#include <opie2/oresource.h> + #include <qtopia/qpeapplication.h> -#include <qtopia/resource.h> #include <qtoolbar.h> #include <qtoolbutton.h> @@ -51,10 +52,11 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : QToolBar* toolbar = new QToolBar(this); toolbar->setHorizontalStretchable( TRUE ); setCaption( tr("ParaShoot") ); - new QToolButton( Resource::loadIconSet("new"), tr("New Game"), 0, - this, SLOT(newGame()), toolbar, "New Game"); + QToolButton *btn = new QToolButton( Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon), + tr("New Game"), 0, this, SLOT(newGame()), toolbar, "New Game"); + btn->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); levelscore = new QLabel(toolbar); levelscore->setBackgroundMode( PaletteButton ); levelscore->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); @@ -78,9 +80,9 @@ void ParaShoot::resizeEvent(QResizeEvent *) QSize s = centralWidget()->size(); int fw = style().defaultFrameWidth(); canvas.resize( s.width() - fw - 2, s.height() - fw - 2); - QImage bgimage = Resource::loadImage("parashoot/sky"); + QImage bgimage = Opie::Core::OResource::loadImage("parashoot/sky"); QPixmap bgpixmap; bgpixmap.convertFromImage(bgimage.smoothScale(canvas.width(), canvas.height()), QPixmap::Auto); 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 @@ -21,19 +21,18 @@ #include "codes.h" #include "man.h" #include "base.h" -#include <qtopia/resource.h> - +#include <opie2/oresource.h> int mancount; Man::Man(QCanvas* canvas) : QCanvasSprite(0, canvas), splat("lose") // No tr { manarray = new QCanvasPixmapArray(); - QString m0 = Resource::findPixmap("parashoot/man0001"); + QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001"); m0.replace(QRegExp("0001"),"%1"); manarray->readPixmaps(m0, 7); setSequence(manarray); setAnimated(true); @@ -46,9 +45,9 @@ Man::Man(QCanvas* canvas, int x, int y) : QCanvasSprite(0, canvas), splat("bang") // No tr { manarray = new QCanvasPixmapArray(); - QString m0 = Resource::findPixmap("parashoot/man0001"); + QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001"); m0.replace(QString("0001"),"%1"); manarray->readPixmaps(m0, 7); setSequence(manarray); move(x, y); diff --git a/noncore/games/solitaire/canvascard.cpp b/noncore/games/solitaire/canvascard.cpp index c36da6c..cd298ef 100644 --- a/noncore/games/solitaire/canvascard.cpp +++ b/noncore/games/solitaire/canvascard.cpp @@ -19,9 +19,9 @@ **********************************************************************/ #include "canvascard.h" -#include <qpe/resource.h> +#include <opie2/oresource.h> #include <qgfx_qws.h> // Needed to get the device's width #include <math.h> @@ -98,17 +98,21 @@ CanvasCard::CanvasCard( eValue v, eSuit s, bool f, QCanvas *canvas ) : Card(v, s, f), QCanvasRectangle( 0, 0, 1, 1, canvas ), cardBack(1), scaleX(1.0), scaleY(1.0) { if ( !cardsFaces ) { if ( qt_screen->deviceWidth() < 200 ) { - cardsFaces = new QPixmap( Resource::loadPixmap( "cards/card_face_small" ) ); - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001_small" ) ); - cardsChars = new QBitmap( Resource::loadBitmap( "cards/card_chars_small" ) ); - cardsSuits = new QBitmap( Resource::loadBitmap( "cards/card_suits_small" ) ); + cardsFaces = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_face_small" ) ); + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0001_small" ) ); + cardsChars = new QBitmap(); + *cardsChars = Opie::Core::OResource::loadPixmap( "cards/card_chars_small" ); + cardsSuits = new QBitmap(); + *cardsSuits = Opie::Core::OResource::loadPixmap( "cards/card_suits_small" ); } else { - cardsFaces = new QPixmap( Resource::loadPixmap( "cards/card_face" ) ); - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); - cardsChars = new QBitmap( Resource::loadBitmap( "cards/card_chars" ) ); - cardsSuits = new QBitmap( Resource::loadBitmap( "cards/card_suits" ) ); + cardsFaces = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_face" ) ); + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0001" ) ); + cardsChars = new QBitmap(); + *cardsChars = Opie::Core::OResource::loadPixmap( "cards/card_chars" ); + cardsSuits = new QBitmap(); + *cardsSuits = Opie::Core::OResource::loadPixmap( "cards/card_suits" ); } cardsCharsUpsideDown = Create180RotatedBitmap( cardsChars ); cardsSuitsUpsideDown = Create180RotatedBitmap( cardsSuits ); } @@ -131,30 +135,30 @@ void CanvasCard::setCardBack(int b) if ( qt_screen->deviceWidth() < 200 ) { switch (cardBack) { case 0: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001_small" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0001_small" ) ); break; case 1: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0002_small" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0002_small" ) ); break; case 2: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0003_small" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0003_small" ) ); break; case 3: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0004_small" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0004_small" ) ); break; case 4: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0005_small" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0005_small" ) ); break; } } else { switch (cardBack) { case 0: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0001" ) ); break; case 1: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0002" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0002" ) ); break; case 2: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0003" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0003" ) ); break; case 3: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0004" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0004" ) ); break; case 4: - cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0005" ) ); break; + cardsBacks = new QPixmap( Opie::Core::OResource::loadPixmap( "cards/card_back0005" ) ); break; } } if ( !isFacing() ) @@ -180,19 +184,10 @@ void CanvasCard::draw(QPainter &painter) } if ( isFacing() ) { -/* - // Now add the joker and card backs to the list of pixmaps - QPixmap *CardsBack = new QPixmap( Resource::loadPixmap( "cards/card_joker.png" ) ); - QPoint *newBackHotspot = new QPoint( 0, 0 ); - pixmaps->append((const QPixmap *)CardsBack); - hotspots->append((const QPoint *)newBackHotspot); -*/ - int w = cardsFaces->width(), h = cardsFaces->height(); -// p->setBrush( NoBrush ); p->setBrush( QColor( 0xFF, 0xFF, 0xFF ) ); if ( isRed() == TRUE ) p->setPen( QColor( 0xFF, 0, 0 ) ); diff --git a/noncore/games/solitaire/canvascardgame.h b/noncore/games/solitaire/canvascardgame.h index b93cfbf..c559a90 100644 --- a/noncore/games/solitaire/canvascardgame.h +++ b/noncore/games/solitaire/canvascardgame.h @@ -23,9 +23,8 @@ #include "cardgame.h" #include "canvasshapes.h" #include "canvascard.h" -#include <qpe/resource.h> #include <qpe/config.h> #include <qmainwindow.h> #include <qmenubar.h> diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp index 503bc92..956c5bd 100644 --- a/noncore/games/solitaire/canvascardwindow.cpp +++ b/noncore/games/solitaire/canvascardwindow.cpp @@ -23,16 +23,15 @@ #include "chicanecardgame.h" #include "harpcardgame.h" #include "teeclubcardgame.h" - - +#include <opie2/oresource.h> CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) : QMainWindow(parent, name, f), canvas(230, 260), snapOn(TRUE), cardBack(4), gameType(0), cardGame(NULL) { - setIcon( Resource::loadPixmap( "cards" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "cards" ) ); setCaption(tr("Patience")); // Create Playing Area for Games if ( QPixmap::defaultDepth() < 12 ) { @@ -40,9 +39,9 @@ CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) // canvas.setBackgroundColor(QColor(0x20, 0xb0, 0x50)); canvas.setBackgroundColor(QColor(0x08, 0x98, 0x2D)); } else { QPixmap bg; - bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither ); + bg.convertFromImage( Opie::Core::OResource::loadImage( "table_pattern" ), ThresholdDither ); canvas.setBackgroundPixmap(bg); } #if defined( QT_QWS_CASSIOPEIA ) diff --git a/noncore/games/tetrix/qtetrix.cpp b/noncore/games/tetrix/qtetrix.cpp index a6a5f34..d949176 100644 --- a/noncore/games/tetrix/qtetrix.cpp +++ b/noncore/games/tetrix/qtetrix.cpp @@ -20,9 +20,9 @@ #include "qtetrix.h" -#include <qpe/resource.h> +#include <opie2/oresource.h> #include <qlabel.h> #include <qdatetime.h> #include <qlayout.h> @@ -96,9 +96,9 @@ void ShowNextPiece::drawNextSquare(int x, int y,QColor *color) QTetrix::QTetrix( QWidget *parent, const char *name, WFlags f ) : QMainWindow( parent, name, f ) { - setIcon( Resource::loadPixmap( "tetrix_icon" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "tetrix_icon" ) ); setCaption( tr("Tetrix" ) ); QTime t = QTime::currentTime(); TetrixPiece::setRandomSeed( (((double)t.hour())+t.minute()+t.second())/ diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index 47d6725..52e2be2 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp @@ -20,10 +20,11 @@ #include "wordgame.h" +#include <opie2/oresource.h> + #include <qpe/global.h> -#include <qpe/resource.h> #include <qpe/config.h> #include <qapplication.h> #include <qmessagebox.h> @@ -117,22 +118,29 @@ WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : tile_stweak = 0; tile_btweak = 0; } - setIcon( Resource::loadPixmap( "wordgame/WordGame.png" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "wordgame/WordGame" ) ); setCaption( tr("Word Game") ); setToolBarsMovable( FALSE ); vbox = new QVBox(this); setCentralWidget(vbox); toolbar = new QToolBar(this); addToolBar(toolbar, Bottom); - reset = new QToolButton(Resource::loadPixmap("back"), tr("Back"), "", this, SLOT(resetTurn()), toolbar); - done = new QToolButton(Resource::loadPixmap("done"), tr("Done"), "", this, SLOT(endTurn()), toolbar); + bool useBigIcon = qApp->desktop()->size().width() > 330; + reset = new QToolButton(Opie::Core::OResource::loadPixmap("back", Opie::Core::OResource::SmallIcon), + tr("Back"), "", this, SLOT(resetTurn()), toolbar); + reset->setUsesBigPixmap( useBigIcon ); + done = new QToolButton(Opie::Core::OResource::loadPixmap("done", Opie::Core::OResource::SmallIcon), + tr("Done"), "", this, SLOT(endTurn()), toolbar); + done->setUsesBigPixmap( useBigIcon ); scoreinfo = new ScoreInfo(toolbar); scoreinfo->setFont(QFont("Helvetica",10)); - new QToolButton(Resource::loadPixmap("finish"), tr("Close"), "", this, SLOT(endGame()), toolbar); + QToolButton *btn = new QToolButton(Opie::Core::OResource::loadPixmap("finish", Opie::Core::OResource::SmallIcon), + tr("Close"), "", this, SLOT(endGame()), toolbar); + btn->setUsesBigPixmap( useBigIcon ); toolbar->setStretchableWidget(scoreinfo); cpu = 0; board = 0; @@ -304,9 +312,9 @@ bool WordGame::loadRules(const QString &name) rule_effects[re] = e; if ( re++ < 10 ) ts >> e; } - QImage shim = Resource::loadImage("wordgame/wordgame_shapes"); + QImage shim = Opie::Core::OResource::loadImage("wordgame/wordgame_shapes"); shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); QPixmap bgshapes; bgshapes.convertFromImage(shim); @@ -1361,9 +1369,9 @@ void Rack::contentsMouseMoveEvent(QMouseEvent* e) layoutTiles(); } } -void Rack::contentsMouseReleaseEvent(QMouseEvent* e) +void Rack::contentsMouseReleaseEvent(QMouseEvent* /*e*/) { if ( computerized() ) return; if ( dragging ) { diff --git a/noncore/games/zlines/ballpainter.cpp b/noncore/games/zlines/ballpainter.cpp index 622ec29..e7596c4 100644 --- a/noncore/games/zlines/ballpainter.cpp +++ b/noncore/games/zlines/ballpainter.cpp @@ -16,9 +16,9 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include <qpe/resource.h> +#include <opie2/oresource.h> #include "ballpainter.h" //#include "shotcounter.h" #include <qpainter.h> @@ -58,9 +58,9 @@ QPixmap* BallPainter::pixmap( enum Pixmaps pix ) name = QString::fromLatin1("zlines/fire"); break; } - return new QPixmap(Resource::loadPixmap(name) ); + return new QPixmap(Opie::Core::OResource::loadPixmap(name) ); } void BallPainter::createPixmap() { |