Exemplo n.º 1
0
    def __init__(self, filename: str):
        self.basename = os.path.splitext(filename)[0]

        with open(f'sc/{filename}', 'rb') as fh:
            buffer = fh.read()
            fh.close()

        decompressor = Decompressor()
        buffer = decompressor.decompress(buffer)

        Reader.__init__(self, buffer, 'little')

        self.is_texture = self.basename.endswith('_tex')
        if self.is_texture:
            if not os.path.exists('png'):
                os.mkdir('png')

        self.shape_count: int = 0
        self.clips_count: int = 0
        self.textures_count: int = 0
        self.text_fields_count: int = 0
        self.matrix_count: int = 0
        self.color_transformations_count: int = 0

        self.shapes: list = []
        self.clips: list = []
        self.textures: list = []
        self.text_fields: list = []
        self.matrix: list = []
        self.color_transformations: list = []

        self.exports: list = []
Exemplo n.º 2
0
 def decode(self, buffer):
     Reader.__init__(self, buffer)