translated the remaining german notes, python comments, help and messages to english (in-game strings, parsed report lines and cli values stay german)
This commit is contained in:
1 parent
86fe26d786
commit
526f6072f6
36 files changed
+1553
-1544
No files matched your search
+9
-9
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Entpackt Argonaut-.cor-Bilder (Ein Königreich für ein Lama) nach PNG.
|
||||
"""Unpacks Argonaut .cor images (Ein Königreich für ein Lama) to PNG.
|
||||
|
||||
Aufbau: 8 Byte Signatur 17 98 AF 89 FE 42 D1 12, u32 Version (1),
|
||||
u32 entpackte Größe, u32 gepackte Größe, dann LZ-Daten:
|
||||
n < 0x80 -> n Bytes Rohdaten folgen
|
||||
1LLL oooo oooooooo -> kopiere L+3 Bytes ab o Bytes weiter vorne
|
||||
Das Ergebnis sind 640x480 Pixel à 3 Byte (RGB) oder à 1 Byte (Graustufen, z. B. 151.cor).
|
||||
Aufruf: cor2png.py eingabe.cor ausgabe.png (benötigt Pillow)
|
||||
Layout: 8-byte signature 17 98 AF 89 FE 42 D1 12, u32 version (1),
|
||||
u32 unpacked size, u32 packed size, then LZ data:
|
||||
n < 0x80 -> n bytes of raw data follow
|
||||
1LLL oooo oooooooo -> copy L+3 bytes from o bytes back
|
||||
The result is 640x480 pixels at 3 bytes (RGB) or 1 byte (greyscale, e.g. 151.cor).
|
||||
Usage: cor2png.py input.cor output.png (requires Pillow)
|
||||
"""
|
||||
import struct
|
||||
import sys
|
||||
@@ -16,7 +16,7 @@ MAGIC = bytes.fromhex('1798af89fe42d112')
|
||||
|
||||
def unpack(data):
|
||||
if data[:8] != MAGIC:
|
||||
raise ValueError('keine COR-Datei')
|
||||
raise ValueError('not a COR file')
|
||||
_, size, packed = struct.unpack_from('<III', data, 8)
|
||||
src = data[20:20 + packed]
|
||||
out = bytearray()
|
||||
@@ -37,7 +37,7 @@ def unpack(data):
|
||||
|
||||
if __name__ == '__main__':
|
||||
raw, size = unpack(open(sys.argv[1], 'rb').read())
|
||||
print(f'{sys.argv[1]}: {len(raw)} von {size} Bytes')
|
||||
print(f'{sys.argv[1]}: {len(raw)} of {size} bytes')
|
||||
if len(sys.argv) > 2:
|
||||
from PIL import Image
|
||||
mode = {640 * 480 * 3: 'RGB', 640 * 480: 'L'}[size]
|
||||
|
||||
Reference in new issue
Block a user