equal
deleted
inserted
replaced
540 |
540 |
541 if ControllerNumControllers > 0 then |
541 if ControllerNumControllers > 0 then |
542 begin |
542 begin |
543 for j:= 0 to pred(ControllerNumControllers) do |
543 for j:= 0 to pred(ControllerNumControllers) do |
544 begin |
544 begin |
545 WriteLnToConsole('Using game controller: ' + shortstring(SDL_JoystickName(j))); |
545 WriteLnToConsole('Game controller no. ' + IntToStr(j) + ', name "' + shortstring(SDL_JoystickNameForIndex(j)) + '":'); |
546 Controller[j]:= SDL_JoystickOpen(j); |
546 Controller[j]:= SDL_JoystickOpen(j); |
547 if Controller[j] = nil then |
547 if Controller[j] = nil then |
548 WriteLnToConsole('* Failed to open game controller!') |
548 WriteLnToConsole('* Failed to open game controller no. ' + IntToStr(j) + '!') |
549 else |
549 else |
550 begin |
550 begin |
551 ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]); |
551 ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]); |
552 //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]); |
552 //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]); |
553 ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]); |
553 ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]); |