author | drw <drw> | 2005-05-21 20:11:55 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-21 20:11:55 (UTC) |
commit | afb929e7fd04ecdfec2799a5cf9cf298d1af77c6 (patch) (side-by-side diff) | |
tree | 5db439fca569cf1349220f3fbbf155405d13a80d | |
parent | d56ca82c22c3ac6b7dfb0bb7b4d5a0e5ad1ff4f1 (diff) | |
download | opie-afb929e7fd04ecdfec2799a5cf9cf298d1af77c6.zip opie-afb929e7fd04ecdfec2799a5cf9cf298d1af77c6.tar.gz opie-afb929e7fd04ecdfec2799a5cf9cf298d1af77c6.tar.bz2 |
Resource -> OResource
-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 @@ -1,42 +1,42 @@ #include "backgammon.h" #include "aidialog.h" #include "filedialog.h" #include "playerdialog.h" #include "rulesdialog.h" #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> #include <qlayout.h> #include <qmessagebox.h> #include <qtimer.h> #include <qmenubar.h> #include <stdlib.h> 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(); //load the default theme Config conf("backgammon"); if(!conf.isValid()) { odebug << "config file does not exist" << oendl; conf.setGroup("general"); conf.writeEntry("theme","default"); @@ -160,57 +160,57 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) } connect(move,SIGNAL(done_dice1()),this,SLOT(done_dice1())); connect(move,SIGNAL(done_dice2()),this,SLOT(done_dice2())); connect(move,SIGNAL(done_dice3()),this,SLOT(done_dice3())); connect(move,SIGNAL(done_dice4()),this,SLOT(done_dice4())); connect(move,SIGNAL(nomove()),this,SLOT(nomove())); connect(move,SIGNAL(player_finished(int)),this,SLOT(finished(int))); //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); for(a=0;a<15;a++) { p1[a]=new CanvasImageItem(piece_1_front,area); p1[a]->setSize(15,15); p1_side[a]=new CanvasImageItem(piece_1_side,area); p1_side[a]->setSize(15,5); p2[a]=new CanvasImageItem(piece_2_front,area); p2[a]->setSize(15,15); p2_side[a]=new CanvasImageItem(piece_2_side,area); p2_side[a]->setSize(15,5); } 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++) { QImage dicebgA=dicebgA_all.copy(a*25,0,25,25); diceA1[a]=new CanvasImageItem(dicebgA,area); diceA1[a]->setX(5); diceA1[a]->setY(205-2); diceA1[a]->setZ(1); diceA1[a]->setSize(25,25); diceA2[a]=new CanvasImageItem(dicebgA,area); @@ -238,43 +238,43 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) oddsDice[a]=new CanvasImageItem(oddsbg,area); oddsDice[a]->setX(110); oddsDice[a]->setY(210-2); oddsDice[a]->setZ(1); oddsDice[a]->setSize(15,15); oddsDice[a]->hide(); } */ } //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); nomove_marker->hide(); //default human against computer player1_auto=false; player2_auto=true; //start new game newgame(); } @@ -915,52 +915,52 @@ void BackGammon::setplayer() void BackGammon::autoroll_dice1() { mouse(20,210); } void BackGammon::autoroll_dice2() { mouse(170,210); } 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; for(a=0;a<15;a++) { p1[a]->setImage(piece_1_front); p1_side[a]->setImage(piece_1_side); p2[a]->setImage(piece_2_front); 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); diceA1[a]->setImage(dicebgA); diceA2[a]->setImage(dicebgA); QImage dicebgB=dicebgB_all.copy(a*25,0,25,25); diceB1[a]->setImage(dicebgB); diceB2[a]->setImage(dicebgB); /* if(a<6) 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 @@ -14,26 +14,26 @@ ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "fifteen.h" #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> #include <qaction.h> #include <qpainter.h> #include <qmessagebox.h> #include <qtoolbar.h> #include <qmenubar.h> #include <qimage.h> #include <stdlib.h> @@ -43,57 +43,49 @@ FifteenMainWindow::FifteenMainWindow(QWidget *parent, const char* name, WFlags f : QMainWindow( parent, name, fl ) { // random seed srand(time(0)); setCaption( tr("Fifteen Pieces") ); QToolBar *toolbar = new QToolBar(this); 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 ); setToolBarsMovable( FALSE ); QVBox *vbox = new QVBox( this ); PiecesTable *table = new PiecesTable( vbox ); 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 ); } /////////////// /////// Pieces table Implementation /////// PiecesTable::PiecesTable(QWidget* parent, const char* name ) : QTableView(parent, name), _menu(0), _randomized(false), _dialog( 0l ) { 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 @@ -11,25 +11,26 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "mindbreaker.h" -#include <qtopia/resource.h> +#include <opie2/oresource.h> + #include <qtopia/config.h> #include <qtopia/qpeapplication.h> #include <qtoolbar.h> #include <qtoolbutton.h> #include <qmessagebox.h> #include <qlayout.h> #include <qtimer.h> #include <stdlib.h> #include <sys/time.h> #include <unistd.h> @@ -130,43 +131,43 @@ private: int pegtype; int peg_go; int peg_pos; int aniStep; }; int Peg::eggLevel = 0; 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; normalPegs.resize(10); for (i = 0; i < 6; i++) { normalPegs.insert(i, new QImage(pegs.copy(x, y, peg_size, peg_size). smoothScale(adjusted_peg_size, adjusted_peg_size) )); x += peg_size; } specialPegs.resize(5); for (i = 0; i < 5; i++) { specialPegs.insert(i, new QImage(pegs.copy(x,y,peg_size, peg_size). 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, new QImage( image.copy(x, y, panel_width, panel_height). smoothScale( adjusted_panel_width, adjusted_panel_height) )); y += panel_height; y += title_height; normalPegs.insert(9, new QImage(image.copy(x, y, title_width, title_height). smoothScale( adjusted_title_width, adjusted_title_height) @@ -280,27 +281,27 @@ MindBreaker::MindBreaker( QWidget *parent, const char *name, int wFlags ) hb->addStretch(); board = new MindBreakerBoard(w); hb->addWidget( board, 100 ); hb->addStretch(); setCentralWidget(w); setToolBarsMovable( FALSE ); 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); score->setUsesTextLabel(TRUE); tb->setStretchableWidget(score); connect(board, SIGNAL(scoreChanged(int,int)), this, SLOT(setScore(int,int))); connect(score, SIGNAL(clicked()), board, SLOT(resetScore())); int a, b; board->getScore(&a, &b); @@ -474,25 +475,25 @@ void MindBreakerBoard::doFixSize() if (s.height() < adjusted_board_height) s.setHeight(adjusted_board_height); */ if ( current_highlight ) // non-first resize writeConfig(); 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; panelImage = image.copy(x, y, panel_width, panel_height). smoothScale( adjusted_panel_width, adjusted_panel_height); y += panel_height; y += panel_height; titleImage = image.copy(x, y, title_width, title_height). smoothScale( adjusted_title_width, adjusted_title_height); 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 @@ -1,10 +1,10 @@ Package: opie-mindbreaker Files: plugins/application/libmindbreaker.so* bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker 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 @@ -12,26 +12,27 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #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> #include <qpushbutton.h> #include <qlcdnumber.h> #include <qtimer.h> #include <qlabel.h> #include <stdlib.h> #include <time.h> @@ -233,25 +234,25 @@ protected: private: MineField *field; }; MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) : QMainWindow( parent, name, 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 ); QMenuBar *menuBar = new QMenuBar( toolBar ); QPopupMenu *gameMenu = new QPopupMenu( this ); gameMenu->insertItem( tr("Beginner"), this, SLOT( beginner() ) ); gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) ); if (qApp->desktop()->width() >= 240) { gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); 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 @@ -11,36 +11,35 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "codes.h" #include "base.h" -#include <qtopia/resource.h> - +#include <opie2/oresource.h> int damage; Base::Base(QCanvas* canvas) : QCanvasSprite(0, 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); move(2, canvas->height()-50); setZ(10); show(); damage = 0; } void Base::damageBase() { 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 @@ -14,37 +14,38 @@ ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "codes.h" #include "bullet.h" #include "man.h" #include "helicopter.h" -#include <qpe/resource.h> +#include <opie2/oresource.h> + #include <qpe/qmath.h> int limit; int shotcount; 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); dy = 0; dx = 0; show(); setXY(angle); setVelocity(-dx, -dy); bang.play(); } else return; 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 @@ -9,39 +9,38 @@ ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include <qtopia/resource.h> - +#include <opie2/oresource.h> #include "codes.h" #include "cannon.h" Cannon::Cannon(QCanvas* canvas) : QCanvasSprite(0, canvas) { 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); reposition(); movedir = NoDir; moveDelay = 0; setAnimated(TRUE); show(); } 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 @@ -13,37 +13,37 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "helicopter.h" #include "man.h" #include "codes.h" -#include <qtopia/resource.h> +#include <opie2/oresource.h> static QList<Helicopter> all; Helicopter::Helicopter(QCanvas* canvas) : QCanvasSprite(0, canvas), chikachika("aland01") { 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); setAnimated(true); move(canvas->width(), 5); setVelocity(-2, 0); chikachika.playLoop(); show(); } Helicopter::~Helicopter() 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 @@ -12,26 +12,27 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "interface.h" #include "man.h" +#include <opie2/oresource.h> + #include <qtopia/qpeapplication.h> -#include <qtopia/resource.h> #include <qtoolbar.h> #include <qtoolbutton.h> ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : QMainWindow(parent,name,f), canvas( 232, 258 ), cannon(NULL), base(NULL), gamestopped( true ), waitover( false ), fanfare("level_up"), @@ -43,26 +44,27 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : updatespeed = 80; canvas.setAdvancePeriod(80); pb = new QCanvasView(&canvas, this); pb->setFocus(); setToolBarsMovable( FALSE ); 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 ); toolbar->setStretchableWidget( levelscore ); showScore(0,0); setCentralWidget(pb); autoDropTimer = new QTimer(this); connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) ); @@ -70,25 +72,25 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); setFocusPolicy(StrongFocus); } 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); canvas.setBackgroundPixmap(bgpixmap); if (base) { base->reposition(); } if (cannon) { cannon->reposition(); 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 @@ -13,50 +13,49 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #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); mancount++; dead = false; start(); } 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); setFrame(5); setZ(300); show(); static bool first_time = TRUE; if (first_time) { first_time = FALSE; QTime midnight(0, 0, 0); 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 @@ -11,25 +11,25 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #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> #if defined( QT_QWS_CASSIOPEIA ) #define SLOW_HARDWARE #endif // Seems to be fast enough to me even without Transformations in the library //#if defined( QT_NO_TRANSFORMATIONS ) && defined( QT_QWS_IPAQ ) //#define SLOW_HARDWARE @@ -90,79 +90,83 @@ QPixmap *CanvasCard::cardsFaces = NULL; QPixmap *CanvasCard::cardsBacks = NULL; QBitmap *CanvasCard::cardsChars = NULL; QBitmap *CanvasCard::cardsSuits = NULL; QBitmap *CanvasCard::cardsCharsUpsideDown = NULL; QBitmap *CanvasCard::cardsSuitsUpsideDown = NULL; 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 ); } xOff = cardsFaces->width() / 2; yOff = cardsFaces->height() / 2; setSize( cardsFaces->width(), cardsFaces->height() ); setPen( NoPen ); flipping = FALSE; } void CanvasCard::setCardBack(int b) { if ( cardBack != b ) { cardBack = b; if ( cardsBacks ) delete cardsBacks; 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() ) redraw(); } } void CanvasCard::draw(QPainter &painter) { int ix = (int)x(), iy = (int)y(); @@ -172,35 +176,26 @@ void CanvasCard::draw(QPainter &painter) if ((scaleX <= 0.98) || (scaleY <= 0.98)) { p = new QPainter(); unscaledCard = new QPixmap( cardsFaces->width(), cardsFaces->height() ); p->begin(unscaledCard); ix = 0; iy = 0; } 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 ) ); else p->setPen( QColor( 0, 0, 0 ) ); if ( qt_screen->deviceWidth() < 200 ) { p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); p->drawPixmap( ix + 3, iy + 3, *cardsChars, 5*(getValue()-1), 0, 5, 6 ); p->drawPixmap( ix + 11, iy + 3, *cardsSuits, 5*(getSuit()-1), 0, 5, 6 ); p->drawPixmap( ix + w-3-5, iy + h-3-6, *cardsCharsUpsideDown, 5*(12-getValue()+1), 0, 5, 6 ); 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 @@ -15,25 +15,24 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef CANVAS_CARD_GAME_H #define CANVAS_CARD_GAME_H #include "cardgame.h" #include "canvasshapes.h" #include "canvascard.h" -#include <qpe/resource.h> #include <qpe/config.h> #include <qmainwindow.h> #include <qmenubar.h> #include <qpainter.h> #include <stdlib.h> #include <time.h> class CanvasCardPile; 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 @@ -15,42 +15,41 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "canvascardwindow.h" #include "freecellcardgame.h" #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 ) { // canvas.setBackgroundColor(QColor(0x51, 0x74, 0x6B)); // 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 ) canvas.setAdvancePeriod(70); #else canvas.setAdvancePeriod(30); #endif #ifdef _PATIENCE_USE_ACCELS_ QMenuBar* menu = menuBar(); 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 @@ -12,25 +12,25 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qtetrix.h" -#include <qpe/resource.h> +#include <opie2/oresource.h> #include <qlabel.h> #include <qdatetime.h> #include <qlayout.h> #include <qtimer.h> #include "ohighscoredlg.h" void drawTetrixButton( QPainter *p, int x, int y, int w, int h, const QColor *color ) { @@ -88,25 +88,25 @@ void ShowNextPiece::drawNextSquare(int x, int y,QColor *color) QPainter paint; paint.begin(this); drawTetrixButton( &paint, xOffset+x*blockWidth, yOffset+y*blockHeight, blockWidth, blockHeight, color ); paint.end(); } 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())/ (24+60+60) ); QWidget *gameArea = new QWidget( this ); setCentralWidget( gameArea ); QGridLayout *gl = new QGridLayout( gameArea, 5, 3, 8 ); gl->setColStretch( 1, 5 ); gl->setColStretch( 2, 10 ); 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 @@ -12,26 +12,27 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #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> #include <qcombobox.h> #include <qdir.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qtextstream.h> #include <qtimer.h> #include <qtoolbar.h> #include <qtoolbutton.h> @@ -109,38 +110,45 @@ const char* sampleWGR= WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent, name, fl) { if ( qApp->desktop()->width() < 240 ) { tile_smallw = 10; tile_smallh = 10; tile_bigw = 16; tile_bigh = 16; 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; bag = 0; racks = 0; aiheart = new QTimer(this); connect(aiheart, SIGNAL(timeout()), this, SLOT(think())); readConfig(); } @@ -296,25 +304,25 @@ bool WordGame::loadRules(const QString &name) QString line; ts >> line; rule_shapes += line; } static int rule_effects[12]; int re=0,e; ts >> e; while ( e && re < 10 ) { 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); rule_effects[re++] = 100; // default bonus board = new Board(bgshapes, htiles, vtiles, vbox); board->setRules(rule_shapes, rule_effects); connect(board, SIGNAL(temporaryScore(int)), scoreinfo, SLOT(showTemporaryScore(int))); bag = new Bag; int count; @@ -1353,25 +1361,25 @@ void Rack::contentsMouseMoveEvent(QMouseEvent* e) if ( computerized() ) return; //int w = TileItem::bigWidth()+2; if ( dragging ) { dragging_adj = TileItem::bigWidth()/2; if ( dragging->x() > e->x()-dragstart.x() ) dragging_adj = -dragging_adj; dragging->move(e->x()-dragstart.x(),0); layoutTiles(); } } -void Rack::contentsMouseReleaseEvent(QMouseEvent* e) +void Rack::contentsMouseReleaseEvent(QMouseEvent* /*e*/) { if ( computerized() ) return; if ( dragging ) { dragging=0; layoutTiles(); } } Tile::Tile(const QString& key) { int a=key.find('@'); 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 @@ -8,25 +8,25 @@ email : Roman.Razilov@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ -#include <qpe/resource.h> +#include <opie2/oresource.h> #include "ballpainter.h" //#include "shotcounter.h" #include <qpainter.h> //#include <qcolor.h> #define PIXSIZE 21 int colorLinesArr[NCOLORS] = {0x0000ff, 0x00ff00, 0xff0000, 0x00ffff, 0xff00ff, 0xffff00, 0x005080}; // 0x00bbggrr @@ -50,25 +50,25 @@ QPixmap* BallPainter::pixmap( enum Pixmaps pix ) switch(pix) { case Field: name = QString::fromLatin1("zlines/field"); break; case Balls: name = QString::fromLatin1("zlines/balls"); break; case Fire: name = QString::fromLatin1("zlines/fire"); break; } - return new QPixmap(Resource::loadPixmap(name) ); + return new QPixmap(Opie::Core::OResource::loadPixmap(name) ); } void BallPainter::createPixmap() { // warning( kapp->kde_datadir() +"/klines/data/balls.bmp"); backgroundPix = pixmap(Field); QPixmap *balls = pixmap(Balls); QPixmap *fire = pixmap(Fire); if (balls->isNull() ||backgroundPix->isNull() || fire->isNull() ) fatal("Cannot open data files.\nHave you correctly installed klines?"); warning("Pixsize %i", PIXSIZE); |