summaryrefslogtreecommitdiff
path: root/noncore/games/mindbreaker/mindbreaker.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/mindbreaker/mindbreaker.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/mindbreaker/mindbreaker.cpp13
1 files changed, 7 insertions, 6 deletions
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,
+ 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);