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

Method OptionsVideoState

src/Menu/OptionsVideoState.cpp:49–322  ·  view source on GitHub ↗

* Initializes all the elements in the Video Options screen. * @param game Pointer to the core game. * @param origin Game section that originated this state. */

Source from the content-addressed store, hash-verified

47 * @param origin Game section that originated this state.
48 */
49OptionsVideoState::OptionsVideoState(Game *game, OptionsOrigin origin) : OptionsBaseState(game, origin)
50{
51 setCategory(_btnVideo);
52
53 // Create objects
54 _displaySurface = new InteractiveSurface(110, 32, 94, 18);
55 _txtDisplayResolution = new Text(114, 9, 94, 8);
56 _txtDisplayWidth = new TextEdit(this, 40, 17, 94, 26);
57 _txtDisplayX = new Text(16, 17, 132, 26);
58 _txtDisplayHeight = new TextEdit(this, 40, 17, 144, 26);
59 _btnDisplayResolutionUp = new ArrowButton(ARROW_BIG_UP, 14, 14, 186, 18);
60 _btnDisplayResolutionDown = new ArrowButton(ARROW_BIG_DOWN, 14, 14, 186, 36);
61
62 _txtLanguage = new Text(114, 9, 94, 52);
63 _cbxLanguage = new ComboBox(this, 104, 16, 94, 62);
64
65 _txtFilter = new Text(114, 9, 206, 52);
66 _cbxFilter = new ComboBox(this, 104, 16, 206, 62);
67
68 _txtMode = new Text(114, 9, 206, 22);
69 _cbxDisplayMode = new ComboBox(this, 104, 16, 206, 32);
70
71 _txtGeoScale = new Text(114, 9, 94, 82);
72 _cbxGeoScale = new ComboBox(this, 104, 16, 94, 92);
73
74 _txtBattleScale = new Text(114, 9, 94, 112);
75 _cbxBattleScale = new ComboBox(this, 104, 16, 94, 122);
76
77 _txtOptions = new Text(114, 9, 206, 82);
78 _btnLetterbox = new ToggleTextButton(104, 16, 206, 92);
79 _btnLockMouse = new ToggleTextButton(104, 16, 206, 110);
80
81 // Get available fullscreen modes
82 _res = SDL_ListModes(NULL, SDL_FULLSCREEN);
83 if (_res != (SDL_Rect**)-1 && _res != (SDL_Rect**)0)
84 {
85 int i;
86 _resCurrent = -1;
87 for (i = 0; _res[i]; ++i)
88 {
89 if (_resCurrent == -1 &&
90 ((_res[i]->w == Options::displayWidth && _res[i]->h <= Options::displayHeight) || _res[i]->w < Options::displayWidth))
91 {
92 _resCurrent = i;
93 }
94 }
95 _resAmount = i;
96 }
97 else
98 {
99 _resCurrent = -1;
100 _resAmount = 0;
101 _btnDisplayResolutionDown->setVisible(false);
102 _btnDisplayResolutionUp->setVisible(false);
103 Log(LOG_WARNING) << "Couldn't get display resolutions";
104 }
105
106 add(_displaySurface);

Callers

nothing calls this directly

Calls 15

getFolderContentsFunction · 0.85
setTooltipMethod · 0.80
onMouseInMethod · 0.80
onMouseOutMethod · 0.80
setNumericalMethod · 0.80
onMouseClickMethod · 0.80
setPressedMethod · 0.80
setOptionsMethod · 0.80
setSelectedMethod · 0.80
getDataFolderFunction · 0.50
setVisibleMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected