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

Do not set buffer's height to VI.height if it is zero.

WARNING: potentially dangerous!
This commit is contained in:
Sergey Lipskiy 2015-09-24 18:10:53 +06:00
parent 3bd24d34a1
commit 16136b04e9

View File

@ -129,10 +129,11 @@ 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; u32 height = 1;
if (width == VI.width) if (width == VI.width)
height = VI.height; height = VI.height > 0 ? VI.height : gDP.scissor.lry;
else if (!RSP.bLLE && width == gDP.scissor.lrx && width == gSP.viewport.width) { else if (!RSP.bLLE && width == gDP.scissor.lrx && width == gSP.viewport.width) {
height = max(gDP.scissor.lry, gSP.viewport.height); height = max(gDP.scissor.lry, gSP.viewport.height);
height = min(height, VI.height); if (VI.height > 0)
height = min(height, VI.height);
} else if (width == gDP.scissor.lrx) } else if (width == gDP.scissor.lrx)
height = gDP.scissor.lry; height = gDP.scissor.lry;
else if (width <= 64) else if (width <= 64)