X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fsdl.c;h=b127c7844055152de46fc5f8474abd93c5be1237;hb=ea6e4698905d7440a265e323d03cf13fc323c44b;hp=e9d10df51f3a8103acb3520b27615e00cb487e1c;hpb=74c0f7de91268e40d15948f473eac51a9760b9c0;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index e9d10df5..b127c784 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1116,9 +1116,8 @@ int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst) ----------------------------------------------------------------------------- zoomSurface() - Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. + Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. - If 'smooth' is 1 then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. ----------------------------------------------------------------------------- @@ -1441,6 +1440,7 @@ void HandleJoystickEvent(Event *event) void SDLInitJoysticks() { static boolean sdl_joystick_subsystem_initialized = FALSE; + boolean print_warning = !sdl_joystick_subsystem_initialized; int i; if (!sdl_joystick_subsystem_initialized) @@ -1460,11 +1460,19 @@ void SDLInitJoysticks() int joystick_nr = getJoystickNrFromDeviceName(device_name); if (joystick_nr >= SDL_NumJoysticks()) + { + if (setup.input[i].use_joystick && print_warning) + Error(ERR_WARN, "cannot find joystick %d", joystick_nr); + joystick_nr = -1; + } /* misuse joystick file descriptor variable to store joystick number */ joystick.fd[i] = joystick_nr; + if (joystick_nr == -1) + continue; + /* this allows subsequent calls to 'InitJoysticks' for re-initialization */ if (SDLCheckJoystickOpened(joystick_nr)) SDLCloseJoystick(joystick_nr); @@ -1474,7 +1482,9 @@ void SDLInitJoysticks() if (!SDLOpenJoystick(joystick_nr)) { - Error(ERR_WARN, "cannot open joystick %d", joystick_nr); + if (print_warning) + Error(ERR_WARN, "cannot open joystick %d", joystick_nr); + continue; }