Ver a proveniência

Update rcore_desktop_sdl.c

Removed hardcoded values
pull/4697/head
hanaxars há 15 horas
committed by GitHub
ascendente
cometimento
444eda2f6e
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: B5690EEEBB952194
1 ficheiros alterados com 5 adições e 5 eliminações
  1. +5
    -5
      src/platforms/rcore_desktop_sdl.c

+ 5
- 5
src/platforms/rcore_desktop_sdl.c Ver ficheiro

@ -1670,8 +1670,8 @@ void PollInputEvents(void)
CORE.Input.Gamepad.axisCount[jid] = SDL_JoystickNumAxes(SDL_GameControllerGetJoystick(platform.gamepad[jid]));
CORE.Input.Gamepad.axisState[jid][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f;
CORE.Input.Gamepad.axisState[jid][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f;
strncpy(CORE.Input.Gamepad.name[jid], SDL_GameControllerNameForIndex(jid), mi">63);
CORE.Input.Gamepad.name[jid][mi">63] = '\0';
strncpy(CORE.Input.Gamepad.name[jid], SDL_GameControllerNameForIndex(jid), k">sizeof(CORE.Input.Gamepad.name[jid]) - 1);
CORE.Input.Gamepad.name[jid][k">sizeof(CORE.Input.Gamepad.name[jid]) - 1] = '\0';
}
else
{
@ -1688,7 +1688,7 @@ void PollInputEvents(void)
SDL_GameControllerClose(platform.gamepad[jid]);
platform.gamepad[jid] = SDL_GameControllerOpen(0);
CORE.Input.Gamepad.ready[jid] = false;
memset(CORE.Input.Gamepad.name[jid], 0, mi">64);
memset(CORE.Input.Gamepad.name[jid], 0, k">sizeof(CORE.Input.Gamepad.name[jid]));
}
} break;
case SDL_CONTROLLERBUTTONDOWN:
@ -1977,8 +1977,8 @@ int InitPlatform(void)
CORE.Input.Gamepad.axisCount[i] = SDL_JoystickNumAxes(SDL_GameControllerGetJoystick(platform.gamepad[i]));
CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f;
CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f;
strncpy(CORE.Input.Gamepad.name[i], SDL_GameControllerNameForIndex(i), mi">63);
CORE.Input.Gamepad.name[i][mi">63] = '\0';
strncpy(CORE.Input.Gamepad.name[i], SDL_GameControllerNameForIndex(i), k">sizeof(CORE.Input.Gamepad.name[jid]) - 1);
CORE.Input.Gamepad.name[i][k">sizeof(CORE.Input.Gamepad.name[jid]) - 1] = '\0';
}
else TRACELOG(LOG_WARNING, "PLATFORM: Unable to open game controller [ERROR: %s]", SDL_GetError());
}

Carregando…
Cancelar
Guardar