From 57a9163dffd1e9fbd1e89d570a6e4d7d2c719e4e Mon Sep 17 00:00:00 2001 From: fuzzie Date: Wed, 23 Apr 2008 22:33:18 +0000 Subject: [PATCH] Hatchery: add mask, comments git-svn-id: svn://openc2e.ccdevnet.org/openc2e/trunk@1816 5a3b5b51-85f2-0310-b56e-886e3cf1dda3 --- qtgui/Hatchery.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/qtgui/Hatchery.cpp b/qtgui/Hatchery.cpp index 2cae15d..56d0f00 100644 --- a/qtgui/Hatchery.cpp +++ b/qtgui/Hatchery.cpp @@ -17,16 +17,28 @@ #include "World.h" #include "Hatchery.h" +/* + C1 hatchery resources: + hatchery.bmp and htchmask.bmp used for the background/foreground + SCAN*.BMP and hdsk.wav used for egg disk animation + EGG*.BMP and hegg.wav used for egg movement animation + FAN*.BMP and hfan.wav used for the fan animation + lightoff.bmp and hlgt.wav used for the light flickering + GENSPIN.BMP, and hmle.wav/hfml.wav used for male/female animation (male.bmp and female.bmp also present) + */ + Hatchery::Hatchery(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("Hatchery")); setAttribute(Qt::WA_QuitOnClose, false); + /* hatchery background */ std::string hatcherybgfile = world.findFile("hatchery/hatchery.bmp"); if (hatcherybgfile.empty()) return; QPixmap hatcherybg(QString(hatcherybgfile.c_str())); resize(hatcherybg.width() + 6, hatcherybg.height() + 6); + /* create the widgets/layout */ graphicsScene = new QGraphicsScene(); graphicsView = new QGraphicsView(graphicsScene, this); QHBoxLayout *layout = new QHBoxLayout(this); @@ -34,6 +46,31 @@ Hatchery::Hatchery(QWidget *parent) : QDialog(parent) { layout->setContentsMargins(0, 0, 0, 0); graphicsScene->addPixmap(hatcherybg); + + /* mask which goes over the eggs */ + std::string hatcherymaskfile = world.findFile("hatchery/htchmask.bmp"); + if (hatcherymaskfile.size()) { + QPixmap hatcherymask(QString(hatcherymaskfile.c_str())); + QColor maskcolour(0xff, 0x00, 0x80); + hatcherymask.setMask(hatcherymask.createMaskFromColor(maskcolour)); + + QGraphicsPixmapItem *maskitem = graphicsScene->addPixmap(hatcherymask); + maskitem->setPos(0, 168); + } + + /* fan animation */ + for (unsigned int i = 0; i < 4; i++) { + // TODO + } + + /* 'off' state for the light */ + // TODO + + /* eggs */ + // TODO + + /* gender marker animation */ + // TODO } Hatchery::~Hatchery() { -- 2.11.4.GIT