mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-14 11:56:07 +00:00
Add support for SDL_GAMECONTROLLERCONFIG environment variable
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -252,11 +252,21 @@ int main(int argc, char* argv[]) {
|
||||
config.stream.supportsHevc = config.codec != CODEC_H264 && (config.codec == CODEC_HEVC || platform_supports_hevc(system));
|
||||
|
||||
if (IS_EMBEDDED(system)) {
|
||||
if (config.mapping == NULL) {
|
||||
char* mapping_env = getenv("SDL_GAMECONTROLLERCONFIG");
|
||||
if (config.mapping == NULL && mapping_env == NULL) {
|
||||
fprintf(stderr, "Please specify mapping file as default mapping could not be found.\n");
|
||||
exit(-1);
|
||||
}
|
||||
struct mapping* mappings = mapping_load(config.mapping, config.debug_level > 0);
|
||||
|
||||
struct mapping* mappings;
|
||||
if (config.mapping != NULL)
|
||||
mappings = mapping_load(config.mapping, config.debug_level > 0);
|
||||
|
||||
if (mapping_env != NULL) {
|
||||
struct mapping* map = mapping_parse(mapping_env);
|
||||
map->next = mappings;
|
||||
mappings = map;
|
||||
}
|
||||
|
||||
for (int i=0;i<config.inputsCount;i++) {
|
||||
if (config.debug_level > 0)
|
||||
|
||||
Reference in New Issue
Block a user