2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2 of the License, or
5 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License along
13 with this program; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 C1 hatchery resources:
24 hatchery.bmp and htchmask.bmp used for the background/foreground
25 SCAN*.BMP and hdsk.wav used for egg disk animation
26 EGG*.BMP and hegg.wav used for egg movement animation
27 FAN*.BMP and hfan.wav used for the fan animation
28 lightoff.bmp and hlgt.wav used for the light flickering
29 GENSPIN.BMP, and hmle.wav/hfml.wav used for male/female animation (male.bmp and female.bmp also present)
32 Hatchery::Hatchery(QWidget
*parent
) : QDialog(parent
) {
33 setWindowTitle(tr("Hatchery"));
34 setAttribute(Qt::WA_QuitOnClose
, false);
36 /* hatchery background */
37 std::string hatcherybgfile
= world
.findFile("hatchery/hatchery.bmp");
38 if (hatcherybgfile
.empty()) return;
39 QPixmap
hatcherybg(QString(hatcherybgfile
.c_str()));
41 resize(hatcherybg
.width() + 6, hatcherybg
.height() + 6);
43 /* create the widgets/layout */
44 graphicsScene
= new QGraphicsScene();
45 graphicsView
= new QGraphicsView(graphicsScene
, this);
46 QHBoxLayout
*layout
= new QHBoxLayout(this);
47 layout
->addWidget(graphicsView
);
48 layout
->setContentsMargins(0, 0, 0, 0);
50 graphicsScene
->addPixmap(hatcherybg
);
52 /* mask which goes over the eggs */
53 std::string hatcherymaskfile
= world
.findFile("hatchery/htchmask.bmp");
54 if (hatcherymaskfile
.size()) {
55 QPixmap
hatcherymask(QString(hatcherymaskfile
.c_str()));
56 QColor
maskcolour(0xff, 0x00, 0x80);
57 hatcherymask
.setMask(hatcherymask
.createMaskFromColor(maskcolour
));
59 QGraphicsPixmapItem
*maskitem
= graphicsScene
->addPixmap(hatcherymask
);
60 maskitem
->setPos(0, 168);
64 for (unsigned int i
= 0; i
< 4; i
++) {
68 /* 'off' state for the light */
74 /* gender marker animation */
78 Hatchery::~Hatchery() {