+static void execSetupGraphics_setRenderingModes()
+{
+ if (rendering_modes == NULL)
+ {
+ int i;
+
+ for (i = 0; rendering_modes_list[i].value != NULL; i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
+ char identifier[32], name[32];
+ char *value = rendering_modes_list[i].value;
+ char *text = rendering_modes_list[i].text;
+
+ ti->node_top = &rendering_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, "Special Rendering");
+
+ pushTreeInfo(&rendering_modes, ti);
+ }
+
+ /* sort rendering mode values to start with lowest rendering mode value */
+ sortTreeInfo(&rendering_modes);
+
+ /* set current rendering mode value to configured rendering mode value */
+ rendering_mode_current =
+ getTreeInfoFromIdentifier(rendering_modes, setup.screen_rendering_mode);
+
+ /* if that fails, set current rendering mode to reliable default value */
+ if (rendering_mode_current == NULL)
+ rendering_mode_current =
+ getTreeInfoFromIdentifier(rendering_modes,
+ STR_SPECIAL_RENDERING_DEFAULT);
+
+ /* if that also fails, set current rendering mode to first available one */
+ if (rendering_mode_current == NULL)
+ rendering_mode_current = rendering_modes;
+ }
+
+ setup.screen_rendering_mode = rendering_mode_current->identifier;
+
+ /* needed for displaying rendering mode text instead of identifier */
+ rendering_mode_text = rendering_mode_current->name;
+}
+