0x004CF63B TODO: Split this into two functions, one for rendering and one for processing messages.
| 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 | { |
no test coverage detected