mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-23 02:40:26 +01:00
Try to fix the Portable C UploadTexture_OGL function
This commit is contained in:
parent
8c03fccd64
commit
73aab13a79
|
@ -168,18 +168,29 @@ void UploadTexture_OGL( ULONG *pulTexture, PIX pixSizeU, PIX pixSizeV,
|
||||||
|
|
||||||
#if (defined USE_PORTABLE_C)
|
#if (defined USE_PORTABLE_C)
|
||||||
// Basically average every other pixel...
|
// Basically average every other pixel...
|
||||||
pixSize *= 4;
|
|
||||||
|
|
||||||
UWORD w = 0;
|
UWORD w = 0;
|
||||||
UBYTE *dptr = (UBYTE *) pulDst;
|
UBYTE *dptr = (UBYTE *) pulDst;
|
||||||
UBYTE *sptr = (UBYTE *) pulSrc;
|
UBYTE *sptr = (UBYTE *) pulSrc;
|
||||||
|
#if 0
|
||||||
|
pixSize *= 4;
|
||||||
for (PIX i = 0; i < pixSize; i++)
|
for (PIX i = 0; i < pixSize; i++)
|
||||||
{
|
{
|
||||||
*dptr = (UBYTE) ( (((UWORD) sptr[0]) + ((UWORD) sptr[1])) >> 1 );
|
*dptr = (UBYTE) ( (((UWORD) sptr[0]) + ((UWORD) sptr[1])) >> 1 );
|
||||||
dptr++;
|
dptr++;
|
||||||
sptr += 2;
|
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__)
|
#elif (defined __MSVC_INLINE__)
|
||||||
__asm {
|
__asm {
|
||||||
pxor mm0,mm0
|
pxor mm0,mm0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user