comparison pytouhou/ui/background.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 6e733ed817bd
children
comparison
equal deleted inserted replaced
504:69c73023f7a0 505:bfea9e9a6845
90 vertex_buffer[nb_vertices+2] = Vertex(x3 + ox + ox2, y3 + oy + oy2, z3 + oz + oz2, right, top, r, g, b, a) 90 vertex_buffer[nb_vertices+2] = Vertex(x3 + ox + ox2, y3 + oy + oy2, z3 + oz + oz2, right, top, r, g, b, a)
91 vertex_buffer[nb_vertices+3] = Vertex(x4 + ox + ox2, y4 + oy + oy2, z4 + oz + oz2, left, top, r, g, b, a) 91 vertex_buffer[nb_vertices+3] = Vertex(x4 + ox + ox2, y4 + oy + oy2, z4 + oz + oz2, left, top, r, g, b, a)
92 92
93 nb_vertices += 4 93 nb_vertices += 4
94 94
95 self.texture = key % MAX_TEXTURES 95 self.texture = key >> 1
96 self.blendfunc = key // MAX_TEXTURES 96 self.blendfunc = key & 1
97 self.nb_vertices = nb_vertices 97 self.nb_vertices = nb_vertices
98 self.vertex_buffer = <Vertex*> realloc(vertex_buffer, nb_vertices * sizeof(Vertex)) 98 self.vertex_buffer = <Vertex*> realloc(vertex_buffer, nb_vertices * sizeof(Vertex))
99 99
100 if not self.use_fixed_pipeline: 100 if not self.use_fixed_pipeline:
101 glBindBuffer(GL_ARRAY_BUFFER, self.vbo) 101 glBindBuffer(GL_ARRAY_BUFFER, self.vbo)