| 159 | } |
| 160 | |
| 161 | static void |
| 162 | DrawRectLineIntersections(SDL_Renderer * renderer) |
| 163 | { |
| 164 | int i, j; |
| 165 | |
| 166 | SDL_SetRenderDrawColor(renderer, 0, 255, 55, 255); |
| 167 | |
| 168 | for (i = 0; i < num_rects; i++) |
| 169 | for (j = 0; j < num_lines; j++) { |
| 170 | int x1, y1, x2, y2; |
| 171 | SDL_Rect r; |
| 172 | |
| 173 | r = rects[i]; |
| 174 | x1 = lines[j].x; |
| 175 | y1 = lines[j].y; |
| 176 | x2 = lines[j].w; |
| 177 | y2 = lines[j].h; |
| 178 | |
| 179 | if (SDL_IntersectRectAndLine(&r, &x1, &y1, &x2, &y2)) { |
| 180 | SDL_RenderDrawLine(renderer, x1, y1, x2, y2); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | static void |
| 186 | DrawRectRectIntersections(SDL_Renderer * renderer) |
no test coverage detected