Store graphics card in config file as name rather than number.

This commit is contained in:
SarahW 2017-02-24 20:02:31 +00:00
commit 5c4b6ade9a
3 changed files with 52 additions and 26 deletions

View file

@ -594,7 +594,11 @@ void loadconfig(char *fn)
cpu_use_dynarec = config_get_int(NULL, "cpu_use_dynarec", 0);
cpu_waitstates = config_get_int(NULL, "cpu_waitstates", 0);
gfxcard = config_get_int(NULL, "gfxcard", 0);
p = (char *)config_get_string(NULL, "gfxcard", "");
if (p)
gfxcard = video_get_video_from_internal_name(p);
else
gfxcard = 0;
video_speed = config_get_int(NULL, "video_speed", 3);
sound_card_current = config_get_int(NULL, "sndcard", SB2);
@ -705,7 +709,7 @@ void saveconfig()
config_set_int(NULL, "cpu_use_dynarec", cpu_use_dynarec);
config_set_int(NULL, "cpu_waitstates", cpu_waitstates);
config_set_int(NULL, "gfxcard", gfxcard);
config_set_string(NULL, "gfxcard", video_get_internal_name(video_old_to_new(gfxcard)));
config_set_int(NULL, "video_speed", video_speed);
config_set_int(NULL, "sndcard", sound_card_current);
config_set_int(NULL, "cpu_speed", cpuspeed);