Skip to content

Commit

Permalink
MorphOS: some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Jan 16, 2024
1 parent 82ca1a8 commit 220d55d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/file/SDL_rwops.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ morphos_file_open(SDL_RWops *context, const char *filename, const char *mode)
}

static Sint64 SDLCALL
morphos_file_size(SDL_RWops * context)
morphos_file_size(SDL_RWops *context)
{
struct FileInfoBlock fib;

Expand Down Expand Up @@ -743,9 +743,9 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
rwops->type = SDL_RWOPS_WINFILE;
#elif defined(__MORPHOS__)
rwops = SDL_CreateRW();
if (rwops == NULL)
if (!rwops) {
return NULL; /* SDL_SetError already setup by SDL_CreateRW() */

}
rwops->size = morphos_file_size;
rwops->seek = morphos_file_seek;
rwops->read = morphos_file_read;
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@ void SDL_UpdateJoysticks(void)

if (joystick->rumble_resend && now >= joystick->rumble_resend) {
#ifdef __MORPHOS__
joystick->driver->Rumble(joystick, joystick->low_frequency_rumble, joystick->high_frequency_rumble, 100/*duration_ms*/);
joystick->driver->Rumble(joystick, joystick->low_frequency_rumble, joystick->high_frequency_rumble, 100/*duration_ms*/);
#else
joystick->driver->Rumble(joystick, joystick->low_frequency_rumble, joystick->high_frequency_rumble);
#endif
Expand Down
1 change: 0 additions & 1 deletion src/video/SDL_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -4930,7 +4930,6 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
#endif
#ifdef SDL_VIDEO_DRIVER_MORPHOS
if (retval == -1 &&
SDL_IsMessageboxValidForDriver(messageboxdata, SDL_SYSWM_MORPHOS) &&
MOS_ShowMessageBox(messageboxdata, buttonid) == 0) {
retval = 0;
}
Expand Down
1 change: 1 addition & 0 deletions src/video/morphos/SDL_mosmodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ MOS_GetScreen(SDL_VideoDevice *device, BYTE fullscreen, SDL_bool support3d)
int use_wb_screen = 0;
ULONG openError = 0;


if (!fullscreen && data->ScrMonName == NULL) {
data->CustomScreen = NULL;
screen = LockPubScreen(NULL);
Expand Down
6 changes: 4 additions & 2 deletions src/video/morphos/SDL_mosmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ MOS_SetRelativeMouseMode(SDL_bool enabled)
static Uint32
MOS_GetDoubleClickTimeInMillis(SDL_VideoDevice *device)
{
D("[%s]\n", __FUNCTION__);
Uint32 interval = 500;

/*
// TODO....
struct RDArgs rda;
SDL_memset(&rda, 0, sizeof(rda));
rda.RDA_Source.CS_Buffer = (STRPTR)SDL_LoadFile("ENV:sys/mouse.conf", (size_t *)&rda.RDA_Source.CS_Length);
Expand All @@ -254,7 +256,7 @@ MOS_GetDoubleClickTimeInMillis(SDL_VideoDevice *device)
}
SDL_free(rda.RDA_Source.CS_Buffer);
}

*/
return interval;
}

Expand Down

0 comments on commit 220d55d

Please sign in to comment.