Skip to content

Commit

Permalink
Added skipfirst parameter to nitro.writeNSCR
Browse files Browse the repository at this point in the history
  • Loading branch information
Illidanz committed Feb 5, 2025
1 parent 73eeaf3 commit f0237e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hacktools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.38.3"
__version__ = "0.38.4"
10 changes: 8 additions & 2 deletions hacktools/nitro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ def writeNCGR(file, ncgr, infile, palettes, width=-1, height=-1):
writeNCGRTile(f, pixels, width, ncgr, i, j, palettes[0])


def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1):
def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1, skipfirst=False):
try:
from PIL import Image
except ImportError:
Expand All @@ -1029,10 +1029,16 @@ def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1):
if map.xflip or map.yflip:
x += 1
continue
if skipfirst and x == 0:
x += 1
continue
# Write the tile if it's a new one
if map.tile not in donetiles:
donetiles.append(map.tile)
f.seek(ncgr.tileoffset + map.tile * (8 * ncgr.bpp))
tilenum = map.tile
if skipfirst:
tilenum -= 1
f.seek(ncgr.tileoffset + tilenum * (8 * ncgr.bpp))
writeNCGRTile(f, pixels, width, ncgr, i, j, palettes[map.pal])
x += 1

Expand Down

0 comments on commit f0237e1

Please sign in to comment.