Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void XStretchBlt16(unsigned char * pBB,int sdx,int sdy,int ddx,int ddy)
- {
- unsigned short * pSrc=(unsigned short *)pBackBuffer;
- unsigned short * pSrcR=NULL;
- unsigned short * pDst=(unsigned short *)pBB;
- unsigned long * pDstR=NULL;
- int x,y,cyo=-1,cy;
- int xpos, xinc;
- int ypos, yinc,ddx2=ddx>>1;
- #ifdef USE_DGA2
- int DGA2fix;
- int dga2Fix;
- if (!iWindowMode)
- {
- DGA2fix = (char*)pBB == Xpixels;
- dga2Fix = dgaDev->mode.imageWidth - dgaDev->mode.viewportWidth;
- } else DGA2fix = dga2Fix = 0;
- #endif
- // 2xsai stretching
- if(iUseNoStretchBlt>=2)
- {
- //p2XSaIFunc(pBackBuffer,sdx<<1,(unsigned char *)pSaIBigBuff,sdx,sdy);
- if(p2XSaIFunc==hq2x_16 )
- p2XSaIFunc(pBackBuffer,sdx<<2,(unsigned char *)pSaIBigBuff,sdx,sdy);
- else if(p2XSaIFunc==hq3x_16)
- p2XSaIFunc(pBackBuffer,sdx*6,(unsigned char *)pSaIBigBuff,sdx,sdy);
- else
- p2XSaIFunc(pBackBuffer,sdx<<1,(unsigned char *)pSaIBigBuff,sdx,sdy);
- pSrc=(unsigned short *)pSaIBigBuff;
- //sdx+=sdx;sdy+=sdy;
- if(iUseNoStretchBlt>=12)
- {
- sdx= sdx*3;
- sdy=sdy*3;
- }
- else
- sdx+=sdx;sdy+=sdy;
- }
- xinc = (sdx << 16) / ddx;
- ypos=0;
- yinc = (sdy << 16) / ddy;
- for(y=0;y<ddy;y++,ypos+=yinc)
- {
- cy=(ypos>>16);
- if(cy==cyo)
- {
- #ifndef USE_DGA2
- pDstR=(unsigned long *)(pDst-ddx);
- #else
- pDstR=(unsigned long *)(pDst-(ddx+dga2Fix));
- #endif
- for(x=0;x<ddx2;x++) *((unsigned long*)pDst)++=*pDstR++;
- }
- else
- {
- cyo=cy;
- pSrcR=pSrc+(cy*sdx);
- xpos = 0;
- for(x=ddx;x>0;--x)
- {
- pSrcR+= xpos>>16;
- xpos -= xpos&0xffff0000;
- *pDst++=*pSrcR;
- xpos += xinc;
- }
- }
- #ifdef USE_DGA2
- if (DGA2fix) pDst+= dga2Fix;
- #endif
- }
- }
Add Comment
Please, Sign In to add comment