Skip to content

Commit

Permalink
tools: butano-graphics-tool.py errors reporting improved
Browse files Browse the repository at this point in the history
  • Loading branch information
GValiente committed Jan 13, 2021
1 parent a9c694e commit 49b330b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions butano/include/bn_documentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@
*
* * bn::sprite_ptr::put_below, bn::regular_bg_ptr::put_below and bn::affine_bg_ptr::put_below added.
* * H-Blank effects IWRAM usage reduced.
* * butano-graphics-tool.py errors reporting improved.
*
*
* @section changelog_5_1_0 5.1.0
Expand Down
12 changes: 7 additions & 5 deletions butano/tools/butano-graphics-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def process(graphics_folder_paths, build_folder_path):
pool.close()

total_size = 0
process_exc = None
process_excs = []

for process_result in process_results:
if len(process_result) == 3:
Expand All @@ -1055,13 +1055,15 @@ def process(graphics_folder_paths, build_folder_path):
print(' ' + str(process_result[0]) + ' item header written in ' + str(process_result[1]) +
' (graphics size: ' + str(file_size) + ' bytes)')
else:
process_exc = process_result
process_excs.append(process_result)

sys.stdout.flush()

if process_exc is not None:
sys.stderr.write(str(process_exc[0]) + ' processing failed!\n')
raise process_exc[1]
if len(process_excs) > 0:
for process_exc in process_excs:
sys.stderr.write(str(process_exc[0]) + ' error: ' + str(process_exc[1]) + '\n')

exit(-1)

print(' ' + 'Processed graphics size: ' + str(total_size) + ' bytes')

Expand Down
Loading

0 comments on commit 49b330b

Please sign in to comment.