+static void execSetupGraphics_setVsyncModes(void)
+{
+ if (vsync_modes == NULL)
+ {
+ int i;
+
+ for (i = 0; vsync_modes_list[i].value != NULL; i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
+ char identifier[32], name[32];
+ char *value = vsync_modes_list[i].value;
+ char *text = vsync_modes_list[i].text;
+
+ ti->node_top = &vsync_modes;
+ ti->sort_priority = i;
+
+ sprintf(identifier, "%s", value);
+ sprintf(name, "%s", text);
+
+ setString(&ti->identifier, identifier);
+ setString(&ti->name, name);
+ setString(&ti->name_sorting, name);
+ setString(&ti->infotext, STR_SETUP_CHOOSE_VSYNC);
+
+ pushTreeInfo(&vsync_modes, ti);
+ }
+
+ /* sort vsync mode values to start with lowest vsync mode value */
+ sortTreeInfo(&vsync_modes);
+
+ /* set current vsync mode value to configured vsync mode value */
+ vsync_mode_current =
+ getTreeInfoFromIdentifier(vsync_modes, setup.vsync_mode);
+
+ /* if that fails, set current vsync mode to reliable default value */
+ if (vsync_mode_current == NULL)
+ vsync_mode_current =
+ getTreeInfoFromIdentifier(vsync_modes, STR_VSYNC_MODE_DEFAULT);
+
+ /* if that also fails, set current vsync mode to first available one */
+ if (vsync_mode_current == NULL)
+ vsync_mode_current = vsync_modes;
+ }
+
+ setup.vsync_mode = vsync_mode_current->identifier;
+
+ /* needed for displaying vsync mode text instead of identifier */
+ vsync_mode_text = vsync_mode_current->name;
+}
+
+static void execSetupGraphics(void)