hm.... new global restruct... i think it last!

This commit is contained in:
2010-07-28 23:07:42 +04:00
parent 52a5384e6f
commit 2869e716b3
32 changed files with 721 additions and 1375 deletions

30
map.cpp
View File

@@ -1,31 +1,7 @@
#include "map.h"
map::map(games *parent)
Map::Map(int Id, QSize size, QObject *parent) :
QObject(parent)
{
game = parent;
}
void map::clear()
{
QPainter painter(game->background);
QPen pen(QColor(150,150,150));
painter.setPen(pen);
painter.fillRect(game->background->rect(),QColor(150,150,150));
painter.end();
}
void map::drawgrid()
{
int i;
QPainter painter(game->background);
QPen pen(QColor(100,100,100));
painter.setPen(pen);
for (i = 0; i < game->background->width()/game->cellsize; i++)
painter.drawLine(i*game->cellsize,0,i*game->cellsize,game->background->height());
for (i = 0; i < game->background->height()/game->cellsize; i++)
painter.drawLine(0,i*game->cellsize,game->background->width(),i*game->cellsize);
painter.end();
mapId=Id;
}