Mercurial > touhou
comparison pytouhou/ui/sprite.pyx @ 215:ab6e6909ce04
Don’t scale texture instead of shifting it, fix ANM’s 28th opcode.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 07 Dec 2011 13:23:02 +0100 |
parents | ee6dfd14a785 |
children | 741860192b56 |
comparison
equal
deleted
inserted
replaced
214:136d29ffe3c2 | 215:ab6e6909ce04 |
---|---|
57 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2]) | 57 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2]) |
58 | 58 |
59 x_1 = 1. / sprite.anm.size[0] | 59 x_1 = 1. / sprite.anm.size[0] |
60 y_1 = 1. / sprite.anm.size[1] | 60 y_1 = 1. / sprite.anm.size[1] |
61 tox, toy = sprite.texoffsets | 61 tox, toy = sprite.texoffsets |
62 uvs = [tx * x_1 + tox, 1. - (ty * y_1) + toy, | 62 uvs = [tx * x_1 + tox, 1. - (ty * y_1 + toy), |
63 (tx + tw) * x_1 + tox, 1. - (ty * y_1) + toy, | 63 (tx + tw) * x_1 + tox, 1. - (ty * y_1 + toy), |
64 (tx + tw) * x_1 + tox, 1. - ((ty + th) * y_1 + toy), | 64 (tx + tw) * x_1 + tox, 1. - ((ty + th) * y_1 + toy), |
65 tx * x_1 + tox, 1. - ((ty + th) * y_1 + toy)] | 65 tx * x_1 + tox, 1. - ((ty + th) * y_1 + toy)] |
66 | 66 |
67 (x1, x2 , x3, x4), (y1, y2, y3, y4), (z1, z2, z3, z4), _ = vertmat.data | 67 (x1, x2 , x3, x4), (y1, y2, y3, y4), (z1, z2, z3, z4), _ = vertmat.data |
68 | 68 |