SDL API renaming: SDL_rect.h

Fixes https://github.com/libsdl-org/SDL/issues/6887
This commit is contained in:
Sam Lantinga
2022-12-27 11:01:11 -08:00
parent a28d1d59be
commit 58aecf0a54
32 changed files with 379 additions and 323 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -443,7 +443,7 @@ static SDL_GamepadButton FindButtonAtPosition(int x, int y)
rect.y = button_positions[i].y;
rect.w = BUTTON_SIZE;
rect.h = BUTTON_SIZE;
if (SDL_PointInRect(&point, &rect)) {
if (SDL_IsPointInRect(&point, &rect)) {
return (SDL_GamepadButton)i;
}
}
@@ -466,7 +466,7 @@ static SDL_GamepadAxis FindAxisAtPosition(int x, int y)
rect.y = axis_positions[i].y;
rect.w = AXIS_SIZE;
rect.h = AXIS_SIZE;
if (SDL_PointInRect(&point, &rect)) {
if (SDL_IsPointInRect(&point, &rect)) {
return (SDL_GamepadAxis)i;
}
}

View File

@@ -32,7 +32,7 @@ hitTest(SDL_Window *window, const SDL_Point *pt, void *data)
int w, h;
for (i = 0; i < numareas; i++) {
if (SDL_PointInRect(pt, &areas[i])) {
if (SDL_IsPointInRect(pt, &areas[i])) {
SDL_Log("HIT-TEST: DRAGGABLE\n");
return SDL_HITTEST_DRAGGABLE;
}

View File

@@ -184,7 +184,7 @@ DrawRectLineIntersections(SDL_Renderer *renderer)
x2 = lines[j].w;
y2 = lines[j].h;
if (SDL_IntersectRectAndLine(&r, &x1, &y1, &x2, &y2)) {
if (SDL_GetRectAndLineIntersection(&r, &x1, &y1, &x2, &y2)) {
SDL_RenderLine(renderer, x1, y1, x2, y2);
}
}
@@ -201,7 +201,7 @@ DrawRectRectIntersections(SDL_Renderer *renderer)
for (i = 0; i < num_rects; i++) {
for (j = i + 1; j < num_rects; j++) {
SDL_Rect r;
if (SDL_IntersectRect(&rects[i], &rects[j], &r)) {
if (SDL_GetRectIntersection(&rects[i], &rects[j], &r)) {
SDL_RenderFillRect(renderer, &r);
}
}

View File

@@ -120,7 +120,7 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_Rect viewport)
cell_rect.w = text_length * FONT_CHARACTER_SIZE;
cell_rect.h = lineHeight;
if (SDL_PointInRect(&mouse_pos, &cell_rect)) {
if (SDL_IsPointInRect(&mouse_pos, &cell_rect)) {
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
/* Update cached mode under the mouse */