comparison render_sdl.c @ 1603:c0727712d529

Read extral SDL2 mappings on startup from controller_types.cfg
author Michael Pavone <pavone@retrodev.com>
date Tue, 31 Jul 2018 23:08:52 -0700
parents 7f39c40b4b25
children 419a0a133b5c
comparison
equal deleted inserted replaced
1602:b452887f85b4 1603:c0727712d529
14 #include "bindings.h" 14 #include "bindings.h"
15 #include "util.h" 15 #include "util.h"
16 #include "ppm.h" 16 #include "ppm.h"
17 #include "png.h" 17 #include "png.h"
18 #include "config.h" 18 #include "config.h"
19 #include "controller_info.h"
19 20
20 #ifndef DISABLE_OPENGL 21 #ifndef DISABLE_OPENGL
21 #include <GL/glew.h> 22 #include <GL/glew.h>
22 #endif 23 #endif
23 24
1139 int added = SDL_GameControllerAddMappingsFromRW(SDL_RWFromMem(db_data, db_size), 1); 1140 int added = SDL_GameControllerAddMappingsFromRW(SDL_RWFromMem(db_data, db_size), 1);
1140 free(db_data); 1141 free(db_data);
1141 printf("Added %d game controller mappings from gamecontrollerdb.txt\n", added); 1142 printf("Added %d game controller mappings from gamecontrollerdb.txt\n", added);
1142 } 1143 }
1143 1144
1145 controller_add_mappings();
1146
1144 SDL_JoystickEventState(SDL_ENABLE); 1147 SDL_JoystickEventState(SDL_ENABLE);
1145 1148
1146 render_set_video_standard(VID_NTSC); 1149 render_set_video_standard(VID_NTSC);
1147 1150
1148 atexit(render_quit); 1151 atexit(render_quit);