fix bugs in wavetracewhen building towers

fix some bugs in ADeditor
This commit is contained in:
2010-09-01 21:50:30 +04:00
parent 3316f3f48f
commit 7752f7be12
12 changed files with 605 additions and 296 deletions

View File

@@ -39,10 +39,10 @@ AD_Graphics::AD_Graphics(AD_Core *adcore, QWidget *parent) : QGraphicsView(paren
// pen.setColor(Qt::yellow);
// brush.setColor(Qt::yellow);
// }
if (cel >= Map::Player || (cel <= Map::PlayerTower && cel !=Map::Wall))
if (cel >= Map::Free || (cel <= Map::PlayerTower && cel !=Map::Wall))
{
pen.setColor(QColor(qAbs(cel)*345%255,(qAbs(cel)*721)%255,(qAbs(cel)*75)%255,50));
brush.setColor(QColor(qAbs(cel)*345%255,(qAbs(cel)*721)%255,(qAbs(cel)*75)%255,50));
pen.setColor(QColor(qAbs(cel+2)*345%255,(qAbs(cel+2)*721)%255,(qAbs(cel+2)*75)%255,50));
brush.setColor(QColor(qAbs(cel+2)*345%255,(qAbs(cel+2)*721)%255,(qAbs(cel+2)*75)%255,50));
}
p.setPen(pen);
p.setBrush(brush);
@@ -89,6 +89,38 @@ void AD_Graphics::timerEvent(QTimerEvent * )
void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
{
p->drawImage(0,0,*mapimg);
// for (int i=0; i<data->map->cells().size(); i++) {
// for (int j=0; j<data->map->cells().at(i).size(); j++) {
// QPen pen;
// QBrush brush;
// pen.setColor(Qt::white);
// brush.setColor(Qt::white);
// brush.setStyle(Qt::SolidPattern);
// int cel = data->map->cells().at(i).at(j);
// if (cel == Map::Wall)
// {
// pen.setColor(Qt::black);
// brush.setColor(Qt::black);
// }
// // if (cel <= Map::PlayerTower && cel !=Map::Wall) {
// // pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
// // brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
// // }
// // if (cel >= Map::PlayerAlien) {
// // pen.setColor(Qt::yellow);
// // brush.setColor(Qt::yellow);
// // }
// if (cel >= Map::Free || (cel <= Map::PlayerTower && cel !=Map::Wall))
// {
// pen.setColor(QColor(qAbs(cel+2)*345%255,(qAbs(cel+2)*721)%255,(qAbs(cel+2)*75)%255,50));
// brush.setColor(QColor(qAbs(cel+2)*345%255,(qAbs(cel+2)*721)%255,(qAbs(cel+2)*75)%255,50));
// }
// p->setPen(pen);
// p->setBrush(brush);
// p->drawRect(i*cellSize,j*cellSize,cellSize,cellSize);
// }
// }
//qDebug() << "t:" << data->curTowers.size();
for (QHash<QPoint, TowerType>::iterator i = data->curTowers.begin(); i != data->curTowers.end(); ++i)
{