Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Maze::draw()
- {
- std::time_t timer = std::time(NULL);
- m_bBlinkStep = false;
- for (int i = 0; i < m_iMazeWidth; i++)
- {
- for (int j = 0; j < m_iMazeHeight; j++)
- {
- glColor3f(0, 0, 0);
- if (m_oMap[i][j].m_bIsCorrect)
- blink();
- else
- if (m_oMap[i][j].visited()) {
- float* color = m_oMap[i][j].getColor();
- glColor3f(color[0], color[1], color[2]);
- delete color;
- }
- else
- if (m_oMap[i][j].getType() != 0)
- glColor3f(1.0, 0, 0);
- else
- if (m_oMap[i][j].isPassage())
- glColor3f(1.0, 1.0, 1.0);
- timer = std::time(NULL);
- m_bBlinkStep = timer % 2;
- glRectf(i, j, i + 1, j + 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement