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

Change way of color buffer address range calculation:

on buffers swap use actual color image height to re-calculate end address.
This commit is contained in:
Sergey Lipskiy 2013-06-29 22:46:27 +07:00
parent 1341f7bf15
commit 1e4870e6b9
2 changed files with 13 additions and 7 deletions

View File

@ -159,6 +159,8 @@ void FrameBuffer_SaveBuffer( u32 address, u16 format, u16 size, u16 width, u16 h
frameBuffer.drawBuffer = GL_DRAW_FRAMEBUFFER; frameBuffer.drawBuffer = GL_DRAW_FRAMEBUFFER;
FrameBuffer *current = frameBuffer.top; FrameBuffer *current = frameBuffer.top;
if (current != NULL && gDP.colorImage.height > 1)
current->endAddress = current->startAddress + ((current->width * gDP.colorImage.height << current->size >> 1) - 1);
// Search through saved frame buffers // Search through saved frame buffers
while (current != NULL) while (current != NULL)
{ {

18
gDP.cpp
View File

@ -349,28 +349,32 @@ void gDPSetColorImage( u32 format, u32 size, u32 width, u32 address )
if (gDP.colorImage.address != address || gDP.colorImage.width != width || gDP.colorImage.size != size) if (gDP.colorImage.address != address || gDP.colorImage.width != width || gDP.colorImage.size != size)
{ {
u32 height = 1;
if (width == VI.width) { if (width == VI.width) {
if (width == gSP.viewport.width) if (width == gSP.viewport.width)
gDP.colorImage.height = max(VI.height, gSP.viewport.height); height = max(VI.height, gSP.viewport.height);
else else
gDP.colorImage.height = max(VI.height, gDP.scissor.lry); height = max(VI.height, gDP.scissor.lry);
} else if (width == gDP.scissor.lrx && width == gSP.viewport.width) } else if (width == gDP.scissor.lrx && width == gSP.viewport.width)
gDP.colorImage.height = max(gDP.scissor.lry, gSP.viewport.height); height = max(gDP.scissor.lry, gSP.viewport.height);
else if (width == gDP.scissor.lrx) else if (width == gDP.scissor.lrx)
gDP.colorImage.height = gDP.scissor.lry; height = gDP.scissor.lry;
else else
gDP.colorImage.height = gSP.viewport.height; height = gSP.viewport.height;
if (OGL.frameBufferTextures)// && address != gDP.depthImageAddress) if (OGL.frameBufferTextures)// && address != gDP.depthImageAddress)
{ {
//if (gDP.colorImage.changed) //if (gDP.colorImage.changed)
FrameBuffer_SaveBuffer( address, (u16)format, (u16)size, (u16)width, gDP.colorImage.height ); FrameBuffer_SaveBuffer( address, (u16)format, (u16)size, (u16)width, height );
gDP.colorImage.height = 1;
//if (address != gDP.depthImageAddress) //if (address != gDP.depthImageAddress)
//FrameBuffer_RestoreBuffer( address, (u16)size, (u16)width ); //FrameBuffer_RestoreBuffer( address, (u16)size, (u16)width );
//OGL_ClearDepthBuffer(); //OGL_ClearDepthBuffer();
} } else
gDP.colorImage.height = height;
// if (width == VI.width) // if (width == VI.width)
// gDP.colorImage.height = VI.height; // gDP.colorImage.height = VI.height;