hm.... new global restruct... i think it last!
This commit is contained in:
30
map.cpp
30
map.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user