Exemple #1
0
void Well::draw(Painter &p) const
{
  p.setColor(Painter::WHITE);
  for (int y = 0; y < 20; ++y)
    for (int x = 0; x < 10; ++x)
      if (map_[y][x])
	p.rect(x * 8 + 1, y * 8 + 1,
	       (x + 1) * 8 - 1, (y + 1) * 8 - 1);
      else
	p.rect(x * 8 + 3, y * 8 + 3,
	       (x + 1) * 8 - 4, (y + 1) * 8 - 4);
}
Exemple #2
0
void Well::draw(Painter &p) const
{
  p.setColor(Painter::WHITE);
  for (int y = 0; y < HEIGHT; ++y)
    for (int x = 0; x < WIDTH; ++x)
      if (map_[y][x])
	p.rect(x * size_ + 1, y * size_ + 1,
	       (x + 1) * size_ - 1, (y + 1) * size_ - 1);
      else
	p.rect(x * size_ + 8, y * size_ + 8,
	       (x + 1) * size_ - 9, (y + 1) * size_ - 9);
}