* @brief Check render pipeline and update individual screen parts * @param out Output surface. * @param dwHgt Section of screen to update from top to bottom * @param drawDesc Render info box * @param drawHp Render health bar * @param drawMana Render mana bar * @param drawSbar Render belt * @param drawBtn Render panel buttons */
| 1354 | * @param drawBtn Render panel buttons |
| 1355 | */ |
| 1356 | void DrawMain(const Surface &out, int dwHgt, bool drawDesc, bool drawHp, bool drawMana, bool drawSbar, bool drawBtn) |
| 1357 | { |
| 1358 | if (!gbActive || RenderDirectlyToOutputSurface) { |
| 1359 | return; |
| 1360 | } |
| 1361 | |
| 1362 | assert(dwHgt >= 0 && dwHgt <= gnScreenHeight); |
| 1363 | |
| 1364 | if (dwHgt > 0) { |
| 1365 | DoBlitScreen(0, 0, gnScreenWidth, dwHgt); |
| 1366 | } |
| 1367 | if (dwHgt < gnScreenHeight) { |
| 1368 | const Point mainPanelPosition = GetMainPanel().position; |
| 1369 | if (drawSbar) { |
| 1370 | DoBlitScreen(mainPanelPosition.x + 204, mainPanelPosition.y + 5, 232, 28); |
| 1371 | } |
| 1372 | if (drawDesc) { |
| 1373 | if (talkflag) { |
| 1374 | // When chat input is displayed, the belt is hidden and the chat moves up. |
| 1375 | DoBlitScreen(mainPanelPosition.x + 171, mainPanelPosition.y + 6, 298, 116); |
| 1376 | } else { |
| 1377 | DoBlitScreen(mainPanelPosition.x + InfoBoxTopLeft.deltaX, mainPanelPosition.y + InfoBoxTopLeft.deltaY, |
| 1378 | InfoBoxSize.width, InfoBoxSize.height); |
| 1379 | } |
| 1380 | } |
| 1381 | if (drawMana) { |
| 1382 | DoBlitScreen(mainPanelPosition.x + 460, mainPanelPosition.y, 88, 72); |
| 1383 | DoBlitScreen(mainPanelPosition.x + 564, mainPanelPosition.y + 64, 56, 56); |
| 1384 | } |
| 1385 | if (drawHp) { |
| 1386 | DoBlitScreen(mainPanelPosition.x + 96, mainPanelPosition.y, 88, 72); |
| 1387 | } |
| 1388 | if (drawBtn) { |
| 1389 | DoBlitScreen(mainPanelPosition.x + 8, mainPanelPosition.y + 7, 74, 114); |
| 1390 | DoBlitScreen(mainPanelPosition.x + 559, mainPanelPosition.y + 7, 74, 48); |
| 1391 | if (gbIsMultiplayer) { |
| 1392 | DoBlitScreen(mainPanelPosition.x + 86, mainPanelPosition.y + 91, 34, 32); |
| 1393 | DoBlitScreen(mainPanelPosition.x + 526, mainPanelPosition.y + 91, 34, 32); |
| 1394 | } |
| 1395 | } |
| 1396 | if (PrevCursorRect.size.width != 0 && PrevCursorRect.size.height != 0) { |
| 1397 | DoBlitScreen(PrevCursorRect.position.x, PrevCursorRect.position.y, PrevCursorRect.size.width, PrevCursorRect.size.height); |
| 1398 | } |
| 1399 | Rectangle &cursorRect = GetDrawnCursor().rect; |
| 1400 | if (cursorRect.size.width != 0 && cursorRect.size.height != 0) { |
| 1401 | DoBlitScreen(cursorRect.position.x, cursorRect.position.y, cursorRect.size.width, cursorRect.size.height); |
| 1402 | } |
| 1403 | } |
| 1404 | } |
| 1405 | |
| 1406 | } // namespace |
| 1407 |
no test coverage detected