| 569 | } |
| 570 | |
| 571 | void GuiMissionAreaCtrl::onRender(Point2I offset, const RectI & updateRect) |
| 572 | { |
| 573 | |
| 574 | RectI rect(offset, getExtent()); |
| 575 | F32 fillOffset = GFX->getFillConventionOffset(); |
| 576 | |
| 577 | setUpdate(); |
| 578 | |
| 579 | // draw an x |
| 580 | if(!bool(mMissionArea) || !bool(mTerrainBlock)) |
| 581 | { |
| 582 | GFX->setStateBlock(mSolidStateBlock); |
| 583 | PrimBuild::color3i( 0, 0, 0 ); |
| 584 | PrimBuild::begin( GFXLineList, 4 ); |
| 585 | |
| 586 | PrimBuild::vertex2f( rect.point.x + fillOffset, updateRect.point.y + fillOffset ); |
| 587 | PrimBuild::vertex2f( rect.point.x + updateRect.extent.x + fillOffset, updateRect.point.y + updateRect.extent.y + fillOffset ); |
| 588 | PrimBuild::vertex2f( rect.point.x + fillOffset, updateRect.point.y + updateRect.extent.y + fillOffset ); |
| 589 | PrimBuild::vertex2f( rect.point.x + updateRect.extent.x + fillOffset, updateRect.point.y + fillOffset ); |
| 590 | |
| 591 | PrimBuild::end(); |
| 592 | |
| 593 | return; |
| 594 | } |
| 595 | |
| 596 | // |
| 597 | setupScreenTransform(offset); |
| 598 | |
| 599 | // draw the terrain |
| 600 | if(mSquareBitmap) |
| 601 | rect.extent.x > rect.extent.y ? rect.extent.x = rect.extent.y : rect.extent.y = rect.extent.x; |
| 602 | |
| 603 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 604 | drawer->clearBitmapModulation(); |
| 605 | drawer->drawBitmapStretch(mBitmap, rect, GFXBitmapFlip_Y, GFXTextureFilterLinear, false); |
| 606 | |
| 607 | GFX->setStateBlock(mSolidStateBlock); |
| 608 | drawer->clearBitmapModulation(); |
| 609 | |
| 610 | // draw the reference axis |
| 611 | PrimBuild::begin( GFXLineList, 4 ); |
| 612 | PrimBuild::color3i( 255, 0, 0 ); |
| 613 | PrimBuild::vertex2f( rect.point.x + 5 + fillOffset, rect.point.y + rect.extent.y - 5 + fillOffset ); |
| 614 | PrimBuild::vertex2f( rect.point.x + 25 + fillOffset, rect.point.y + rect.extent.y - 5 + fillOffset ); |
| 615 | PrimBuild::color3i( 0, 255, 0 ); |
| 616 | PrimBuild::vertex2f( rect.point.x + 5 + fillOffset, rect.point.y + rect.extent.y - 5 + fillOffset ); |
| 617 | PrimBuild::vertex2f( rect.point.x + 5 + fillOffset, rect.point.y + rect.extent.y - 25 + fillOffset ); |
| 618 | PrimBuild::end(); |
| 619 | |
| 620 | RectF area; |
| 621 | getScreenMissionArea(area); |
| 622 | |
| 623 | // render the mission area box |
| 624 | PrimBuild::color( mMissionBoundsColor ); |
| 625 | PrimBuild::begin( GFXLineStrip, 5 ); |
| 626 | PrimBuild::vertex2f(area.point.x + fillOffset, area.point.y + fillOffset); |
| 627 | PrimBuild::vertex2f(area.point.x + area.extent.x + fillOffset, area.point.y + fillOffset); |
| 628 | PrimBuild::vertex2f(area.point.x + area.extent.x + fillOffset, area.point.y + area.extent.y + fillOffset); |
nothing calls this directly
no test coverage detected