Read configuration from ini file
Use gtk frontend desmume_config.* machinery to read the ini file. This should fixup joystick not working correctly as reported in #2897620.
This commit is contained in:
parent
3b9af24780
commit
5d6a64797f
|
@ -4,7 +4,7 @@ include $(top_srcdir)/src/desmume.mk
|
|||
AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
|
||||
|
||||
bin_PROGRAMS = desmume-cli
|
||||
desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp
|
||||
desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../gtk/desmume_config.h ../gtk/desmume_config.cpp
|
||||
desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
|
||||
if HAVE_GDB_STUB
|
||||
desmume_cli_LDADD += ../gdbstub/libgdbstub.a
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "../mic.h"
|
||||
#include "../firmware.h"
|
||||
#include "../GPU_osd.h"
|
||||
#include "gtk/desmume_config.h"
|
||||
#ifdef GDB_STUB
|
||||
#include "../gdbstub.h"
|
||||
#endif
|
||||
|
@ -748,6 +749,8 @@ int main(int argc, char ** argv) {
|
|||
int boost = 0;
|
||||
int error;
|
||||
|
||||
GKeyFile *keyfile;
|
||||
|
||||
#ifdef DISPLAY_FPS
|
||||
u32 fps_timing = 0;
|
||||
u32 fps_frame_counter = 0;
|
||||
|
@ -922,8 +925,9 @@ int main(int argc, char ** argv) {
|
|||
|
||||
/* Initialize joysticks */
|
||||
if(!init_joy()) return 1;
|
||||
/* Load our own keyboard configuration */
|
||||
set_kb_keys(cli_kb_cfg);
|
||||
/* Load keyboard and joystick configuration */
|
||||
keyfile = desmume_config_read_file(cli_kb_cfg);
|
||||
desmume_config_dispose(keyfile);
|
||||
|
||||
if ( !my_config.disable_limiter) {
|
||||
/* create the semaphore used for fps limiting */
|
||||
|
@ -1005,8 +1009,6 @@ int main(int argc, char ** argv) {
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Unload joystick */
|
||||
uninit_joy();
|
||||
|
||||
|
|
Loading…
Reference in New Issue