comparison pytouhou/ui/gamerenderer.pyx @ 505:bfea9e9a6845

Manage the texture-specific indices in the Texture, and some more renderer optimisations.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 01 Nov 2013 14:45:53 +0100
parents c622eaf64428
children 2e8ceaa85d5c
comparison
equal deleted inserted replaced
504:69c73023f7a0 505:bfea9e9a6845
22 GL_SCISSOR_TEST, GL_DEPTH_BUFFER_BIT) 22 GL_SCISSOR_TEST, GL_DEPTH_BUFFER_BIT)
23 23
24 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d 24 from pytouhou.utils.maths cimport perspective, setup_camera, ortho_2d
25 from pytouhou.game.text cimport NativeText, GlyphCollection 25 from pytouhou.game.text cimport NativeText, GlyphCollection
26 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader 26 from .shaders.eosd import GameShader, BackgroundShader, PassthroughShader
27 from .renderer cimport Texture
27 28
28 from collections import namedtuple 29 from collections import namedtuple
29 Rect = namedtuple('Rect', 'x y w h') 30 Rect = namedtuple('Rect', 'x y w h')
30 Color = namedtuple('Color', 'r g b a') 31 Color = namedtuple('Color', 'r g b a')
31 32
197 gradient = [Color(*color, a=label.alpha) for color in label.gradient] 198 gradient = [Color(*color, a=label.alpha) for color in label.gradient]
198 199
199 if label.shadow: 200 if label.shadow:
200 shadow_rect = Rect(label.x + 1, label.y + 1, label.width, label.height) 201 shadow_rect = Rect(label.x + 1, label.y + 1, label.width, label.height)
201 shadow = [black._replace(a=label.alpha)] * 4 202 shadow = [black._replace(a=label.alpha)] * 4
202 self.render_quads([shadow_rect, rect], [shadow, gradient], label.texture) 203 self.render_quads([shadow_rect, rect], [shadow, gradient], (<Texture>label.texture).texture)
203 else: 204 else:
204 self.render_quads([rect], [gradient], label.texture) 205 self.render_quads([rect], [gradient], (<Texture>label.texture).texture)
205 206
206 207
207 cdef void render_interface(self, interface, game_boss): 208 cdef void render_interface(self, interface, game_boss):
208 cdef GlyphCollection label 209 cdef GlyphCollection label
209 210