mirror of
https://github.com/OpenFusionProject/scripts.git
synced 2024-11-21 22:00:04 +00:00
Entry points and arg fix
This commit is contained in:
parent
8fbe59e5a1
commit
8725dd1e4e
@ -4,6 +4,7 @@
|
||||
# ycc 08/08/2022
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
legacy = False # True for 2.6
|
||||
|
||||
@ -281,3 +282,12 @@ def disassemble(text):
|
||||
text += vertex_footer + "\n"
|
||||
text += cg_footer
|
||||
return text
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: disassembler.py <filename>")
|
||||
else:
|
||||
with open(sys.argv[1], "r") as fi:
|
||||
buf = fi.read()
|
||||
disasm = disassemble(buf)
|
||||
print(disasm)
|
||||
|
@ -29,9 +29,9 @@ def process_batch(path, suffix="_hlsl"):
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: <shader-path> [outfile-suffix]")
|
||||
print("Usage: main.py <folder> [outfile-suffix]")
|
||||
elif len(sys.argv) == 2:
|
||||
process_batch(sys.argv[1])
|
||||
else:
|
||||
process_batch(*sys.argv[1:2])
|
||||
process_batch(*sys.argv[1:3])
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
# ycc 08/08/2022
|
||||
|
||||
import re
|
||||
import sys
|
||||
from disassembler import disassemble
|
||||
|
||||
tabs = 3
|
||||
@ -14,7 +15,7 @@ def indent(block):
|
||||
return "\n".join(lines)
|
||||
|
||||
def find_closing_bracket(block, i):
|
||||
count = 0;
|
||||
count = 0
|
||||
while i < len(block):
|
||||
if block[i] == '{':
|
||||
count = count + 1
|
||||
@ -62,3 +63,9 @@ def process(fn_in, fn_out):
|
||||
fo.write(processed)
|
||||
return True
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: swapper.py <file-in> <file-out>")
|
||||
else:
|
||||
process(*sys.argv[1:3])
|
||||
|
Loading…
Reference in New Issue
Block a user