global restruct finish 2 of 3

This commit is contained in:
2010-02-07 19:22:29 +03:00
parent 86f5e2f625
commit 105c340243
20 changed files with 1103 additions and 249 deletions

25
map.cpp
View File

@@ -3,4 +3,29 @@
map::map(games *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();
}