Don't divide by 0 when PPU/sprite viewer windows are small.
Some of the views are proportional to window dimensions. This caused division by 0 where window dimensions round down to 0. This change avoids that, instead setting those views' sizes to 0 in these cases.
This commit is contained in:
parent
50d4d58276
commit
783aa5f38c
|
@ -635,8 +635,8 @@ QPoint ppuPatternView_t::convPixToTile( QPoint p )
|
||||||
w = pattern->w;
|
w = pattern->w;
|
||||||
h = pattern->h;
|
h = pattern->h;
|
||||||
|
|
||||||
i = x / (w*8);
|
i = w == 0 ? 0 : x / (w*8);
|
||||||
j = y / (h*8);
|
j = h == 0 ? 0 : y / (h*8);
|
||||||
|
|
||||||
if ( PPUView_sprite16Mode[ patternIndex ] )
|
if ( PPUView_sprite16Mode[ patternIndex ] )
|
||||||
{
|
{
|
||||||
|
@ -3336,8 +3336,8 @@ QPoint oamPatternView_t::convPixToTile( QPoint p )
|
||||||
w = oamPattern.w;
|
w = oamPattern.w;
|
||||||
h = oamPattern.h;
|
h = oamPattern.h;
|
||||||
|
|
||||||
i = x / (w*8);
|
i = w == 0 ? 0 : x / (w*8);
|
||||||
j = y / (h*16);
|
j = h == 0 ? 0 : y / (h*16);
|
||||||
|
|
||||||
//printf("(x,y) = (%i,%i) w=%i h=%i $%X%X \n", x, y, w, h, jj, ii );
|
//printf("(x,y) = (%i,%i) w=%i h=%i $%X%X \n", x, y, w, h, jj, ii );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue