comparison pytouhou/resource/loader.py @ 779:ee09657d3789

Replace the stage parser with the Rust one
author Link Mauve <linkmauve@linkmauve.fr>
date Sat, 08 Nov 2025 19:29:33 +0100
parents 816e1f01d650
children a30ce01b9154
comparison
equal deleted inserted replaced
778:816e1f01d650 779:ee09657d3789
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details. 12 ## GNU General Public License for more details.
13 ## 13 ##
14 14
15 from libtouhou import Loader as RustLoader 15 from libtouhou import Loader as RustLoader
16 from pytouhou.formats.std import Stage
17 from pytouhou.formats.ecl import ECL 16 from pytouhou.formats.ecl import ECL
18 from pytouhou.formats.anm0 import ANM0 17 from pytouhou.formats.anm0 import ANM0
19 from pytouhou.formats.msg import MSG 18 from pytouhou.formats.msg import MSG
20 from pytouhou.formats.sht import SHT 19 from pytouhou.formats.sht import SHT
21 from pytouhou.formats.exe import SHT as EoSDSHT, InvalidExeException 20 from pytouhou.formats.exe import SHT as EoSDSHT, InvalidExeException
40 file = self.get_file(name) 39 file = self.get_file(name)
41 anm = ANM0.read(file) 40 anm = ANM0.read(file)
42 self.instanced_anms[name] = anm 41 self.instanced_anms[name] = anm
43 self.loaded_anms.append(name) 42 self.loaded_anms.append(name)
44 return anm 43 return anm
45
46
47 def get_stage(self, name):
48 file = self.get_file(name)
49 return Stage.read(file) #TODO: modular
50 44
51 45
52 def get_ecl(self, name): 46 def get_ecl(self, name):
53 file = self.get_file(name) 47 file = self.get_file(name)
54 return ECL.read(file) #TODO: modular 48 return ECL.read(file) #TODO: modular