MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / add_rect

Function add_rect

deps/SDL2/test/testintersections.c:130–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128int num_rects = 0;
129SDL_Rect rects[MAX_RECTS];
130static int
131add_rect(int x1, int y1, int x2, int y2)
132{
133 if (num_rects >= MAX_RECTS)
134 return 0;
135 if ((x1 == x2) || (y1 == y2))
136 return 0;
137
138 if (x1 > x2)
139 SWAP(int, x1, x2);
140 if (y1 > y2)
141 SWAP(int, y1, y2);
142
143 SDL_Log("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2,
144 x2 - x1, y2 - y1);
145
146 rects[num_rects].x = x1;
147 rects[num_rects].y = y1;
148 rects[num_rects].w = x2 - x1;
149 rects[num_rects].h = y2 - y1;
150
151 return ++num_rects;
152}
153
154static void
155DrawRects(SDL_Renderer * renderer)

Callers 1

loopFunction · 0.85

Calls 1

SDL_LogFunction · 0.85

Tested by

no test coverage detected