Skip to content

Commit

Permalink
Include gen/ directory in packages. Cleanup documentation a little bit.
Browse files Browse the repository at this point in the history
----------------
real    0m0.337s
user    0m0.259s
sys     0m0.048s
  • Loading branch information
dustmop committed Oct 16, 2017
1 parent 504f5b5 commit fe567a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ makechr is a tool for generating NES graphics. Its primary operation is to take

The goals of makechr are to be portable (written in python), fast (can process a busy image with 256 tiles and 4 full palettes in <300ms), powerful, easy to understand, and usable in command-line based builds. A GUI is available as well, though it is missing a few features.

Windows GUI builds are available in releases.

Input images should be 256px wide and 240px high, representing a full nametable, and must follow NES attribute and palette restrictions. Smaller imagse will have padded nametables, while images with greater width will result in up to 2 nametables, assuming horizontal arrangement.

An RGB palette is hard-coded in rgb.py, other palettes are not yet supported.

# Example usage
# Example usage (command-line)

makechr image.png

Expand All @@ -21,15 +23,13 @@ This will output four files: chr.dat, nametable.dat, palette.dat, attribute.dat.
wxpython (GUI only)
watchdog (GUI only)

After installing protobuf, run build-proto.sh to generate the python protocol buffer library in the gen/ directory.

# Command-line options

Run `makechr -h` to get details on command-line options.

--version See the current version number.

-o [output] Output filename.
-o [output] Output filename. Use /dev/null to output nothing.

-c [rom] Create an NES rom file that just displays the image.

Expand Down
30 changes: 17 additions & 13 deletions makechr/makechr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ def is_valiant(filename):
return content.startswith('(VALIANT)')


class BlankLineFormatter(argparse.HelpFormatter):
class BlankLineFormatter(argparse.RawDescriptionHelpFormatter):
def _split_lines(self, text, width):
return argparse.HelpFormatter._split_lines(self, text, width) + ['']
parts = text.split('\n')
text = parts[0]
lines = parts[1:]
lines = argparse.HelpFormatter._split_lines(self, text, width) + lines
return lines + ['']


def run():
Expand Down Expand Up @@ -178,17 +182,17 @@ def run():
metavar='image',
help=('Output filename for reuse view. Will show color '
'for each tile based upon how many times the '
'tile is used, according to the following key - '
'1: white (unique tile), '
'2: yellow, '
'3: orange, '
'4: light green, '
'5: cyan, '
'6: magenta, '
'7: red, '
'8: green, '
'9: blue, '
'10: purple, '
'tile is used, according to the following key:\n'
'1: white (unique tile),\n'
'2: yellow,\n'
'3: orange,\n'
'4: light green,\n'
'5: cyan,\n'
'6: magenta,\n'
'7: red,\n'
'8: green,\n'
'9: blue,\n'
'10: purple,\n'
'11+: grey'))

parser.add_argument('--nametable-view', dest='nametable_view',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
download_url=('https://github.com/dustmop/makechr/tarball/' +
__version__),
license='GPL3',
packages=['makechr'],
packages=['makechr', 'makechr.gen'],
keywords='NES graphics gamedev',
install_requires=[
'argparse',
Expand Down

0 comments on commit fe567a1

Please sign in to comment.