MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / RenderOptionsMenu

Method RenderOptionsMenu

TombEngine/Renderer/RendererDrawMenu.cpp:118–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 void Renderer::RenderOptionsMenu(Menu menu, int initialY)
119 {
120 constexpr auto RIGHT_ARROW_X_OFFSET = DISPLAY_SPACE_RES.x - MenuLeftSideEntry;
121 static const auto LEFT_ARROW_STRING = std::string("<");
122 static const auto RIGHT_ARROW_STRING = std::string(">");
123 static const auto CONTROL_SETTINGS_BLOCK_Y_OFFSET = (MenuVerticalNarrowLineSpacing * (int)QuickActionStrings.size()) + (MenuVerticalBlockSpacing * 2.5f);
124
125 int y = 0;
126 auto titleOption = g_Gui.GetSelectedOption();
127
128 auto optionColor = g_GameFlow->GetSettings()->UI.HeaderTextColor;
129 auto headerColor = g_GameFlow->GetSettings()->UI.OptionTextColor;
130 auto plainColor = g_GameFlow->GetSettings()->UI.PlainTextColor;
131 auto disabledColor = g_GameFlow->GetSettings()->UI.DisabledTextColor;
132
133 char stringBuffer[32] = {};
134 auto screenResolution = g_Configuration.SupportedScreenResolutions[g_Gui.GetCurrentSettings().SelectedScreenResolution];
135 sprintf(stringBuffer, "%d x %d", screenResolution.x, screenResolution.y);
136
137 auto* shadowMode = g_Gui.GetCurrentSettings().Configuration.ShadowType != ShadowMode::None ?
138 (g_Gui.GetCurrentSettings().Configuration.ShadowType == ShadowMode::Player ? STRING_SHADOWS_PLAYER : STRING_SHADOWS_ALL) : STRING_SHADOWS_NONE;
139
140 const char* antialiasMode;
141 switch (g_Gui.GetCurrentSettings().Configuration.AntialiasingMode)
142 {
143 default:
144 case AntialiasingMode::None:
145 antialiasMode = STRING_ANTIALIASING_NONE;
146 break;
147
148 case AntialiasingMode::Low:
149 antialiasMode = STRING_ANTIALIASING_LOW;
150 break;
151
152 case AntialiasingMode::Medium:
153 antialiasMode = STRING_ANTIALIASING_MEDIUM;
154 break;
155
156 case AntialiasingMode::High:
157 antialiasMode = STRING_ANTIALIASING_HIGH;
158 break;
159 }
160
161 switch (menu)
162 {
163 case Menu::Options:
164 // Setup needed parameters
165 y = initialY;
166
167 // Display
168 AddString(MenuCenterEntry, y, g_GameFlow->GetString(STRING_DISPLAY), plainColor, SF_Center(titleOption == 0));
169 GetNextLinePosition(&y);
170
171 // Other options
172 AddString(MenuCenterEntry, y, g_GameFlow->GetString(STRING_OTHER_SETTINGS), plainColor, SF_Center(titleOption == 1));
173 GetNextLinePosition(&y);
174
175 // Controls

Callers

nothing calls this directly

Calls 14

sprintfFunction · 0.85
SF_CenterFunction · 0.85
GetNextLinePositionFunction · 0.85
GetNextBlockPositionFunction · 0.85
SFFunction · 0.85
Str_EnabledFunction · 0.85
to_stringFunction · 0.85
GetSelectedOptionMethod · 0.80
GetSettingsMethod · 0.80
GetStringMethod · 0.80
GetBoundKeyIDMethod · 0.80

Tested by

no test coverage detected