Пример #1
0
void Map::paint()
{
	//std::cout << "limitWTiles: " << limitWTiles << ", limitHTiles:" << limitHTiles << "\n";
	for(int i=x;i<x+limitWTiles;i++)
		for(int j=y;j<y+limitHTiles;j++)
			paintTile(i,j);
}
Пример #2
0
// paints the entire map
void EditableMap::paint()
{
	for(int i=x;i<x+limitWTiles;i++)
	{
		for(int j=y;j<y+limitHTiles;j++)
		{
			paintTile(i,j);
		}
	}
}
Пример #3
0
void localMap::paintEvent(QPaintEvent *)
{
  //Paints the entire world.
  QPainter painter(this);

  for(int c = 0; c < COL; c++)
    {
      for(int r = 0; r < ROW; r++)
        {
          paintTile(painter, r, c, cmap[c][r]);
        }
    }
  
  //Draws the red rectangle that indicates the player.
  //The player will always be located in the center of the screen.
  painter.setPen(Qt::NoPen);
  painter.setBrush(Qt::red);
  
  painter.drawRect(QRect(12*TILESIZE, 12*TILESIZE,
                         TILESIZE, TILESIZE));

}
Пример #4
0
bool Waveform::paintTiles()
{
    WAVEFORM_DEBUG << "Waveform::paintTiles";
    bool updateRequired = false;

    for (int i=0; i<m_tiles.count(); ++i) {
        const Tile &tile = m_tiles[i];
        if (!tile.painted) {
            const qint64 tileStart = m_tileArrayStart + i * m_tileLength;
            const qint64 tileEnd = tileStart + m_tileLength;
            if (m_bufferPosition <= tileStart && m_bufferPosition + m_bufferLength >= tileEnd) {
                paintTile(i);
                updateRequired = true;
            }
        }
    }

    if (updateRequired)
        update();

    return updateRequired;
}
Пример #5
0
void worldSpace::paintEvent(QPaintEvent *)
{
  //Paints Slice, which is the area of the world that's
  //visible to us.
  QPainter painter(this);

  for(int c = 0; c < WINSIZE; c++)
    {
      for(int r = 0; r < WINSIZE; r++)
        {
          paintTile(painter, r, c, slice[c][r]);
        }
    }

  //Draws the red rectangle that indicates the player.
  //The player will always be located in the center of the screen.
  painter.setPen(Qt::NoPen);
  painter.setBrush(Qt::red);
  
  painter.drawRect(QRect(12*TILESIZE, 12*TILESIZE,
                         TILESIZE, TILESIZE));
}