1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Remove unused gDPUpdateColorImage() function.

This commit is contained in:
Sergey Lipskiy 2013-09-05 21:46:11 +07:00
parent ca99c49bc7
commit ae91daa5ca

94
gDP.cpp
View File

@ -249,102 +249,8 @@ void gDPSetCombine( s32 muxs0, s32 muxs1 )
#endif
}
/*void RSP_UpdateColorImage()
{
WORD *colorBuffer = (WORD*)&RDRAM[RDP.colorImage.address];
BYTE *frameBuffer = (BYTE*)malloc( OGL.width * OGL.height * 3 );
BYTE *framePixel;
int x, y, frameX, frameY, i;
glReadBuffer( GL_BACK );
glReadPixels( 0, 0, OGL.width - 1, OGL.height - 1, GL_RGB, GL_UNSIGNED_BYTE, frameBuffer );
i = 0;
for (y = 0; y < RDP.height; y++)
{
frameY = OGL.height - (y * OGL.scaleY);
for (x = 0; x < RDP.width; x++)
{
frameX = x * OGL.scaleX;
framePixel = &frameBuffer[(OGL.width * frameY + frameX) * 3];
colorBuffer[i^1] = ((framePixel[0] >> 3) << 11) |
((framePixel[1] >> 3) << 6) |
((framePixel[2] >> 3) << 1);
i++;
}
}
free( frameBuffer );
}*/
void gDPUpdateColorImage()
{
return;
if ((gDP.colorImage.size == G_IM_SIZ_16b) && (gDP.colorImage.format == G_IM_FMT_RGBA))
{
u16 *frameBuffer = (u16*)malloc( (u32)(gDP.colorImage.width * OGL.scaleX * gDP.colorImage.height * OGL.scaleY * 2) );
u16 *colorImage = (u16*)&RDRAM[gDP.colorImage.address];
u32 frameX, frameY;
u32 i = 0;
glReadBuffer( GL_BACK );
glReadPixels( 0, OGL.height - (u32)(gDP.colorImage.height * OGL.scaleY) + OGL.heightOffset, (u32)(gDP.colorImage.width * OGL.scaleX), (u32)(gDP.colorImage.height * OGL.scaleY), GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1_EXT, frameBuffer );
for (u32 y = 0; y < gDP.colorImage.height; y++)
{
frameY = (u32)((gDP.colorImage.height - 1) * OGL.scaleY - y * OGL.scaleY);
for (u32 x = 0; x < gDP.colorImage.width; x++)
{
frameX = (u32)(x * OGL.scaleX);
colorImage[i^1] = frameBuffer[(u32)(gDP.colorImage.width * OGL.scaleX) * frameY + frameX];
i++;
}
}
free( frameBuffer );
}
else if ((gDP.colorImage.size == G_IM_SIZ_8b) && (gDP.colorImage.format == G_IM_FMT_I))
{
u8 *frameBuffer = (u8*)malloc( (u32)(gDP.colorImage.width * OGL.scaleX * gDP.colorImage.height * OGL.scaleY) );
u8 *colorImage = (u8*)&RDRAM[gDP.colorImage.address];
u32 frameX, frameY;
u32 i = 0;
glReadPixels( 0, OGL.height - (u32)(gDP.colorImage.height * OGL.scaleY) + OGL.heightOffset, (u32)(gDP.colorImage.width * OGL.scaleX), (u32)(gDP.colorImage.height * OGL.scaleY), GL_LUMINANCE, GL_UNSIGNED_BYTE, frameBuffer );
for (u32 y = 0; y < gDP.colorImage.height; y++)
{
frameY = (u32)((gDP.colorImage.height - 1) * OGL.scaleY - y * OGL.scaleY);
for (u32 x = 0; x < gDP.colorImage.width; x++)
{
frameX = (u32)(x * OGL.scaleX);
colorImage[i^3] = frameBuffer[(u32)(gDP.colorImage.width * OGL.scaleX) * frameY + frameX];
i++;
}
}
free( frameBuffer );
}
}
void gDPSetColorImage( u32 format, u32 size, u32 width, u32 address )
{
/* if (gDP.colorImage.changed &&
// (gDP.colorImage.address != gDP.depthImageAddress) &&
(gDP.colorImage.address != RSP_SegmentToPhysical( address )))
{
gDPUpdateColorImage();
OGL_ClearDepthBuffer();
gDP.colorImage.changed = FALSE;
gDP.colorImage.height = 1;
}*/
/* for (int i = 0; i < (gDP.colorImage.width * gDP.colorImage.height ) << gDP.colorImage.size >> 1; i++)
{
RDRAM[gDP.colorImage.address + i] = 0;
}*/
address = RSP_SegmentToPhysical( address );
if (gDP.colorImage.address != address || gDP.colorImage.width != width || gDP.colorImage.size != size)