Changeset 38560 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm
- Timestamp:
- Aug 29, 2011 3:14:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm/VBoxDispMouse.cpp
r38506 r38560 46 46 for (y=0; y<pAttrs->Height; ++y) 47 47 { 48 memcpy(pDst+y*dstBytesPerLine, pSrc+ y*psoMask->lDelta, dstBytesPerLine);48 memcpy(pDst+y*dstBytesPerLine, pSrc+(LONG)y*psoMask->lDelta, dstBytesPerLine); 49 49 } 50 50 51 51 /* convert XOR mask to RGB0 DIB, it start in pAttrs->Pixels should be 4bytes aligned */ 52 pSrc = (BYTE*)psoMask->pvScan0 + srcMaskH*psoMask->lDelta;52 pSrc = (BYTE*)psoMask->pvScan0 + (LONG)srcMaskH*psoMask->lDelta; 53 53 pDst = pAttrs->Pixels + RT_ALIGN_T(dstBytesPerLine*pAttrs->Height, 4, ULONG); 54 54 dstBytesPerLine = pAttrs->Width * 4; … … 60 60 if (0xFF==bit) bit=7; 61 61 62 *(ULONG*)&pDst[y*dstBytesPerLine+x*4] = (pSrc[ y*psoMask->lDelta+x/8] & RT_BIT(bit)) ? 0x00FFFFFF : 0;62 *(ULONG*)&pDst[y*dstBytesPerLine+x*4] = (pSrc[(LONG)y*psoMask->lDelta+x/8] & RT_BIT(bit)) ? 0x00FFFFFF : 0; 63 63 } 64 64 } … … 164 164 for (x=0; x<(ULONG)psoSrc->sizlBitmap.cx; ++x) 165 165 { 166 BYTE bSrc = pSrc[ y*psoBitmap->lDelta+x*1];167 168 pDst[ y*psoRes->lDelta+x*4+0] = pDev->pPalette[bSrc].peBlue;169 pDst[ y*psoRes->lDelta+x*4+1] = pDev->pPalette[bSrc].peGreen;170 pDst[ y*psoRes->lDelta+x*4+2] = pDev->pPalette[bSrc].peRed;171 pDst[ y*psoRes->lDelta+x*4+3] = 0;166 BYTE bSrc = pSrc[(LONG)y*psoBitmap->lDelta+x*1]; 167 168 pDst[(LONG)y*psoRes->lDelta+x*4+0] = pDev->pPalette[bSrc].peBlue; 169 pDst[(LONG)y*psoRes->lDelta+x*4+1] = pDev->pPalette[bSrc].peGreen; 170 pDst[(LONG)y*psoRes->lDelta+x*4+2] = pDev->pPalette[bSrc].peRed; 171 pDst[(LONG)y*psoRes->lDelta+x*4+3] = 0; 172 172 } 173 173 } … … 180 180 for (x=0; x<(ULONG)psoSrc->sizlBitmap.cx; ++x) 181 181 { 182 USHORT usSrc = *(USHORT*)&pSrc[ y*psoBitmap->lDelta+x*2];183 184 pDst[ y*psoRes->lDelta+x*4+0] = (BYTE) (usSrc<<3);185 pDst[ y*psoRes->lDelta+x*4+1] = (BYTE) ((usSrc>>5)<<2);186 pDst[ y*psoRes->lDelta+x*4+2] = (BYTE) ((usSrc>>11)<<3);187 pDst[ y*psoRes->lDelta+x*4+3] = 0;182 USHORT usSrc = *(USHORT*)&pSrc[(LONG)y*psoBitmap->lDelta+x*2]; 183 184 pDst[(LONG)y*psoRes->lDelta+x*4+0] = (BYTE) (usSrc<<3); 185 pDst[(LONG)y*psoRes->lDelta+x*4+1] = (BYTE) ((usSrc>>5)<<2); 186 pDst[(LONG)y*psoRes->lDelta+x*4+2] = (BYTE) ((usSrc>>11)<<3); 187 pDst[(LONG)y*psoRes->lDelta+x*4+3] = 0; 188 188 } 189 189 } … … 196 196 for (x=0; x<(ULONG)psoSrc->sizlBitmap.cx; ++x) 197 197 { 198 pDst[ y*psoRes->lDelta+x*4+0] = pSrc[y*psoBitmap->lDelta+x*3+0];199 pDst[ y*psoRes->lDelta+x*4+1] = pSrc[y*psoBitmap->lDelta+x*3+1];200 pDst[ y*psoRes->lDelta+x*4+2] = pSrc[y*psoBitmap->lDelta+x*3+2];201 pDst[ y*psoRes->lDelta+x*4+3] = 0;198 pDst[(LONG)y*psoRes->lDelta+x*4+0] = pSrc[(LONG)y*psoBitmap->lDelta+x*3+0]; 199 pDst[(LONG)y*psoRes->lDelta+x*4+1] = pSrc[(LONG)y*psoBitmap->lDelta+x*3+1]; 200 pDst[(LONG)y*psoRes->lDelta+x*4+2] = pSrc[(LONG)y*psoBitmap->lDelta+x*3+2]; 201 pDst[(LONG)y*psoRes->lDelta+x*4+3] = 0; 202 202 } 203 203 } … … 270 270 if (0xFF==bit) bit=7; 271 271 272 if (pSrc[ y*psoColor->lDelta + x*4 + 3] > 0x7F)272 if (pSrc[(LONG)y*psoColor->lDelta + x*4 + 3] > 0x7F) 273 273 { 274 274 pDst[y*dstBytesPerLine + x/8] &= ~RT_BIT(bit); … … 295 295 for (y=0; y<pAttrs->Height; ++y) 296 296 { 297 memcpy(pDst+y*dstBytesPerLine, pSrc+ y*psoMask->lDelta, dstBytesPerLine);297 memcpy(pDst+y*dstBytesPerLine, pSrc+(LONG)y*psoMask->lDelta, dstBytesPerLine); 298 298 } 299 299 … … 315 315 for (y=0; y<pAttrs->Height; ++y) 316 316 { 317 memcpy(pDst+y*dstBytesPerLine, pSrc+ y*pso32bpp->lDelta, dstBytesPerLine);317 memcpy(pDst+y*dstBytesPerLine, pSrc+(LONG)y*pso32bpp->lDelta, dstBytesPerLine); 318 318 } 319 319
Note:
See TracChangeset
for help on using the changeset viewer.