comparison pytouhou/formats/animation.pyx @ 608:725bd24235a2

Make ANM0 pure-python again, by moving the Cython-dependent ANM class into its own module.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 26 Nov 2014 14:00:17 +0100
parents pytouhou/formats/anm0.pyx@43ecf0f98f4d
children dd393fa6e988
comparison
equal deleted inserted replaced
607:9dbc234ea087 608:725bd24235a2
1 # -*- encoding: utf-8 -*-
2 ##
3 ## Copyright (C) 2014 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
4 ##
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published
7 ## by the Free Software Foundation; version 3 only.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
13 ##
14
15 cdef class Animation:
16 def __init__(self):
17 self.version = 0
18 self.size_inv[:] = [0, 0]
19 self.first_name = None
20 self.secondary_name = None
21 self.sprites = {}
22 self.scripts = {}
23
24 property size:
25 def __set__(self, tuple value):
26 width, height = value
27 self.size_inv[:] = [1. / <double>width, 1. / <double>height]