view data/ST/make_ecl.py @ 772:7492d384d122 default tip

Rust: Add a Glide renderer (2D only for now) This is an experiment for a Rust renderer, iterating over the Python data using pyo3. It requires --feature=glide to be passed to cargo build, doesn’t support NPOT textures, text rendering, the background, or even msg faces, some of that may come in a future changeset.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 05 Sep 2022 17:53:36 +0200
parents 1bc0ad774ed4
children
line wrap: on
line source

from pytouhou.formats.ecl import ECL
from math import pi

# Frame, sub, opcode, args
main = [(120, 0, 0, (-30.0, 80.0, 0.0, 160, 0, 0, 0)),
        (140, 0, 0, (-30.0, 130.0, 0.0, 160, 0, 0, 0)),

        (160, 0, 2, (192*2+30.0, 80.0, 0.0, 160, 0, 0, 0)),
        (180, 0, 2, (192*2+30.0, 130.0, 0.0, 160, 0, 0, 0)),

        (220, 0, 0, (-30.0, 80.0, 0.0, 16, 0, 0, 0)),
        (220, 0, 0, (-30.0, 130.0, 0.0, 16, 0, 0, 0)),

        (260, 0, 2, (192*2+30.0, 80.0, 0.0, 16, 0, 0, 0)),
        (260, 0, 2, (192*2+30.0, 130.0, 0.0, 16, 0, 0, 0)),

        (560, 2, 0, (0, -10, 0.0, 120, 0, 0, 0)),
        (780, 2, 0, (0, -10, 0.0, 120, 0, 0, 0)),
        (900, 2, 0, (0, -10, 0.0, 120, 0, 0, 0)),

        (1500, 3, 0, (192, -10, 0.0, 2000, 0, 0, 0)),

        (2100, 4, 0, (-30.0, 80.0, 0.0, 6500, 0, 0, 0))]


subs = [
    # Frame, opcode, rank_mask, param_mask, args
    [(0, 97, 0xff00, 256, (0,)),
     (0, 108, 0xff00, 256, (1,)),
     (0, 107, 0xff00, 256, (1,)),
     (0, 45, 0xff00, 256, (-0.3, 0.8)),
     (0, 48, 0xff00, 256, (0.01,)),
     (0, 46, 0xff00, 256, (0.001,)),
     (0, 5, 0xff00, 256, (-10005, pi-0.3)),
     (0, 68, 0xff00, 256, (2, 6, 1, 1, 2.0, 0.0, -10005.0, 0.0, 1)),
     (2, 21, 0xff00, 256, (-10005, -10005, 0.2)),
     (2, 2, 0xff00, 256, (0, 7))],

    [(0, 75, 0xff00, 256, (1, 2, 10, 10, 2.0, 4.0, -pi, pi, 0)),
     (5, 1, 0xff00, 256, (0,))],

    [(0, 97, 0xff00, 256, (3,)),
     (0, 4, 0xff00, 256, (-10001, 15)),
     (0, 57, 0xff00, 256, (60, 192.0, 80.0, 0.0)),
     (0, 78, 0xff00, 256, ()),
     (0, 67, 0xff00, 256, (2, 6, 1, 4, 2.0, 4.0, 0.0, 0.0, 1)),
     (0, 79, 0xff00, 256, ()),
     (0, 77, 0xff00, 256, (20,)),
     (60, 65, 0xff00, 256, (20, 20, 192*2-20, 120)),
     (60, 47, 0xff00, 256, (8.0,)),

     (60, 50, 0xff00, 256, (-pi, pi)),

     (80, 3, 0xff00, 256, (60, 9, -10001)),

     (80, 66, 0xff00, 256, ()),
     (80, 76, 0xff00, 256, (0,)),
     (80, 51, 0xff00, 256, (0, 8.0))],

    [(0, 97, 0xff00, 256, (0,)),
     (0, 57, 0xff00, 256, (60, 192.0, 80.0, 0.0)),
     (60, 82, 0xff00, 256, (40, 15, -1, -1, 0.0, 6.0, -1, -1)),
     (60, 75, 0xff00, 256, (1, 3, 20, 1, 3.0, 6.0, -pi, pi, 1| 128)),
     (60, 76, 0xff00, 256, (110,))],

    [(0, 97, 0xff00, 256, (0,)),
     (0, 105, 0xff00, 256, (0,)), # Set damageable: False
     (0, 126, 0xff00, 256, (0,)), # One life

    # Set callback
     (0, 113, 0xff00, 256, (1000,)),
     (0, 114, 0xff00, 256, (5,)),

     (0, 111, 0xff00, 256, (6000,)),
     (0, 101, 0xff00, 256, (0,)),
     (0, 57, 0xff00, 256, (60, 192.0, 80.0, 0.0)),
     (60, 102, 0xff00, 256, (10, -0.3, 0.7, 0.3, 48.0)), # Nice little effect
     (80, 105, 0xff00, 256, (1,)), # Set damageable: True
     (80, 119, 0xff00, 256, (10,)), # Drop bonus :)

     (80, 82, 0xff00, 256, (800, 1, -1, -1, 0.02, 0.02, 0.0, 0.0)),
     (80, 70, 0xff00, 256, (2, 2, 30, 4, 0.1, 4.1, 0.0, 0.0, 1|32)),
     (80, 82, 0xff00, 256, (800, 1, -1, -1, 0.02, -0.02, 0.0, 0.0)),
     (80, 70, 0xff00, 256, (2, 6, 30, 4, 0.6, 4.6, 0.0, 0.0, 1|32)),

     (120, 67, 0xff00, 256, (2, 4, 3, 30, 1.0, 5.0, 0.0, 4.0, 0)),

     (200, 2, 0xff00, 256, (80, 11))
    ],

    [(0, 93, 0xff00, 256, (2, 0, "THE END ~")),

     (20, 81, 0xff00, 256, (-100.0-20, 50.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, 0.0, 0, 0.0, 60.0, 60.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 2., 0, 0.0, 40.0, 40.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 81, 0xff00, 256, (-100.0-20, 100.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, 0.0, 0, 0.0, 60.0, 60.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 2., 0, 0.0, 40.0, 40.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 81, 0xff00, 256, (-100.0-20, 150.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, 0.0, 0, 0.0, 60.0, 60.0, 16.0, 90, 120, 16, 70, 14, 0)),

     (20, 81, 0xff00, 256, (0.0-20, 20+50.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 2., 0, 0.0, 80.0, 80.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 4., 0, 0.0, 100.0, 100.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 81, 0xff00, 256, (80.0-20, 20+80+50.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, -pi / 2., 0, 0.0, 80.0, 80.0, 16.0, 90, 120, 16, 70, 14, 0)),

     (20, 81, 0xff00, 256, (120.0-20, 20+50.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 2., 0, 0.0, 80.0, 80.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 85, 0xff00, 256, (0, 6, pi / 4., 0, 0.0, 60.0, 60.0, 16.0, 90, 120, 16, 70, 14, 0)),
     (20, 81, 0xff00, 256, (120.0-20, 20+50.0+80.0, 0.0)),
     (20, 85, 0xff00, 256, (0, 6, -pi / 4., 0, 0.0, 60.0, 60.0, 16.0, 90, 120, 16, 70, 14, 0)),

     (40, 81, 0xff00, 256, (0, 0, 0)),
     (40, 75, 0xff00, 256, (9, 1, 8, 1, 0.5, 3.0, -pi, pi, 0)),
     (40, 76, 0xff00, 256, (40,)),

     (120, 4, 0xff00, 256, (-10001, 314)),

     (120, 87, 0xff00, 256, (1,)),
     (120, 85, 0xff00, 256, (0, 2, 0.0, 0, 0.0, 500.0, 500.0, 32.0, 90, 400, 16, 70, 14, 0)),

     (122, 88, 0xff00, 256, (1, 0.01)),
     (123, 3, 0xff00, 256, (122, 25, -10001)),

     (200, 94, 0xff00, 256, ()),
    ]
]

ecl = ECL()
ecl.subs = subs
ecl.main = main

with open('ecldata1.ecl', 'wb') as file:
    ecl.write(file)