MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / renderAndUpdate

Function renderAndUpdate

src/OpenLoco/src/Graphics/Gfx.cpp:261–288  ·  view source on GitHub ↗

0x004CF63B TODO: Split this into two functions, one for rendering and one for processing messages.

Source from the content-addressed store, hash-verified

259 // 0x004CF63B
260 // TODO: Split this into two functions, one for rendering and one for processing messages.
261 void renderAndUpdate()
262 {
263 if (Ui::isInitialized())
264 {
265 auto& drawingEngine = Gfx::getDrawingEngine();
266
267 // Clear the screen if the scene hasn't been initialised yet, since the game doesn't clear
268 // the screen each frame it relies on overdrawing but with no tile elements or entities loaded
269 // there is nothing to draw.
270 if (!SceneManager::isSceneInitialised())
271 {
272 auto& ctx = drawingEngine.getDrawingContext();
273 ctx.clearSingle(PaletteIndex::black0);
274 }
275
276 drawingEngine.render();
277 drawingEngine.present();
278 }
279
280 if (Input::hasFlag(Input::Flags::rightMousePressed))
281 {
282 Input::processMessagesMini();
283 }
284 else
285 {
286 Input::processMessages();
287 }
288 }
289
290 void render(Rect rect)
291 {

Callers 4

openBrowsePromptFunction · 0.85
setProgressFunction · 0.85
openFunction · 0.85
openFunction · 0.85

Calls 8

isInitializedFunction · 0.85
isSceneInitialisedFunction · 0.85
processMessagesMiniFunction · 0.85
processMessagesFunction · 0.85
clearSingleMethod · 0.80
presentMethod · 0.80
hasFlagFunction · 0.50
renderMethod · 0.45

Tested by

no test coverage detected