diff options
Diffstat (limited to 'libksirtet/base/piece.cpp')
-rw-r--r-- | libksirtet/base/piece.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp index 25aed934..d423473c 100644 --- a/libksirtet/base/piece.cpp +++ b/libksirtet/base/piece.cpp @@ -7,9 +7,9 @@ using namespace KGrid2D; -QPoint operator *(const Coord &c, int i) +TQPoint operator *(const Coord &c, int i) { - return QPoint(c.first * i, c.second * i); + return TQPoint(c.first * i, c.second * i); } //----------------------------------------------------------------------------- @@ -18,10 +18,10 @@ GPieceInfo::GPieceInfo() Piece::setPieceInfo(this); } -QPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, +TQPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, bool lighted) const { - QPixmap *pixmap = new QPixmap(blockSize, blockSize); + TQPixmap *pixmap = new TQPixmap(blockSize, blockSize); draw(pixmap, blockType, blockMode, lighted); setMask(pixmap, blockMode); return pixmap; @@ -73,18 +73,18 @@ void SequenceArray::setBlockSize(uint bsize) { _size = bsize; const GPieceInfo &pinfo = Piece::info(); - QPtrList<QPixmap> pixmaps; + TQPtrList<TQPixmap> pixmaps; pixmaps.setAutoDelete(TRUE); - QPtrList<QPoint> points; + TQPtrList<TQPoint> points; points.setAutoDelete(TRUE); uint nm = pinfo.nbBlockModes(); for (uint i=0; i<size(); i++) { for (uint k=0; k<2; k++) for (uint j=0; j<nm; j++) { - QPoint *po = new QPoint(0, 0); - QPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); + TQPoint *po = new TQPoint(0, 0); + TQPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); if ( at(i) ) { - at(i)->setImage(k*nm + j, new QCanvasPixmap(*pi, *po)); + at(i)->setImage(k*nm + j, new TQCanvasPixmap(*pi, *po)); delete po; delete pi; } else { @@ -93,7 +93,7 @@ void SequenceArray::setBlockSize(uint bsize) } } if ( at(i)==0 ) { - at(i) = new QCanvasPixmapArray(pixmaps, points); + at(i) = new TQCanvasPixmapArray(pixmaps, points); pixmaps.clear(); points.clear(); } @@ -110,7 +110,7 @@ BlockInfo::BlockInfo(const SequenceArray &s) : _sequences(s) {} -QPoint BlockInfo::toPoint(const Coord &pos) const +TQPoint BlockInfo::toPoint(const Coord &pos) const { return pos * _sequences.blockSize(); } @@ -129,10 +129,10 @@ void Block::setValue(uint value, BlockInfo *binfo) { _value = value; if (binfo) { - QCanvasPixmapArray *seq = binfo->sequences()[value]; + TQCanvasPixmapArray *seq = binfo->sequences()[value]; if (_sprite) _sprite->setSequence(seq); else { - _sprite = new QCanvasSprite(seq, binfo); + _sprite = new TQCanvasSprite(seq, binfo); _sprite->setZ(0); } } @@ -161,7 +161,7 @@ Piece::Piece() _blocks.setAutoDelete(true); } -void Piece::rotate(bool left, const QPoint &p) +void Piece::rotate(bool left, const TQPoint &p) { if (left) { if ( _rotation==0 ) _rotation = 3; @@ -231,7 +231,7 @@ void Piece::generateNext(int type) void Piece::moveCenter() { uint s = _binfo->sequences().blockSize(); - QPoint p = QPoint(_binfo->width(), _binfo->height()) - size() * s; + TQPoint p = TQPoint(_binfo->width(), _binfo->height()) - size() * s; move(p/2 - min() * s); } @@ -240,14 +240,14 @@ Coord Piece::pos(uint k, const Coord &pos) const return Coord(pos.first + coord(k).first, pos.second - coord(k).second); } -void Piece::move(const QPoint &p) +void Piece::move(const TQPoint &p) { for (uint k=0; k<_blocks.size(); k++) moveBlock(k, p); } -void Piece::moveBlock(uint k, const QPoint &p) +void Piece::moveBlock(uint k, const TQPoint &p) { - QPoint po = p + _binfo->toPoint(coord(k)); + TQPoint po = p + _binfo->toPoint(coord(k)); _blocks[k]->sprite()->move(po.x(), po.y()); } |