Merge pull request #635 from fmahnke/ppu-viewer-fix
Don't divide by 0 when PPU/sprite viewer windows are small.
This commit is contained in:
commit
7666f1f7aa
|
@ -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