mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-03 01:25:45 -04:00
genmidi: Add a2i-sbi conversion script.
Convenience script to convert a2i files to the more convenient SBI format.
This commit is contained in:
parent
d8d0b371b5
commit
3b14d8d1a0
2 changed files with 55 additions and 0 deletions
|
@ -70,6 +70,18 @@ def read(filename):
|
|||
|
||||
return result
|
||||
|
||||
def write(filename, data):
|
||||
f = open(filename, 'w')
|
||||
|
||||
f.write(struct.pack("4s32s", HEADER_VALUE, data["name"]))
|
||||
|
||||
for field in FIELDS:
|
||||
f.write(struct.pack("B", data[field]))
|
||||
for x in range(16 - len(FIELDS)):
|
||||
f.write(struct.pack("B", 0))
|
||||
|
||||
f.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
for filename in sys.argv[1:]:
|
||||
print filename
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue