diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /ksnake/pixServer.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksnake/pixServer.cpp')
-rw-r--r-- | ksnake/pixServer.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/ksnake/pixServer.cpp b/ksnake/pixServer.cpp index bdc281ea..ac25f9be 100644 --- a/ksnake/pixServer.cpp +++ b/ksnake/pixServer.cpp @@ -25,9 +25,9 @@ #include "pixServer.h" -#include <qimage.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kstandarddirs.h> #include <klocale.h> @@ -50,24 +50,24 @@ void PixServer::erase(int pos) if (!board->isEmpty(pos)) return; - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); bitBlt( &cachePix, rect.x(), rect.y(), &backPix, rect.x(), rect.y(), rect.width(), rect.height()); } void PixServer::restore(int pos) { - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); bitBlt( &cachePix, rect.x(), rect.y(), &roomPix, rect.x(), rect.y(), rect.width(), rect.height()); } void PixServer::draw(int pos, PixMap pix, int i) { - QPixmap p; + TQPixmap p; p.resize(BRICKSIZE, BRICKSIZE); - QRect rect = board->rect(pos); + TQRect rect = board->rect(pos); if (! plainColor) bitBlt( &p, 0, 0, &backPix, @@ -94,40 +94,40 @@ void PixServer::draw(int pos, PixMap pix, int i) void PixServer::initPixmaps() { - QPixmap pm = QPixmap(locate("appdata", "pics/snake1.png")); - QImage qi = pm.convertToImage(); + TQPixmap pm = TQPixmap(locate("appdata", "pics/snake1.png")); + TQImage qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*18,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ compuSnakePix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&compuSnakePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); compuSnakePix[x].setMask(compuSnakePix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/snake2.png")); + pm = TQPixmap(locate("appdata", "pics/snake2.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*18,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ samyPix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&samyPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); samyPix[x].setMask(samyPix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/ball.png")); + pm = TQPixmap(locate("appdata", "pics/ball.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*4,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 4; x++){ ballPix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&ballPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); ballPix[x].setMask(ballPix[x].createHeuristicMask()); } - pm = QPixmap(locate("appdata", "pics/apples.png")); + pm = TQPixmap(locate("appdata", "pics/apples.png")); qi = pm.convertToImage(); qi=qi.smoothScale(BRICKSIZE*2,BRICKSIZE); - pm.convertFromImage(qi,QPixmap::AvoidDither); + pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 2; x++){ applePix[x].resize(BRICKSIZE, BRICKSIZE); bitBlt(&applePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); @@ -137,7 +137,7 @@ void PixServer::initPixmaps() void PixServer::initbackPixmaps() { - QString path; + TQString path; plainColor = false; if(Settings::bgcolor_enabled()){ @@ -145,19 +145,19 @@ void PixServer::initbackPixmaps() plainColor = true; } else if(Settings::bgimage_enabled()) { // A bit of a hack. - QStringList backgroundPixmaps = + TQStringList backgroundPixmaps = KGlobal::dirs()->findAllResources("appdata", "backgrounds/*.png"); path = backgroundPixmaps[(Settings::bgimage())]; } - QPixmap PIXMAP; + TQPixmap PIXMAP; int pw, ph; backPix.resize(MAPWIDTH, MAPHEIGHT); if (! plainColor) { - PIXMAP = QPixmap(path); + PIXMAP = TQPixmap(path); if (!PIXMAP.isNull()) { pw = PIXMAP.width(); @@ -169,7 +169,7 @@ void PixServer::initbackPixmaps() } else { kdDebug() << "error loading background image :" << path << endl; - backgroundColor = (QColor("black")); + backgroundColor = (TQColor("black")); plainColor = true; } } @@ -179,7 +179,7 @@ void PixServer::initbackPixmaps() void PixServer::initBrickPixmap() { - QPixmap pm = QPixmap(locate("appdata", "pics/brick.png")); + TQPixmap pm = TQPixmap(locate("appdata", "pics/brick.png")); if (pm.isNull()) { kdFatal() << i18n("error loading %1, aborting\n").arg("brick.png"); } @@ -194,7 +194,7 @@ void PixServer::initBrickPixmap() void PixServer::initRoomPixmap() { - QPainter paint; + TQPainter paint; roomPix.resize(MAPWIDTH, MAPHEIGHT); bitBlt(&roomPix,0,0, &backPix); @@ -210,18 +210,18 @@ void PixServer::initRoomPixmap() bitBlt(&cachePix,0,0, &roomPix); } -void PixServer::drawBrick(QPainter *p ,int i) +void PixServer::drawBrick(TQPainter *p ,int i) { //Note, ROOMPIC IS OUR 'TARGET' - QColor light(180,180,180); - QColor dark(100,100,100); + TQColor light(180,180,180); + TQColor dark(100,100,100); int topSq = board->getNext(N, i); //find 'address' of neighbouring squares int botSq = board->getNext(S, i); int rightSq = board->getNext(E ,i); int leftSq = board->getNext(W, i); - QRect rect = board->rect(i); //get our square's rect + TQRect rect = board->rect(i); //get our square's rect int x = rect.x(); int y = rect.y(); //Get x,y location of square??? |