summaryrefslogtreecommitdiffstats
path: root/ksmiletris/gamewidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /ksmiletris/gamewidget.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-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 'ksmiletris/gamewidget.cpp')
-rw-r--r--ksmiletris/gamewidget.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/ksmiletris/gamewidget.cpp b/ksmiletris/gamewidget.cpp
index 7bead2f7..f10f9b36 100644
--- a/ksmiletris/gamewidget.cpp
+++ b/ksmiletris/gamewidget.cpp
@@ -26,10 +26,10 @@ this software.
#include <kaudioplayer.h>
#include <kapplication.h>
#include <kstandarddirs.h>
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qtimer.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqtimer.h>
#ifdef HAVE_USLEEP
#include <unistd.h>
#endif
@@ -43,8 +43,8 @@ this software.
#include <kmessagebox.h>
#include <klocale.h>
-GameWidget::GameWidget(QWidget *parent, const char *name)
- : QWidget(parent, name)
+GameWidget::GameWidget(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
in_game = false;
in_pause = false;
@@ -69,8 +69,8 @@ GameWidget::GameWidget(QWidget *parent, const char *name)
next->move(278, 10);
next->setNextPieceSprites(next_piece);
- timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(timeout()));
+ timer = new TQTimer(this);
+ connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()));
}
GameWidget::~GameWidget()
@@ -85,7 +85,7 @@ void GameWidget::playSound(Sound s)
if (!do_sounds)
return;
- QString name;
+ TQString name;
switch (s) {
case Sound_Break:
name = "break.wav";
@@ -95,12 +95,12 @@ void GameWidget::playSound(Sound s)
break;
}
- KAudioPlayer::play(locate("data", QString("ksmiletris/sounds/") + name));
+ KAudioPlayer::play(locate("data", TQString("ksmiletris/sounds/") + name));
}
void GameWidget::setPieces(PiecesType type)
{
- QString prefix;
+ TQString prefix;
switch (type) {
case Pieces_Smiles:
@@ -117,13 +117,13 @@ void GameWidget::setPieces(PiecesType type)
}
for (int i = 0; i < num_blocks; ++i) {
- QString n;
+ TQString n;
n.setNum(i + 1);
loadSprite((Sprite)(Sprite_Block1 + i), prefix + n + ".bmp");
}
- QPixmap pm(32, 32);
+ TQPixmap pm(32, 32);
for (int i = 0; i < num_blocks; ++i) {
- QPainter p;
+ TQPainter p;
p.begin(&pm);
p.drawPixmap(0, 0, sprites[Sprite_Block1 + i]);
p.drawPixmap(0, 0, sprites[Sprite_Broken]);
@@ -156,18 +156,18 @@ void GameWidget::loadSprites()
loadMaskedSprite(Sprite_Broken, "broken.bmp", "broken-mask.bmp");
}
-void GameWidget::loadSprite(Sprite spr, const QString & path)
+void GameWidget::loadSprite(Sprite spr, const TQString & path)
{
- if (!sprites[spr].load(locate("appdata", QString("data/") + path)))
+ if (!sprites[spr].load(locate("appdata", TQString("data/") + path)))
qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?");
}
-void GameWidget::loadMaskedSprite(Sprite spr, const QString & path1, const QString & path2)
+void GameWidget::loadMaskedSprite(Sprite spr, const TQString & path1, const TQString & path2)
{
- QBitmap bmp;
- if (!sprites[spr].load(locate("appdata", QString("data/") + path1)))
+ TQBitmap bmp;
+ if (!sprites[spr].load(locate("appdata", TQString("data/") + path1)))
qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?");
- if (!bmp.load(locate("appdata", QString("data/") + path2)))
+ if (!bmp.load(locate("appdata", TQString("data/") + path2)))
qFatal("Cannot open data files.\nHave you correctly installed KSmiletris?");
sprites[spr].setMask(bmp);
}