| 559 | } |
| 560 | |
| 561 | void C_DrawConsole () |
| 562 | { |
| 563 | static int oldbottom = 0; |
| 564 | int lines, left, offset; |
| 565 | |
| 566 | int textScale = active_con_scale(twod); |
| 567 | |
| 568 | left = LEFTMARGIN; |
| 569 | lines = (ConBottom/textScale-CurrentConsoleFont->GetHeight()*2)/CurrentConsoleFont->GetHeight(); |
| 570 | if (-CurrentConsoleFont->GetHeight() + lines*CurrentConsoleFont->GetHeight() > ConBottom/textScale - CurrentConsoleFont->GetHeight()*7/2) |
| 571 | { |
| 572 | offset = -CurrentConsoleFont->GetHeight()/2; |
| 573 | lines--; |
| 574 | } |
| 575 | else |
| 576 | { |
| 577 | offset = -CurrentConsoleFont->GetHeight(); |
| 578 | } |
| 579 | |
| 580 | oldbottom = ConBottom; |
| 581 | |
| 582 | if (ConsoleState == c_up && gamestate == GS_LEVEL) |
| 583 | { |
| 584 | if (NotifyStrings) NotifyStrings->Draw(); |
| 585 | return; |
| 586 | } |
| 587 | else if (ConBottom) |
| 588 | { |
| 589 | int visheight; |
| 590 | |
| 591 | visheight = ConBottom; |
| 592 | |
| 593 | if (conback.isValid() && gamestate != GS_FULLCONSOLE) |
| 594 | { |
| 595 | DrawTexture (twod, conback, false, 0, visheight - screen->GetHeight(), |
| 596 | DTA_DestWidth, twod->GetWidth(), |
| 597 | DTA_DestHeight, twod->GetHeight(), |
| 598 | DTA_ColorOverlay, conshade, |
| 599 | DTA_Alpha, (gamestate != GS_FULLCONSOLE) ? (double)con_alpha : 1., |
| 600 | DTA_Masked, false, |
| 601 | TAG_DONE); |
| 602 | } |
| 603 | else |
| 604 | { |
| 605 | if (conflat.isValid() && gamestate != GS_FULLCONSOLE) |
| 606 | { |
| 607 | int conbright = 255 - APART(conshade); |
| 608 | PalEntry pe((uint8_t(255 * con_alpha)), conbright, conbright, conbright); |
| 609 | twod->AddFlatFill(0, visheight - screen->GetHeight(), screen->GetWidth(), visheight, TexMan.GetGameTexture(conflat), 1, CleanXfac, pe, STYLE_Shaded); |
| 610 | } |
| 611 | else |
| 612 | { |
| 613 | PalEntry pe((uint8_t)(con_alpha * 255), 0, 0, 0); |
| 614 | twod->AddColorOnlyQuad(0, 0, screen->GetWidth(), visheight, pe); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | if (conline && visheight < screen->GetHeight()) |
no test coverage detected