fix bug in del tower and some ui changes

This commit is contained in:
2011-08-28 15:54:43 +04:00
parent 894e55bb41
commit 9f90c1e676
15 changed files with 212 additions and 114 deletions

View File

@@ -1,7 +1,6 @@
#include "loader.h"
Loader::Loader(QObject *parent) :
QObject(parent)
Loader::Loader()
{
doc = new QDomDocument("data");
qDebug() << createMapExample();
@@ -351,7 +350,7 @@ Game_Data * Loader::loadlevel(int id)
if (wplist.isEmpty())
{
qCritical() << tr("Error wave %1 is empty!").arg(tbw.id);
return 0;
//return 0;
}
for (int j=0; j<wplist.size(); j++)
{
@@ -490,6 +489,7 @@ Game_Data * Loader::loadlevel(int id)
gd->players[i]->srcTowers[j].splashes[k].images = gd->curAnimations.at(gd->players.at(i)->srcTowers.at(j).splashes.at(k).imgType).images;
}
gd->towerSelect.images = gd->alienSelect.images = 0;
gd->blood = 0;
for (QHash<int,tbAnimation>::iterator i = animations.begin();
i != animations.end(); ++i)
{
@@ -509,7 +509,15 @@ Game_Data * Loader::loadlevel(int id)
anim.images->append(new QImage(i->pathes.at(k)));
gd->alienSelect = anim;
}
if (i->name == "blood")
{
gd->blood = new QImage(i->pathes.at(0));
QSize size = gd->blood->size();
qDebug() << size;
gd->bloodrect = QRectF(QPointF(-(size.width()/2),-(size.height()/2)),size);
}
}
if (gd->blood == 0) gd->blood = new QImage();
if (gd->towerSelect.images == 0)
{
AnimationType anim;