From ce48af53646cd9e7ec762fc1ac176b3aa620b11d Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 5 May 2011 00:57:07 +0200 Subject: - refactorized the whole project and made a few subprojects - replaced tcp with enet - added connect dialog - some smaller bugfixes --- pacman-c++/pixmapitem.cpp | 77 ----------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 pacman-c++/pixmapitem.cpp (limited to 'pacman-c++/pixmapitem.cpp') diff --git a/pacman-c++/pixmapitem.cpp b/pacman-c++/pixmapitem.cpp deleted file mode 100644 index 1ceeec1..0000000 --- a/pacman-c++/pixmapitem.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "pixmapitem.h" -#include - -PixmapItem::PixmapItem(QGraphicsItem *parent) - : QGraphicsObject(parent), m_x(0), m_y(0) -{ -} - -PixmapItem::PixmapItem(const QString &fileName, QGraphicsItem *parent) - : QGraphicsObject(parent), m_x(0), m_y(0) -{ - m_pix = ":/" + fileName; - m_width = m_pix.width(); - m_height = m_pix.height(); -} - -PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) - : QGraphicsObject(), m_x(0), m_y(0) -{ - m_pix = ":/" + fileName; - m_width = m_pix.width(); - m_height = m_pix.height(); - scene->addItem(this); -} - -PixmapItem::PixmapItem(const QPixmap &pix, QGraphicsItem *parent) - : QGraphicsObject(parent), m_pix(pix), m_x(0), m_y(0) -{ - m_width = m_pix.width(); - m_height = m_pix.height(); -} - -PixmapItem::PixmapItem(const QPixmap &pix, QGraphicsScene *scene) - : QGraphicsObject(), m_pix(pix), m_x(0), m_y(0) -{ - m_width = m_pix.width(); - m_height = m_pix.height(); - scene->addItem(this); -} - -void PixmapItem::setPixmap(const QPixmap &pix) -{ - m_pix = pix; - m_width = m_pix.width(); - m_height = m_pix.height(); -} - -void PixmapItem::setSprite(int x, int y, int width, int height) -{ - m_x = x; - m_y = y; - m_width = width; - m_height = height; -} - -QSizeF PixmapItem::size() const -{ - return QSizeF(m_width, m_height); -} - -QRectF PixmapItem::boundingRect() const -{ - return QRectF(QPointF(0, 0), size()); -} - -QPainterPath PixmapItem::shape() const -{ - QPainterPath path; - path.addRect(boundingRect()); - return path; -} - -void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) -{ - painter->drawPixmap(QPoint(0, 0), m_pix, QRect(m_x, m_y, m_width, m_height)); -} - -- cgit v1.2.3