@@ -462,7 +462,8 @@ static const menu_t SetupDef =
462462 0
463463};
464464
465- static const setup_menu_t gen_settings3[] = // General Settings
465+ setup_menu_t *gen_settings3 = NULL ;
466+ const setup_menu_t gen_settings3_init[] = // General Settings
466467{
467468 {" GENERAL" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
468469 {" Enable Translucency" , S_YESNO, m_null, G_X, G_Y + 1 *G_H, {" translucency" }, M_Trans},
@@ -484,8 +485,10 @@ static const setup_menu_t gen_settings3[] = // General Settings
484485
485486 {0 ,S_SKIP|S_END,m_null}
486487};
488+ const int num_gen_settings3 = sizeof (gen_settings3_init) / sizeof (gen_settings3_init[0 ]);
487489
488- static const setup_menu_t weap_settings1[] = // Weapons Settings screen
490+ setup_menu_t *weap_settings1 = NULL ;
491+ const setup_menu_t weap_settings1_init[] = // Weapons Settings screen
489492{
490493 {" WEAPONS" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
491494 {" ENABLE RECOIL" , S_YESNO,m_null,G_X, G_Y+1 *G_H, {" weapon_recoil" }},
@@ -505,8 +508,10 @@ static const setup_menu_t weap_settings1[] = // Weapons Settings screen
505508
506509 {0 ,S_SKIP|S_END,m_null}
507510};
511+ const int num_weap_settings1 = sizeof (weap_settings1_init) / sizeof (weap_settings1_init[0 ]);
508512
509- static const setup_menu_t stat_settings1[] = // Status Bar and HUD Settings screen
513+ setup_menu_t *stat_settings1 = NULL ;
514+ const setup_menu_t stat_settings1_init[] = // Status Bar and HUD Settings screen
510515{
511516 {" STATUS BAR" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
512517 {" Use Red Numbers" ,S_YESNO, m_null,G_X,G_Y+ 1 *G_H, {" sts_always_red" }},
@@ -523,8 +528,10 @@ static const setup_menu_t stat_settings1[] = // Status Bar and HUD Settings scr
523528
524529 {0 ,S_SKIP|S_END,m_null}
525530};
531+ const int num_stat_settings1 = sizeof (stat_settings1_init) / sizeof (stat_settings1_init[0 ]);
526532
527- static const setup_menu_t enem_settings1[] = // Enemy Settings screen
533+ setup_menu_t *enem_settings1 = NULL ;
534+ const setup_menu_t enem_settings1_init[] = // Enemy Settings screen
528535{
529536 {" ENEMIES" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
530537 {" Monster Infighting When Provoked" ,S_YESNO,m_null,G_X,G_Y+ 1 *G_H, {" monster_infighting" }},
@@ -542,8 +549,10 @@ static const setup_menu_t enem_settings1[] = // Enemy Settings screen
542549
543550 {0 ,S_SKIP|S_END,m_null}
544551};
552+ const int num_enem_settings1 = sizeof (enem_settings1_init) / sizeof (enem_settings1_init[0 ]);
545553
546- static const setup_menu_t comp_settings1[] = // Compatibility Settings screen #1
554+ setup_menu_t *comp_settings1 = NULL ;
555+ const setup_menu_t comp_settings1_init[] = // Compatibility Settings screen #1
547556{
548557 {" COMPAT 1/1" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
549558 {" Any monster can telefrag on MAP30" , S_YESNO, m_null, G_X, G_Y + 1 *G_H, {" comp_telefrag" }},
@@ -560,8 +569,10 @@ static const setup_menu_t comp_settings1[] = // Compatibility Settings screen #
560569
561570 {0 ,S_SKIP|S_END,m_null}
562571};
572+ const int num_comp_settings1 = sizeof (comp_settings1_init) / sizeof (comp_settings1_init[0 ]);
563573
564- static const setup_menu_t comp_settings2[] = // Compatibility Settings screen #2
574+ setup_menu_t *comp_settings2 = NULL ;
575+ const setup_menu_t comp_settings2_init[] = // Compatibility Settings screen #2
565576{
566577 {" COMPAT 2/2" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
567578 {" Lost souls don't bounce off flat surfaces" , S_YESNO, m_null, G_X, G_Y + 1 *G_H, {" comp_soul" }},
@@ -578,8 +589,10 @@ static const setup_menu_t comp_settings2[] = // Compatibility Settings screen #
578589
579590 {0 ,S_SKIP|S_END,m_null}
580591};
592+ const int num_comp_settings2 = sizeof (comp_settings2_init) / sizeof (comp_settings2_init[0 ]);
581593
582- static const setup_menu_t keys_settings1[] = // Key Binding screen strings
594+ setup_menu_t *keys_settings1 = NULL ;
595+ const setup_menu_t keys_settings1_init[] = // Key Binding screen strings
583596{
584597 {" KEYBOARD 1/2" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
585598 {" MOVEMENT" ,S_SKIP|S_TITLE,m_null,G_X,G_Y+1 *G_H},
@@ -601,8 +614,10 @@ static const setup_menu_t keys_settings1[] = // Key Binding screen strings
601614
602615 {0 ,S_SKIP|S_END,m_null}
603616};
617+ const int num_keys_settings1 = sizeof (keys_settings1_init) / sizeof (keys_settings1_init[0 ]);
604618
605- static const setup_menu_t keys_settings2[] = // Key Binding screen strings
619+ setup_menu_t *keys_settings2 = NULL ;
620+ const setup_menu_t keys_settings2_init[] = // Key Binding screen strings
606621{
607622 {" KEYBOARD 2/2" ,S_SKIP|S_TITLE,m_null,200 ,G_Y},
608623 {" SCREEN" ,S_SKIP|S_TITLE,m_null,G_X,G_Y+1 *G_H},
@@ -625,6 +640,7 @@ static const setup_menu_t keys_settings2[] = // Key Binding screen strings
625640
626641 {0 ,S_SKIP|S_END,m_null}
627642};
643+ const int num_keys_settings2 = sizeof (keys_settings2_init) / sizeof (keys_settings2_init[0 ]);
628644
629645static const setup_menu_t helpstrings[] = // HELP screen strings
630646{
@@ -713,19 +729,20 @@ static const setup_menu_t cred_settings[] =
713729 {0 ,S_SKIP|S_END,m_null},
714730};
715731
716- static setup_menu_t *setup_screens[] =
717- {
718- gen_settings3,
719- weap_settings1,
720- stat_settings1,
721- enem_settings1,
722- comp_settings1,
723- comp_settings2,
724- keys_settings1,
725- keys_settings2,
732+ setup_menu_t **setup_screens = NULL ;
733+ const setup_menu_t *setup_screens_init[] =
734+ {
735+ NULL , // gen_settings3,
736+ NULL , // weap_settings1,
737+ NULL , // stat_settings1,
738+ NULL , // enem_settings1,
739+ NULL , // comp_settings1,
740+ NULL , // comp_settings2,
741+ NULL , // keys_settings1,
742+ NULL , // keys_settings2,
726743 NULL
727744};
728-
745+ const int num_setup_screens = sizeof (setup_screens_init) / sizeof ( setup_menu_t *);
729746
730747static void M_SetupNextMenu (menu_t *menudef)
731748{
@@ -1244,6 +1261,7 @@ static void M_InitDefaults(void)
12441261 if (!(dp = M_LookupDefault (t->var .name ))) {
12451262 I_Error (" M_InitDefaults: Couldn't find config variable '%s'\n " , t->var .name );
12461263 } else {
1264+ // I_Error("M_InitDefaults: found config variable '%s'\n", t->var.name);
12471265 t->var .def = dp;
12481266 }
12491267 }
@@ -1379,7 +1397,7 @@ static void M_ReadSaveStrings(void)
13791397 char name[PATH_MAX+1 ];
13801398 FILE *fp;
13811399
1382- G_SaveGameName (name,sizeof (name),i, false );
1400+ G_SaveGameName (name,sizeof (name),i);
13831401
13841402 if ((fp = fopen (name, " rb" ))) {
13851403 fread (&savegamestrings[i], SAVESTRINGSIZE, 1 , fp);
0 commit comments