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

Method GeoscapeState

src/Geoscape/GeoscapeState.cpp:119–415  ·  view source on GitHub ↗

* Initializes all the elements in the Geoscape screen. * @param game Pointer to the core game. */

Source from the content-addressed store, hash-verified

117 * @param game Pointer to the core game.
118 */
119GeoscapeState::GeoscapeState(Game *game) : State(game), _pause(false), _zoomInEffectDone(false), _zoomOutEffectDone(false), _popups(), _dogfights(), _dogfightsToBeStarted(), _minimizedDogfights(0)
120{
121 int screenWidth = Options::baseXGeoscape;
122 int screenHeight = Options::baseYGeoscape;
123
124 // Create objects
125 Surface *hd = _game->getResourcePack()->getSurface("ALTGEOBORD.SCR");
126 _bg = new Surface(hd->getWidth(), hd->getHeight(), 0, 0);
127 _sideLine = new Surface(64, screenHeight, screenWidth - 64, 0);
128 _sidebar = new Surface(64, 200, screenWidth - 64, screenHeight / 2 - 100);
129
130 _globe = new Globe(_game, (screenWidth-64)/2, screenHeight/2, screenWidth-64, screenHeight, 0, 0);
131 _bg->setX((_globe->getWidth() - _bg->getWidth()) / 2);
132 _bg->setY((_globe->getHeight() - _bg->getHeight()) / 2);
133
134 _btnIntercept = new TextButton(63, 11, screenWidth-63, screenHeight/2-100);
135 _btnBases = new TextButton(63, 11, screenWidth-63, screenHeight/2-88);
136 _btnGraphs = new TextButton(63, 11, screenWidth-63, screenHeight/2-76);
137 _btnUfopaedia = new TextButton(63, 11, screenWidth-63, screenHeight/2-64);
138 _btnOptions = new TextButton(63, 11, screenWidth-63, screenHeight/2-52);
139 _btnFunding = new TextButton(63, 11, screenWidth-63, screenHeight/2-40);
140
141 _btn5Secs = new TextButton(31, 13, screenWidth-63, screenHeight/2+12);
142 _btn1Min = new TextButton(31, 13, screenWidth-31, screenHeight/2+12);
143 _btn5Mins = new TextButton(31, 13, screenWidth-63, screenHeight/2+26);
144 _btn30Mins = new TextButton(31, 13, screenWidth-31, screenHeight/2+26);
145 _btn1Hour = new TextButton(31, 13, screenWidth-63, screenHeight/2+40);
146 _btn1Day = new TextButton(31, 13, screenWidth-31, screenHeight/2+40);
147
148 _btnRotateLeft = new InteractiveSurface(12, 10, screenWidth-61, screenHeight/2+76);
149 _btnRotateRight = new InteractiveSurface(12, 10, screenWidth-37, screenHeight/2+76);
150 _btnRotateUp = new InteractiveSurface(13, 12, screenWidth-49, screenHeight/2+62);
151 _btnRotateDown = new InteractiveSurface(13, 12, screenWidth-49, screenHeight/2+87);
152 _btnZoomIn = new InteractiveSurface(23, 23, screenWidth-25, screenHeight/2+56);
153 _btnZoomOut = new InteractiveSurface(13, 17, screenWidth-20, screenHeight/2+82);
154
155 int height = (screenHeight - Screen::ORIGINAL_HEIGHT) / 2 + 10;
156 _sideTop = new TextButton(63, height, screenWidth-63, _sidebar->getY() - height - 1);
157 _sideBottom = new TextButton(63, height, screenWidth-63, _sidebar->getY() + _sidebar->getHeight() + 1);
158
159 _txtHour = new Text(20, 16, screenWidth-61, screenHeight/2-26);
160 _txtHourSep = new Text(4, 16, screenWidth-41, screenHeight/2-26);
161 _txtMin = new Text(20, 16, screenWidth-37, screenHeight/2-26);
162 _txtMinSep = new Text(4, 16, screenWidth-17, screenHeight/2-26);
163 _txtSec = new Text(11, 8, screenWidth-13, screenHeight/2-20);
164 _txtWeekday = new Text(59, 8, screenWidth-61, screenHeight/2-13);
165 _txtDay = new Text(29, 8, screenWidth-61, screenHeight/2-6);
166 _txtMonth = new Text(29, 8, screenWidth-32, screenHeight/2-6);
167 _txtYear = new Text(59, 8, screenWidth-61, screenHeight/2+1);
168 _txtFunds = new Text(59, 8, screenWidth-61, screenHeight/2-27);
169
170 _timeSpeed = _btn5Secs;
171 _gameTimer = new Timer(Options::geoClockSpeed);
172
173 _zoomInEffectTimer = new Timer(Options::dogfightSpeed+10);
174 _zoomOutEffectTimer = new Timer(Options::dogfightSpeed+10);
175 _dogfightStartTimer = new Timer(Options::dogfightSpeed+10);
176

Callers

nothing calls this directly

Calls 15

getCursorMethod · 0.80
getFpsCounterMethod · 0.80
copyMethod · 0.80
drawRectMethod · 0.80
getLanguageMethod · 0.80
onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
onMousePressMethod · 0.80
onMouseReleaseMethod · 0.80
onKeyboardReleaseMethod · 0.80
onTimerMethod · 0.80
getSurfaceMethod · 0.45

Tested by

no test coverage detected