summaryrefslogtreecommitdiffstats
path: root/ksokoban/ImageData.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 /ksokoban/ImageData.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 'ksokoban/ImageData.cpp')
-rw-r--r--ksokoban/ImageData.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/ksokoban/ImageData.cpp b/ksokoban/ImageData.cpp
index 13040c47..c34ece36 100644
--- a/ksokoban/ImageData.cpp
+++ b/ksokoban/ImageData.cpp
@@ -20,10 +20,10 @@
#include "ImageData.h"
#include <assert.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qcolor.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqcolor.h>
ImageData::ImageData() : indexSize_(0), size_(0), halfSize_(0) {
random.setSeed(0);
@@ -52,28 +52,28 @@ ImageData::expandIndex(int size) {
indexSize_ = size;
}
-const QPixmap &
+const TQPixmap &
ImageData::upperLarge(int index) {
assert(index >= 0);
if (indexSize_ <= index) expandIndex(index);
return largeStone_xpm_[(unsigned char)upperLargeIndex_[index]];
}
-const QPixmap &
+const TQPixmap &
ImageData::lowerLarge(int index) {
assert(index >= 0);
if (indexSize_ <= index) expandIndex(index);
return largeStone_xpm_[(unsigned char)lowerLargeIndex_[index]];
}
-const QPixmap &
+const TQPixmap &
ImageData::leftSmall(int index) {
assert(index >= 0);
if (indexSize_ <= index) expandIndex(index);
return smallStone_xpm_[(unsigned char)leftSmallIndex_[index]];
}
-const QPixmap &
+const TQPixmap &
ImageData::rightSmall(int index) {
assert(index >= 0);
if (indexSize_ <= index) expandIndex(index);
@@ -91,12 +91,12 @@ ImageData::resize(int size) {
for (int i=0; i<SMALL_STONES; i++) {
image2pixmap(images_[i].smoothScale(halfSize_, halfSize_), smallStone_xpm_[i]);
-// smallStone_xpm_[i].convertFromImage(images_[i].smoothScale(halfSize_, halfSize_), QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither);
+// smallStone_xpm_[i].convertFromImage(images_[i].smoothScale(halfSize_, halfSize_), TQPixmap::ColorOnly|TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither|TQPixmap::AvoidDither);
}
for (int i=0; i<LARGE_STONES; i++) {
image2pixmap(images_[SMALL_STONES+i].smoothScale(size_, halfSize_), largeStone_xpm_[i]);
-// largeStone_xpm_[i].convertFromImage(images_[SMALL_STONES+i].smoothScale(size_, halfSize_) , QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither);
+// largeStone_xpm_[i].convertFromImage(images_[SMALL_STONES+i].smoothScale(size_, halfSize_) , TQPixmap::ColorOnly|TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither|TQPixmap::AvoidDither);
}
objectImg_ = images_[SMALL_STONES+LARGE_STONES].smoothScale(size_, size_);
@@ -111,7 +111,7 @@ ImageData::resize(int size) {
brighten(objectImg_);
image2pixmap(objectImg_, brightObject_, false);
- QImage img = images_[SMALL_STONES+LARGE_STONES+1].smoothScale(size_, size_);
+ TQImage img = images_[SMALL_STONES+LARGE_STONES+1].smoothScale(size_, size_);
if (img.width() == size_) img = img.copy();
image2pixmap(img, otherPixmaps_[1], false);
@@ -120,7 +120,7 @@ ImageData::resize(int size) {
for (int i=2; i<OTHER_IMAGES; i++) {
image2pixmap(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), otherPixmaps_[i]);
-// otherPixmaps_[i].convertFromImage(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), QPixmap::ColorOnly|QPixmap::OrderedDither|QPixmap::OrderedAlphaDither|QPixmap::AvoidDither);
+// otherPixmaps_[i].convertFromImage(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), TQPixmap::ColorOnly|TQPixmap::OrderedDither|TQPixmap::OrderedAlphaDither|TQPixmap::AvoidDither);
}
return size_;
@@ -130,16 +130,16 @@ ImageData::resize(int size) {
// it gives spurious dots on the floor around them
void
-ImageData::image2pixmap(QImage img, QPixmap& xpm, bool diffuse) {
+ImageData::image2pixmap(TQImage img, TQPixmap& xpm, bool diffuse) {
xpm.convertFromImage(img,
(diffuse ?
- (QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither) :
- (QPixmap::OrderedDither|QPixmap::OrderedAlphaDither))|
- QPixmap::ColorOnly|QPixmap::AvoidDither);
+ (TQPixmap::DiffuseDither|TQPixmap::DiffuseAlphaDither) :
+ (TQPixmap::OrderedDither|TQPixmap::OrderedAlphaDither))|
+ TQPixmap::ColorOnly|TQPixmap::AvoidDither);
}
void
-ImageData::brighten(QImage& img) {
+ImageData::brighten(TQImage& img) {
assert(img.depth() == 32);
for (int y=0; y<img.height(); y++) {
@@ -152,8 +152,8 @@ ImageData::brighten(QImage& img) {
if (r > g && r > b) {
// only modify redish pixels
- QColor col(r, g, b);
- QColor lcol = col.light(130);
+ TQColor col(r, g, b);
+ TQColor lcol = col.light(130);
img.setPixel(x, y, lcol.rgb());
}
@@ -162,7 +162,7 @@ ImageData::brighten(QImage& img) {
}
void
-ImageData::wall(QPainter &p, int x, int y, int index, bool left, bool right) {
+ImageData::wall(TQPainter &p, int x, int y, int index, bool left, bool right) {
if (left) p.drawPixmap(x, y, upperLarge(index-1), halfSize_);
else p.drawPixmap(x, y, leftSmall(index));
@@ -173,41 +173,41 @@ ImageData::wall(QPainter &p, int x, int y, int index, bool left, bool right) {
}
void
-ImageData::floor(QPainter &p, int x, int y) {
+ImageData::floor(TQPainter &p, int x, int y) {
p.eraseRect(x, y, size_, size_);
}
void
-ImageData::goal(QPainter &p, int x, int y) {
+ImageData::goal(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, otherPixmaps_[2]);
}
void
-ImageData::man(QPainter &p, int x, int y) {
+ImageData::man(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, otherPixmaps_[3]);
}
void
-ImageData::object(QPainter &p, int x, int y) {
+ImageData::object(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, otherPixmaps_[0]);
}
void
-ImageData::saveman(QPainter &p, int x, int y) {
+ImageData::saveman(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, otherPixmaps_[4]);
}
void
-ImageData::treasure(QPainter &p, int x, int y) {
+ImageData::treasure(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, otherPixmaps_[1]);
}
void
-ImageData::brightObject(QPainter &p, int x, int y) {
+ImageData::brightObject(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, brightObject_);
}
void
-ImageData::brightTreasure(QPainter &p, int x, int y) {
+ImageData::brightTreasure(TQPainter &p, int x, int y) {
p.drawPixmap(x, y, brightTreasure_);
}