MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / txtDisplayWidthChange

Method txtDisplayWidthChange

src/Menu/OptionsVideoState.cpp:388–409  ·  view source on GitHub ↗

* Changes the Display Width option. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

386 * @param action Pointer to an action.
387 */
388void OptionsVideoState::txtDisplayWidthChange(Action *)
389{
390 std::wstringstream ss;
391 int width = 0;
392 ss << std::dec << _txtDisplayWidth->getText();
393 ss >> std::dec >> width;
394 Options::newDisplayWidth = width;
395 // Update resolution mode
396 if (_res != (SDL_Rect**)-1 && _res != (SDL_Rect**)0)
397 {
398 int i;
399 _resCurrent = -1;
400 for (i = 0; _res[i]; ++i)
401 {
402 if (_resCurrent == -1 &&
403 ((_res[i]->w == Options::newDisplayWidth && _res[i]->h <= Options::newDisplayHeight) || _res[i]->w < Options::newDisplayWidth))
404 {
405 _resCurrent = i;
406 }
407 }
408 }
409}
410
411/**
412 * Changes the Display Height option.

Callers

nothing calls this directly

Calls 1

getTextMethod · 0.45

Tested by

no test coverage detected