Skip to content

Commit

Permalink
Merge branch 'release-2.28.x' into MorphOS-SDL-2.28.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Oct 17, 2023
2 parents ba08b21 + a85cf62 commit d0ff144
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 53 deletions.
1 change: 1 addition & 0 deletions .github/workflows/vmactions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
freebsd:
runs-on: macos-12
name: FreeBSD
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions src/audio/arts/SDL_artsaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ static void ARTS_Deinitialize(void)
}


static SDL_bool ARTS_Init(SDL_AudioDriverImpl * impl)
static SDL_bool ARTS_Init(SDL_AudioDriverImpl *impl)
{
if (LoadARTSLibrary() < 0) {
return SDL_FALSE;
} else {
if (SDL_NAME(arts_init) () != NULL) {
if (SDL_NAME(arts_init) () != 0) {
UnloadARTSLibrary();
SDL_SetError("ARTS: arts_init failed (no audio server?)");
return SDL_FALSE;
Expand Down
21 changes: 13 additions & 8 deletions src/render/software/SDL_triangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,20 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
continue;
}
}
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *) (dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
}
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *)(dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
/* don't care */
dstR = dstG = dstB = dstA = 0;
}

if (!is_uniform) {
Expand Down
4 changes: 3 additions & 1 deletion src/test/SDL_test_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
}

size = (SDLTest_RandomUint32() % (maxLength + 1));

if (size == 0) {
size = 1;
}
return SDLTest_RandomAsciiStringOfSize(size);
}

Expand Down
21 changes: 13 additions & 8 deletions src/video/SDL_blit_slow.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,20 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
continue;
}
}
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
dstA = 0xFF;
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *) (dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
}
} else {
/* SDL_PIXELFORMAT_ARGB2101010 */
dstpixel = *((Uint32 *)(dst));
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
/* don't care */
dstR = dstG = dstB = dstA = 0;
}

if (flags & SDL_COPY_MODULATE_COLOR) {
Expand Down
26 changes: 10 additions & 16 deletions src/video/wayland/SDL_waylandwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,21 +1322,15 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
/* Create the shell surface and map the toplevel/popup */
#ifdef HAVE_LIBDECOR_H
if (data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
if (data->shell_surface.libdecor.frame) {
/* If the frame already exists, just set the visibility. */
libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, true);
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor,
data->surface,
&libdecor_frame_interface,
data);
if (data->shell_surface.libdecor.frame == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!");
} else {
data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor,
data->surface,
&libdecor_frame_interface,
data);
if (data->shell_surface.libdecor.frame == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!");
} else {
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
libdecor_frame_map(data->shell_surface.libdecor.frame);
}
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
libdecor_frame_map(data->shell_surface.libdecor.frame);
}
} else
#endif
Expand Down Expand Up @@ -1540,8 +1534,8 @@ void Wayland_HideWindow(_THIS, SDL_Window *window)
#ifdef HAVE_LIBDECOR_H
if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
if (wind->shell_surface.libdecor.frame) {
libdecor_frame_set_visibility(wind->shell_surface.libdecor.frame, false);
libdecor_frame_set_app_id(wind->shell_surface.libdecor.frame, data->classname);
libdecor_frame_unref(wind->shell_surface.libdecor.frame);
wind->shell_surface.libdecor.frame = NULL;
}
} else
#endif
Expand Down
29 changes: 11 additions & 18 deletions src/video/x11/SDL_x11mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,16 @@ static void WarpMouseInternal(Window xwindow, const int x, const int y)
Display *display = videodata->display;
#if SDL_VIDEO_DRIVER_X11_XINPUT2
int deviceid = 0;
/* It seems XIWarpPointer() doesn't work correctly on multi-head setups:
* https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
*/
if (ScreenCount(display) == 1) {
X11_XIGetClientPointer(display, None, &deviceid);
if (X11_Xinput2IsInitialized()) {
/* It seems XIWarpPointer() doesn't work correctly on multi-head setups:
* https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
*/
if (ScreenCount(display) == 1) {
X11_XIGetClientPointer(display, None, &deviceid);
}
}
if (deviceid != 0) {
SDL_assert(SDL_X11_HAVE_XINPUT2);
X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y);
} else
#endif
Expand Down Expand Up @@ -369,14 +372,7 @@ static int X11_WarpMouseGlobal(int x, int y)

static int X11_SetRelativeMouseMode(SDL_bool enabled)
{
#if SDL_VIDEO_DRIVER_X11_XINPUT2
if (X11_Xinput2IsInitialized()) {
return 0;
}
#else
SDL_Unsupported();
#endif
return -1;
return X11_Xinput2IsInitialized() ? 0 : SDL_Unsupported();
}

static int X11_CaptureMouse(SDL_Window *window)
Expand Down Expand Up @@ -414,12 +410,9 @@ static Uint32 X11_GetGlobalMouseState(int *x, int *y)

/* !!! FIXME: should we XSync() here first? */

#if !SDL_VIDEO_DRIVER_X11_XINPUT2
videodata->global_mouse_changed = SDL_TRUE;
#else
if (!SDL_X11_HAVE_XINPUT2)
if (!X11_Xinput2IsInitialized()) {
videodata->global_mouse_changed = SDL_TRUE;
#endif
}

/* check if we have this cached since XInput last saw the mouse move. */
/* !!! FIXME: can we just calculate this from XInput's events? */
Expand Down

0 comments on commit d0ff144

Please sign in to comment.