Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. void Maze::draw()
  2. {
  3.     std::time_t timer = std::time(NULL);
  4.     m_bBlinkStep = false;
  5.     for (int i = 0; i < m_iMazeWidth; i++)
  6.     {
  7.         for (int j = 0; j < m_iMazeHeight; j++)
  8.         {
  9.             glColor3f(0, 0, 0);
  10.             if (m_oMap[i][j].m_bIsCorrect)
  11.                 blink();
  12.             else
  13.                 if (m_oMap[i][j].visited()) {
  14.                     float* color = m_oMap[i][j].getColor();
  15.                     glColor3f(color[0], color[1], color[2]);
  16.                     delete color;
  17.                 }
  18.                 else
  19.                     if (m_oMap[i][j].getType() != 0)
  20.                         glColor3f(1.0, 0, 0);
  21.                     else
  22.  
  23.                         if (m_oMap[i][j].isPassage())
  24.                             glColor3f(1.0, 1.0, 1.0);
  25.  
  26.             timer = std::time(NULL);
  27.             m_bBlinkStep = timer % 2;
  28.             glRectf(i, j, i + 1, j + 1);
  29.         }
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement