Mercurial > touhou
comparison pytouhou/ui/opengl/gamerenderer.pyx @ 516:577c3a88fb67
Merge the lists Game.texts and Game.native_texts into the Game.texts dict.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 11 May 2014 20:25:07 +0200 |
parents | b3193b43a86c |
children | dec43940f092 |
comparison
equal
deleted
inserted
replaced
515:b3193b43a86c | 516:577c3a88fb67 |
---|---|
76 def render(self, Game game): | 76 def render(self, Game game): |
77 if not self.use_fixed_pipeline: | 77 if not self.use_fixed_pipeline: |
78 self.framebuffer.bind() | 78 self.framebuffer.bind() |
79 | 79 |
80 self.render_game(game) | 80 self.render_game(game) |
81 self.render_text(game.texts + game.native_texts) | 81 self.render_text(game.texts) |
82 self.render_interface(game.interface, game.boss) | 82 self.render_interface(game.interface, game.boss) |
83 | 83 |
84 if not self.use_fixed_pipeline: | 84 if not self.use_fixed_pipeline: |
85 self.passthrough_shader.bind() | 85 self.passthrough_shader.bind() |
86 self.passthrough_shader.uniform_matrix('mvp', self.interface_mvp) | 86 self.passthrough_shader.uniform_matrix('mvp', self.interface_mvp) |
187 self.render_quads([rect], [(color1, color1, color2, color2)], 0) | 187 self.render_quads([rect], [(color1, color1, color2, color2)], 0) |
188 | 188 |
189 glDisable(GL_SCISSOR_TEST) | 189 glDisable(GL_SCISSOR_TEST) |
190 | 190 |
191 | 191 |
192 cdef void render_text(self, texts): | 192 cdef void render_text(self, dict texts): |
193 cdef NativeText label | 193 cdef NativeText label |
194 | 194 |
195 if self.font_manager is None: | 195 if self.font_manager is None: |
196 return | 196 return |
197 | 197 |
198 labels = [label for label in texts if label is not None] | 198 labels = [label for label in texts.itervalues() if label is not None] |
199 self.font_manager.load(labels) | 199 self.font_manager.load(labels) |
200 | 200 |
201 black = Color(0, 0, 0, 255) | 201 black = Color(0, 0, 0, 255) |
202 | 202 |
203 for label in labels: | 203 for label in labels: |