Mercurial > mm7
comparison Arcomage.cpp @ 2216:3f375342de12
window->GetWidth() continue
author | Ritor1 |
---|---|
date | Sat, 15 Feb 2014 16:00:19 +0600 |
parents | e9625ad08541 |
children | aff7a7b072b7 |
comparison
equal
deleted
inserted
replaced
2215:e9625ad08541 | 2216:3f375342de12 |
---|---|
649 { | 649 { |
650 for ( int j = 0; j < src_width; ++j ) | 650 for ( int j = 0; j < src_width; ++j ) |
651 { | 651 { |
652 if ( *src_surf_pos != v10 ) | 652 if ( *src_surf_pos != v10 ) |
653 { | 653 { |
654 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479) | 654 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 |
655 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1) | |
655 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos); | 656 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos); |
656 } | 657 } |
657 ++src_surf_pos; | 658 ++src_surf_pos; |
658 } | 659 } |
659 src_surf_pos += uSrcPitch; | 660 src_surf_pos += uSrcPitch; |
666 { | 667 { |
667 for ( int j = 0; j < src_width; ++j ) | 668 for ( int j = 0; j < src_width; ++j ) |
668 { | 669 { |
669 if ( *src_surf_pos != v10 ) | 670 if ( *src_surf_pos != v10 ) |
670 { | 671 { |
671 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479) | 672 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 |
673 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1) | |
672 //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) >> 1)) + (v21 & (*src_surf_pos >> 1))); | 674 //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) >> 1)) + (v21 & (*src_surf_pos >> 1))); |
673 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2))); | 675 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2))); |
674 } | 676 } |
675 ++src_surf_pos; | 677 ++src_surf_pos; |
676 } | 678 } |
722 { | 724 { |
723 for ( int j = 0; j < src_width; ++j ) | 725 for ( int j = 0; j < src_width; ++j ) |
724 { | 726 { |
725 if ( *src_surf_pos != v21 ) | 727 if ( *src_surf_pos != v21 ) |
726 { | 728 { |
727 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479) | 729 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 |
730 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1) | |
728 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos); | 731 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos); |
729 } | 732 } |
730 ++src_surf_pos; | 733 ++src_surf_pos; |
731 } | 734 } |
732 src_surf_pos += uSrcPitch; | 735 src_surf_pos += uSrcPitch; |
739 { | 742 { |
740 for ( int j = 0; j < src_width; ++j ) | 743 for ( int j = 0; j < src_width; ++j ) |
741 { | 744 { |
742 if ( *src_surf_pos != v21 ) | 745 if ( *src_surf_pos != v21 ) |
743 { | 746 { |
744 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479) | 747 if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 |
748 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1) | |
745 //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) / 2)) + (v21 & (*src_surf_pos / 2))); | 749 //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) / 2)) + (v21 & (*src_surf_pos / 2))); |
746 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2))); | 750 WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2))); |
747 } | 751 } |
748 ++src_surf_pos; | 752 ++src_surf_pos; |
749 } | 753 } |
3660 } | 3664 } |
3661 | 3665 |
3662 //----- (0040DB27) -------------------------------------------------------- | 3666 //----- (0040DB27) -------------------------------------------------------- |
3663 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill ) | 3667 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill ) |
3664 { | 3668 { |
3665 RECT *v3; // esi@1 | |
3666 | |
3667 v3 = pXYZW; | |
3668 pRenderer->BeginScene(); | 3669 pRenderer->BeginScene(); |
3669 pRenderer->SetRasterClipRect(0, 0, 639, 479); | 3670 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1); |
3670 if ( bSolidFill ) | 3671 if ( bSolidFill ) |
3671 { | 3672 { |
3672 for ( int i = v3->top; i <= v3->bottom; ++i ) | 3673 for ( int i = pXYZW->top; i <= pXYZW->bottom; ++i ) |
3673 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor); | 3674 pRenderer->RasterLine2D(pXYZW->left, i, pXYZW->right, i, uColor); |
3674 } | 3675 } |
3675 else | 3676 else |
3676 { | 3677 { |
3677 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor); | 3678 pRenderer->RasterLine2D(pXYZW->left, pXYZW->top, pXYZW->right, pXYZW->top, uColor); |
3678 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor); | 3679 pRenderer->RasterLine2D(pXYZW->right, pXYZW->top, pXYZW->right, pXYZW->bottom, uColor); |
3679 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor); | 3680 pRenderer->RasterLine2D(pXYZW->right, pXYZW->bottom, pXYZW->left, pXYZW->bottom, uColor); |
3680 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor); | 3681 pRenderer->RasterLine2D(pXYZW->left, pXYZW->bottom, pXYZW->left, pXYZW->top, uColor); |
3681 } | 3682 } |
3682 pRenderer->EndScene(); | 3683 pRenderer->EndScene(); |
3683 } | 3684 } |
3684 | 3685 |
3685 void DrawSquare( POINT *pTargetXY, unsigned __int16 uColor ) | 3686 void DrawSquare( POINT *pTargetXY, unsigned __int16 uColor ) |
3686 { | 3687 { |
3687 pRenderer->BeginScene(); | 3688 pRenderer->BeginScene(); |
3688 //if ( uNumSceneBegins ) | 3689 //if ( uNumSceneBegins ) |
3689 { | 3690 { |
3690 if ( pTargetXY->x >= 0 && pTargetXY->x <= 639 && pTargetXY->y >= 0 && pTargetXY->y <= 479) | 3691 if ( pTargetXY->x >= 0 && pTargetXY->x <= window->GetWidth() - 1 |
3692 && pTargetXY->y >= 0 && pTargetXY->y <= window->GetHeight() - 1) | |
3691 { | 3693 { |
3692 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y, uColor); | 3694 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y, uColor); |
3693 pRenderer->WritePixel16(pTargetXY->x + 1, pTargetXY->y, uColor); | 3695 pRenderer->WritePixel16(pTargetXY->x + 1, pTargetXY->y, uColor); |
3694 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y + 1, uColor); | 3696 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y + 1, uColor); |
3695 pRenderer->WritePixel16(pTargetXY->x + 1, pTargetXY->y + 1, uColor); | 3697 pRenderer->WritePixel16(pTargetXY->x + 1, pTargetXY->y + 1, uColor); |
3702 void DrawPixel( POINT *pTargetXY, unsigned __int16 uColor ) | 3704 void DrawPixel( POINT *pTargetXY, unsigned __int16 uColor ) |
3703 { | 3705 { |
3704 pRenderer->BeginScene(); | 3706 pRenderer->BeginScene(); |
3705 //if ( pRenderer->uNumSceneBegins ) | 3707 //if ( pRenderer->uNumSceneBegins ) |
3706 { | 3708 { |
3707 if ( pTargetXY->x >= 0 && pTargetXY->x <= 639 && pTargetXY->y >= 0 && pTargetXY->y <= 479) | 3709 if ( pTargetXY->x >= 0 && pTargetXY->x <= window->GetWidth() - 1 |
3710 && pTargetXY->y >= 0 && pTargetXY->y <= window->GetHeight() - 1) | |
3708 { | 3711 { |
3709 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y, uColor); | 3712 pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y, uColor); |
3710 /*int xVal = pTargetXY->x; | 3713 /*int xVal = pTargetXY->x; |
3711 int yVal = pTargetXY->y; | 3714 int yVal = pTargetXY->y; |
3712 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | 3715 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) |