Try to fix the Portable C UploadTexture_OGL function

This commit is contained in:
ptitSeb 2016-04-06 13:44:36 +02:00
parent 8c03fccd64
commit 73aab13a79

View File

@ -168,18 +168,29 @@ void UploadTexture_OGL( ULONG *pulTexture, PIX pixSizeU, PIX pixSizeV,
#if (defined USE_PORTABLE_C)
// Basically average every other pixel...
pixSize *= 4;
UWORD w = 0;
UBYTE *dptr = (UBYTE *) pulDst;
UBYTE *sptr = (UBYTE *) pulSrc;
#if 0
pixSize *= 4;
for (PIX i = 0; i < pixSize; i++)
{
*dptr = (UBYTE) ( (((UWORD) sptr[0]) + ((UWORD) sptr[1])) >> 1 );
dptr++;
sptr += 2;
}
#else
for (PIX i = 0; i < pixSize; i++)
{
for (PIX j = 0; j < 4; j++)
{
*dptr = (UBYTE) ( (((UWORD) sptr[0]) + ((UWORD) sptr[4])) >> 1 );
dptr++;
sptr++;
}
sptr += 4;
}
#endif
#elif (defined __MSVC_INLINE__)
__asm {
pxor mm0,mm0