()
| 645 | private static dirty_t clear = new dirty_t(); |
| 646 | |
| 647 | private static void TileClear() { |
| 648 | int i; |
| 649 | int top, bottom, left, right; |
| 650 | clear.clear(); |
| 651 | |
| 652 | if (scr_drawall.value != 0) |
| 653 | DirtyScreen(); // for power vr or broken page flippers... |
| 654 | |
| 655 | if (scr_con_current == 1.0f) |
| 656 | return; // full screen console |
| 657 | if (scr_viewsize.value == 100) |
| 658 | return; // full screen rendering |
| 659 | if (ClientGlobals.cl.cinematictime > 0) |
| 660 | return; // full screen cinematic |
| 661 | |
| 662 | // erase rect will be the union of the past three frames |
| 663 | // so tripple buffering works properly |
| 664 | clear.set(scr_dirty); |
| 665 | for (i = 0; i < 2; i++) { |
| 666 | if (scr_old_dirty[i].x1 < clear.x1) |
| 667 | clear.x1 = scr_old_dirty[i].x1; |
| 668 | if (scr_old_dirty[i].x2 > clear.x2) |
| 669 | clear.x2 = scr_old_dirty[i].x2; |
| 670 | if (scr_old_dirty[i].y1 < clear.y1) |
| 671 | clear.y1 = scr_old_dirty[i].y1; |
| 672 | if (scr_old_dirty[i].y2 > clear.y2) |
| 673 | clear.y2 = scr_old_dirty[i].y2; |
| 674 | } |
| 675 | |
| 676 | scr_old_dirty[1].set(scr_old_dirty[0]); |
| 677 | scr_old_dirty[0].set(scr_dirty); |
| 678 | |
| 679 | scr_dirty.x1 = 9999; |
| 680 | scr_dirty.x2 = -9999; |
| 681 | scr_dirty.y1 = 9999; |
| 682 | scr_dirty.y2 = -9999; |
| 683 | |
| 684 | // don't bother with anything convered by the console) |
| 685 | top = (int) (scr_con_current * ClientGlobals.viddef.getHeight()); |
| 686 | if (top >= clear.y1) |
| 687 | clear.y1 = top; |
| 688 | |
| 689 | if (clear.y2 <= clear.y1) |
| 690 | return; // nothing disturbed |
| 691 | |
| 692 | top = ClientGlobals.scr_vrect.y; |
| 693 | bottom = top + ClientGlobals.scr_vrect.height - 1; |
| 694 | left = ClientGlobals.scr_vrect.x; |
| 695 | right = left + ClientGlobals.scr_vrect.width - 1; |
| 696 | |
| 697 | if (clear.y1 < top) { // clear above view screen |
| 698 | i = clear.y2 < top - 1 ? clear.y2 : top - 1; |
| 699 | ClientGlobals.re.DrawTileClear(clear.x1, clear.y1, clear.x2 - clear.x1 + 1, i |
| 700 | - clear.y1 + 1, "backtile"); |
| 701 | clear.y1 = top; |
| 702 | } |
| 703 | if (clear.y2 > bottom) { // clear below view screen |
| 704 | i = clear.y1 > bottom + 1 ? clear.y1 : bottom + 1; |
no test coverage detected