Mercurial > touhou
diff pytouhou/ui/texture.pyx @ 223:98c64ffcbdff
Make pytouhou.ui.{background,texture} Cython modules as they are only used by Cython modules.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Sun, 18 Dec 2011 21:23:51 +0100 |
parents | pytouhou/ui/texture.py@ee6dfd14a785 |
children | 71cd4461bb7f |
line wrap: on
line diff
copy from pytouhou/ui/texture.py copy to pytouhou/ui/texture.pyx --- a/pytouhou/ui/texture.py +++ b/pytouhou/ui/texture.pyx @@ -18,7 +18,7 @@ from pyglet.gl import (glTexParameteri, import os -class TextureManager(object): +cdef class TextureManager: def __init__(self, loader=None): self.loader = loader self.textures = {} @@ -54,7 +54,7 @@ class TextureManager(object): alpha_data = alpha_file.get_data('RGB', image_file.width * 3) image_file = pyglet.image.ImageData(image_file.width, image_file.height, 'RGBA', b''.join(data[i*3:i*3+3] + alpha_data[i*3] for i in range(image_file.width * image_file.height))) - #TODO + #TODO: improve perfs somehow texture = image_file.get_texture()