comparison pytouhou/resource/loader.py @ 220:0595315d3880

Fix SHT handling; change a few things to be closer to ZUN’s mind; and first stub of PCB support.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 18 Dec 2011 14:14:32 +0100
parents 2cad2e84a49e
children 5afc75f71fed
comparison
equal deleted inserted replaced
219:091301805cce 220:0595315d3880
3 from pytouhou.formats.pbg3 import PBG3 3 from pytouhou.formats.pbg3 import PBG3
4 from pytouhou.formats.std import Stage 4 from pytouhou.formats.std import Stage
5 from pytouhou.formats.ecl import ECL 5 from pytouhou.formats.ecl import ECL
6 from pytouhou.formats.anm0 import Animations 6 from pytouhou.formats.anm0 import Animations
7 from pytouhou.formats.msg import MSG 7 from pytouhou.formats.msg import MSG
8 from pytouhou.formats.sht import SHT
8 9
9 10
10 from pytouhou.resource.anmwrapper import AnmWrapper 11 from pytouhou.resource.anmwrapper import AnmWrapper
11 12
12 13
42 self.known_files = {} 43 self.known_files = {}
43 self.instanced_ecls = {} 44 self.instanced_ecls = {}
44 self.instanced_anms = {} 45 self.instanced_anms = {}
45 self.instanced_stages = {} 46 self.instanced_stages = {}
46 self.instanced_msgs = {} 47 self.instanced_msgs = {}
48 self.instanced_shts = {}
47 49
48 50
49 def scan_archives(self, paths): 51 def scan_archives(self, paths):
50 for path in paths: 52 for path in paths:
51 archive_description = ArchiveDescription.get_from_path(path) 53 archive_description = ArchiveDescription.get_from_path(path)
91 file = self.get_file(name) 93 file = self.get_file(name)
92 self.instanced_msgs[name] = MSG.read(file) #TODO: modular 94 self.instanced_msgs[name] = MSG.read(file) #TODO: modular
93 return self.instanced_msgs[name] 95 return self.instanced_msgs[name]
94 96
95 97
98 def get_sht(self, name):
99 if name not in self.instanced_shts:
100 file = self.get_file(name)
101 self.instanced_shts[name] = SHT.read(file) #TODO: modular
102 return self.instanced_shts[name]
103
104
96 def get_anm_wrapper(self, names): 105 def get_anm_wrapper(self, names):
97 return AnmWrapper(self.get_anm(name) for name in names) 106 return AnmWrapper(self.get_anm(name) for name in names)
98 107
99 108
100 def get_anm_wrapper2(self, names): 109 def get_anm_wrapper2(self, names):