Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
42 lines
1.8 KiB
Python
42 lines
1.8 KiB
Python
"""Check real native scene artifacts and absence of the graphical console bridge."""
|
|
from pathlib import Path
|
|
import hashlib
|
|
import struct
|
|
|
|
from PIL import Image
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
OUTPUT = ROOT / 'build/actions'
|
|
|
|
|
|
def main():
|
|
source = (ROOT / 'casino3d.inc').read_text(encoding='cp1251')
|
|
interaction = source.split('Trigger3DInteraction PROC', 1)[1].split('Trigger3DInteraction ENDP', 1)[0]
|
|
assert 'LaunchClassicGame' not in interaction
|
|
assert interaction.count('call BeginUnavailable3D') == 8
|
|
assert 'call InitNativeDurak3D' in interaction
|
|
panel = Image.open(OUTPUT / 'unavailable.bmp').convert('RGB')
|
|
assert panel.size == (640, 480)
|
|
assert panel.getpixel((110, 190)) == (23, 29, 32)
|
|
panel.save(OUTPUT / 'unavailable.png')
|
|
names = ['rr-load-0', 'rr-load-900', 'rr-load-1600', 'rr-spin', 'rr-raise', 'rr-fire']
|
|
hashes = set()
|
|
for name in names:
|
|
frame = Image.open(OUTPUT / (name + '.bmp')).convert('RGB')
|
|
assert frame.size == (640, 480)
|
|
assert len(frame.getcolors(640 * 480)) > 1000
|
|
assert frame.getpixel((0, 0)) == (17, 17, 22), name
|
|
assert frame.getpixel((0, 479)) == (17, 22, 23), name
|
|
hashes.add(hashlib.sha256(frame.tobytes()).digest())
|
|
frame.save(OUTPUT / (name + '.png'))
|
|
assert len(hashes) == len(names)
|
|
medical = (ROOT / 'assets/animations/buckshot/medical-v5.bin').read_bytes()
|
|
assert struct.unpack_from('<4s4I', medical) == (b'ANM1', 384, 256, 32, 384 * 256 * 4 * 32)
|
|
stride = 384 * 256 * 4
|
|
assert len({hashlib.sha256(medical[20 + i * stride:20 + (i + 1) * stride]).digest()
|
|
for i in range(32)}) == 32
|
|
print('PASS: no graphical console fallback; native modal; six distinct first-person roulette frames; 32 distinct medical poses')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|