Skip to content

Commit

Permalink
Add -s (silent) option to png2src subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaAmora committed Mar 31, 2022
1 parent a471497 commit bb89521
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions 4orth.porth
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,12 @@ proc sprite-template in
1 exit
end

"{{#sprites}}\n" bfd bputs
"{{#sprites}}\n\n" bfd bputs
"// {{name}} sprite\n" bfd bputs
"const {{name}}-sprite \"{{bytes}}\"c end\n" bfd bputs
"const {{name}}-flags {{flags}} end\n" bfd bputs
"const {{name}}-height {{height}} end\n" bfd bputs
"const {{name}}-width {{width}} end\n\n" bfd bputs
"const {{name}}-width {{width}} end\n" bfd bputs
"{{/sprites}}" bfd bputs

bfd bflush
Expand Down Expand Up @@ -711,6 +711,7 @@ in
" lex <file> Produce lexical analysis of the file\n" fd fputs
" summary <file> Print the summary of the program\n" fd fputs
" png2src <file> Uses w4 to convert a png file to Porth code and prints it\n" fd fputs
" -s Silent mode. Only print the converted code\n" fd fputs
" help Print this help to stdout and exit with 0 code\n" fd fputs
end
end
Expand Down Expand Up @@ -972,6 +973,11 @@ proc main in
1 exit
end

args @@ptr "-s"c cstreq if
true silent !bool
args sizeof(ptr) inc64-by
end

args @@ptr input-file-path-cstr !ptr
input-file-path-cstr @ptr cstr-to-str remove-ext base-file-path !Str
args sizeof(ptr) inc64-by
Expand Down

0 comments on commit bb89521

Please sign in to comment.