Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. void HighlightAnt(Board *board)
  2. {
  3.     int currentAntX = board->ant.x;
  4.     int currentAntY = board->ant.y;
  5.  
  6.     int step = board->step;
  7.  
  8.     SDL_Color antHighlightColor = { 0x00, 0x11, 0x11 };
  9.  
  10.     SDL_SetRenderDrawColor(gameRenderer, antHighlightColor.r, antHighlightColor.g, antHighlightColor.b, antHighlightColor.a);
  11.  
  12.     int i = currentAntX - board->x;
  13.     int j = currentAntY - board->y;
  14.  
  15.     SDL_Rect curRect = { i * step, j * step, step, step };
  16.  
  17.     SDL_RenderFillRect(gameRenderer, &curRect);
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement