comparison pytouhou/ui/gamerenderer.pyx @ 217:577f45454402

Change background during spellcards.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 17 Dec 2011 21:18:39 +0100
parents ee6dfd14a785
children 5c3600e0f0cd
comparison
equal deleted inserted replaced
216:a842ddd471fd 217:577f45454402
103 103
104 back = self.background 104 back = self.background
105 game = self.game 105 game = self.game
106 texture_manager = self.texture_manager 106 texture_manager = self.texture_manager
107 107
108 if back is not None: 108 if game.effect is not None:
109 glMatrixMode(GL_MODELVIEW)
110 glLoadIdentity()
111 # Some explanations on the magic constants:
112 # 192. = 384. / 2. = width / 2.
113 # 224. = 448. / 2. = height / 2.
114 # 835.979370 = 224./math.tan(math.radians(15)) = (height/2.)/math.tan(math.radians(fov/2))
115 # This is so that objects on the (O, x, y) plane use pixel coordinates
116 gluLookAt(192., 224., - 835.979370,
117 192., 224., 0., 0., -1., 0.)
118
119 glDisable(GL_FOG)
120 self.render_elements([game.effect])
121 glEnable(GL_FOG)
122 elif back is not None:
109 fog_b, fog_g, fog_r, fog_start, fog_end = back.fog_interpolator.values 123 fog_b, fog_g, fog_r, fog_start, fog_end = back.fog_interpolator.values
110 x, y, z = back.position_interpolator.values 124 x, y, z = back.position_interpolator.values
111 dx, dy, dz = back.position2_interpolator.values 125 dx, dy, dz = back.position2_interpolator.values
112 126
113 glFogi(GL_FOG_MODE, GL_LINEAR) 127 glFogi(GL_FOG_MODE, GL_LINEAR)