Mercurial > mm7
diff mm7_4.cpp @ 693:e0a1fccc89b1
map render fixes
author | Gloval |
---|---|
date | Sun, 17 Mar 2013 01:50:34 +0400 |
parents | 26dfde53decd |
children | 2dfb67633b01 |
line wrap: on
line diff
--- a/mm7_4.cpp Sat Mar 16 21:57:32 2013 +0400 +++ b/mm7_4.cpp Sun Mar 17 01:50:34 2013 +0400 @@ -1380,11 +1380,11 @@ v0 = pSpans; stru_80C9D8.pSurf = &stru_80C980; - stru_80C9D8.field_0 = (double)(signed int)pViewport->uViewportX; + stru_80C9D8.field_0 = (double)(signed int)pViewport->uViewportTL_X; stru_80C9A4.pSurf = &stru_80C980; stru_80C980.pPrev = &stru_80C980; stru_80C980.pNext = &stru_80C980; - stru_80C9A4.field_0 = (double)(signed int)pViewport->uViewportZ; + stru_80C9A4.field_0 = (double)(signed int)pViewport->uViewportBR_X; stru_80C980.field_8 = 0.0; stru_80C980.field_4 = 0.0; stru_80C9D8.pNext = &stru_80C9A4; @@ -1394,16 +1394,16 @@ stru_80C9A4.pPrev = &stru_80C9D8; stru_80C9A4.field_8 = 0; LODWORD(stru_80C980.field_0) = 0xC97423F0u; - v27 = pViewport->uViewportY; - if ( (signed int)pViewport->uViewportY > (signed int)pViewport->uViewportW ) + v27 = pViewport->uViewportTL_Y; + if ( (signed int)pViewport->uViewportTL_Y > (signed int)pViewport->uViewportBR_Y ) { LABEL_51: v0->field_8 = -1; } else { - v1 = 52 * pViewport->uViewportY; - v24 = 52 * pViewport->uViewportY; + v1 = 52 * pViewport->uViewportTL_Y; + v24 = 52 * pViewport->uViewportTL_Y; while ( 1 ) { v2 = *(Edge **)((char *)&pNewEdges->pNext + v1); @@ -1560,7 +1560,7 @@ ++v27; v1 = v24 + 52; v24 += 52; - if ( (signed int)v27 > (signed int)pViewport->uViewportW ) + if ( (signed int)v27 > (signed int)pViewport->uViewportBR_Y ) goto LABEL_51; } while ( 1 ) @@ -6502,15 +6502,15 @@ v5 = a4; v23 = _z >> 16; z = x + v5; - if ( z >= (signed int)pViewport->uViewportX - && (signed int)x <= (signed int)pViewport->uViewportZ - && y >= (signed int)pViewport->uViewportY - && y <= (signed int)pViewport->uViewportW ) - { - if ( (signed int)x < (signed int)pViewport->uViewportX ) - x = pViewport->uViewportX; - if ( z > (signed int)pViewport->uViewportZ ) - z = pViewport->uViewportZ; + if ( z >= (signed int)pViewport->uViewportTL_X + && (signed int)x <= (signed int)pViewport->uViewportBR_X + && y >= (signed int)pViewport->uViewportTL_Y + && y <= (signed int)pViewport->uViewportBR_Y ) + { + if ( (signed int)x < (signed int)pViewport->uViewportTL_X ) + x = pViewport->uViewportTL_X; + if ( z > (signed int)pViewport->uViewportBR_X ) + z = pViewport->uViewportBR_X; pTarget = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch]; v22 = z - x; pTargetZ = &pRenderer->pActiveZBuffer[x + 640 * y]; @@ -6631,48 +6631,48 @@ { if ( pRenderer->field_40110 ) { - a2.bottom = pViewport->uViewportY; + a2.bottom = pViewport->uViewportTL_Y; a2.left = 0; a2.top = 0; a2.right = 640; ErrD3D(pRenderer->pBackBuffer4->BltFast(0, 0, pRenderer->pColorKeySurface4, &a2, 16u)); a2.right = 640; a2.left = 0; - a2.top = pViewport->uViewportW + 1; + a2.top = pViewport->uViewportBR_Y + 1; a2.bottom = 480; ErrD3D(pRenderer->pBackBuffer4->BltFast( 0, - pViewport->uViewportW + 1, + pViewport->uViewportBR_Y + 1, pRenderer->pColorKeySurface4, &a2, 16u)); - a2.right = pViewport->uViewportX; - a2.bottom = pViewport->uViewportW + 1; + a2.right = pViewport->uViewportTL_X; + a2.bottom = pViewport->uViewportBR_Y + 1; a2.left = 0; - a2.top = pViewport->uViewportY; + a2.top = pViewport->uViewportTL_Y; ErrD3D(pRenderer->pBackBuffer4->BltFast( 0, - pViewport->uViewportY, + pViewport->uViewportTL_Y, pRenderer->pColorKeySurface4, &a2, 16u)); - a2.left = pViewport->uViewportZ; - a2.top = pViewport->uViewportY; + a2.left = pViewport->uViewportBR_X; + a2.top = pViewport->uViewportTL_Y; a2.right = 640; - a2.bottom = pViewport->uViewportW + 1; + a2.bottom = pViewport->uViewportBR_Y + 1; ErrD3D(pRenderer->pBackBuffer4->BltFast( - pViewport->uViewportZ, - pViewport->uViewportY, + pViewport->uViewportBR_X, + pViewport->uViewportTL_Y, pRenderer->pColorKeySurface4, &a2, 16u)); - a2.right = pViewport->uViewportZ; - a2.bottom = pViewport->uViewportW + 1; - a2.left = pViewport->uViewportX; - a2.top = pViewport->uViewportY; + a2.right = pViewport->uViewportBR_X; + a2.bottom = pViewport->uViewportBR_Y + 1; + a2.left = pViewport->uViewportTL_X; + a2.top = pViewport->uViewportTL_Y; ErrD3D(pRenderer->pBackBuffer4->BltFast( - pViewport->uViewportX, - pViewport->uViewportY, + pViewport->uViewportTL_X, + pViewport->uViewportTL_Y, pRenderer->pColorKeySurface4, &a2, 17u)); @@ -6756,11 +6756,11 @@ pSrc + y * 640, 640 * sizeof(__int16)); - auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportY + pViewport->uViewportX; + auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportTL_Y + pViewport->uViewportTL_X; //_this = (unsigned int)&pSrc[2 * (((signed int)pViewport->uViewportX >> 1) + 320 * pViewport->uViewportY)]; - auto pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportY + pViewport->uViewportX; + auto pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportTL_Y + pViewport->uViewportTL_X; //v23 = (unsigned __int32)((char *)v26 + 4 * (((signed int)pViewport->uViewportX >> 1) + (Dst.lPitch >> 2) * pViewport->uViewportY)); - v9 = ((signed int)pViewport->uViewportX >> 1) - ((signed int)pViewport->uViewportZ >> 1); + v9 = ((signed int)pViewport->uViewportTL_X >> 1) - ((signed int)pViewport->uViewportBR_X >> 1); //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1); v22 = 4 * ((Dst.lPitch / 4) + v9); v21 = 4 * v9 + 1280; @@ -6769,14 +6769,14 @@ //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1); v10 = (int)pSrc_x1y1; v11 = (int)pDst_x1y1; - auto uHalfWidth = v20 = (pViewport->uViewportZ - pViewport->uViewportX) / 2; + auto uHalfWidth = v20 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2; v13 = v24; - for (uint y = pViewport->uViewportY; y < pViewport->uViewportW + 1; ++y) + for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1; ++y) { //memcpy(pDst + pViewport->uViewportX + y * Dst.lPitch / 2, // pSrc + pViewport->uViewportX + y * 640, (pViewport->uViewportZ - pViewport->uViewportX) * sizeof(__int16)); - for (uint x = pViewport->uViewportX; x < pViewport->uViewportZ; ++x) + for (uint x = pViewport->uViewportTL_X; x < pViewport->uViewportBR_X; ++x) { if (pSrc[y * 640 + x] != (pRenderer->uTargetGMask | pRenderer->uTargetBMask)) pDst[y * Dst.lPitch / 2 + x] = pSrc[y * 640 + x];