MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / Update

Method Update

src/openrct2-ui/interface/InGameConsole.cpp:264–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void InGameConsole::Update()
265{
266 _consoleTopLeft = { 0, 0 };
267 _consoleBottomRight = { ContextGetWidth(), 322 };
268
269 if (_isOpen)
270 {
271 // When scrolling the map, the console pixels get copied... therefore invalidate the screen
272 WindowBase* mainWindow = WindowGetMain();
273 if (mainWindow != nullptr)
274 {
275 Viewport* mainViewport = WindowGetViewport(mainWindow);
276 if (mainViewport != nullptr)
277 {
278 if (_lastMainViewport != mainViewport->viewPos)
279 {
280 _lastMainViewport = mainViewport->viewPos;
281
282 GfxInvalidateScreen();
283 }
284 }
285 }
286 }
287
288 if (_isCommandAwaitingCompletion && !IsExecuting())
289 {
290 WritePrompt();
291 _isCommandAwaitingCompletion = false;
292 }
293
294 // Flash the caret
295 _consoleCaretTicks = (_consoleCaretTicks + 1) % 30;
296}
297
298void InGameConsole::Draw(RenderTarget& rt) const
299{

Callers 2

TickFunction · 0.45
seekMethod · 0.45

Calls 4

ContextGetWidthFunction · 0.85
WindowGetMainFunction · 0.85
WindowGetViewportFunction · 0.85
GfxInvalidateScreenFunction · 0.85

Tested by

no test coverage detected