613 for (; sd->save.cmd != SL_END; sd++) { |
613 for (; sd->save.cmd != SL_END; sd++) { |
614 const SettingDescBase *sdb = &sd->desc; |
614 const SettingDescBase *sdb = &sd->desc; |
615 const SaveLoad *sld = &sd->save; |
615 const SaveLoad *sld = &sd->save; |
616 |
616 |
617 if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue; |
617 if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue; |
|
618 if (sd->desc.name == NULL) continue; |
618 |
619 |
619 // XXX - wtf is this?? (group override?) |
620 // XXX - wtf is this?? (group override?) |
620 s = strchr(sdb->name, '.'); |
621 s = strchr(sdb->name, '.'); |
621 if (s != NULL) { |
622 if (s != NULL) { |
622 group = ini_getgroup(ini, sdb->name, s - sdb->name); |
623 group = ini_getgroup(ini, sdb->name, s - sdb->name); |
680 |
681 |
681 /* If the setting is not saved to the configuration |
682 /* If the setting is not saved to the configuration |
682 * file, just continue with the next setting */ |
683 * file, just continue with the next setting */ |
683 if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue; |
684 if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue; |
684 if (sld->conv & SLF_CONFIG_NO) continue; |
685 if (sld->conv & SLF_CONFIG_NO) continue; |
|
686 if (sd->desc.name == NULL) continue; |
685 |
687 |
686 // XXX - wtf is this?? (group override?) |
688 // XXX - wtf is this?? (group override?) |
687 s = strchr(sdb->name, '.'); |
689 s = strchr(sdb->name, '.'); |
688 if (s != NULL) { |
690 if (s != NULL) { |
689 group = ini_getgroup(ini, sdb->name, s - sdb->name); |
691 group = ini_getgroup(ini, sdb->name, s - sdb->name); |
877 #define SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, from, to)\ |
879 #define SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, from, to)\ |
878 SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, full, str, proc, from, to) |
880 SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, full, str, proc, from, to) |
879 #define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, proc)\ |
881 #define SDTG_MMANY(name, type, flags, guiflags, var, def, full, str, proc)\ |
880 SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION) |
882 SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION) |
881 |
883 |
|
884 #define SDTG_CONDNULL(length, from, to)\ |
|
885 {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_CONDNULL(length, from, to)} |
|
886 |
882 #define SDTG_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_END()} |
887 #define SDTG_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_END()} |
883 |
888 |
884 /* Macros for various objects to go in the configuration file. |
889 /* Macros for various objects to go in the configuration file. |
885 * This section is for structures where their various members are saved */ |
890 * This section is for structures where their various members are saved */ |
886 #define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, full, str, proc, from, to)\ |
891 #define SDT_GENERAL(name, sdt_cmd, sle_cmd, type, flags, guiflags, base, var, length, def, min, max, full, str, proc, from, to)\ |
922 |
927 |
923 #define SDT_CONDMMANY(base, var, type, from, to, flags, guiflags, def, full, str, proc)\ |
928 #define SDT_CONDMMANY(base, var, type, from, to, flags, guiflags, def, full, str, proc)\ |
924 SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, full, str, proc, from, to) |
929 SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, full, str, proc, from, to) |
925 #define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc)\ |
930 #define SDT_MMANY(base, var, type, flags, guiflags, def, full, str, proc)\ |
926 SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc) |
931 SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc) |
|
932 |
|
933 #define SDT_CONDNULL(length, from, to)\ |
|
934 {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_CONDNULL(length, from, to)} |
927 |
935 |
928 #define SDT_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_END()} |
936 #define SDT_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_END()} |
929 |
937 |
930 /* Shortcuts for macros below. Logically if we don't save the value |
938 /* Shortcuts for macros below. Logically if we don't save the value |
931 * we also don't sync it in a network game */ |
939 * we also don't sync it in a network game */ |