obj2d: switch to flat array of indices
This commit is contained in:
1 parent
6f87666e14
commit
543006b3ec
2 files changed
+41
-23
No files matched your search
+6
-4
@@ -9,14 +9,14 @@ immutable enum int WIRE = 1;
|
||||
immutable enum int GENTEX = 0;
|
||||
immutable enum int CORPORATION = 1;
|
||||
|
||||
ushort[][][2][2] object_indices;
|
||||
logoobj.indices_range_t [][2][2] object_indices;
|
||||
/* Indexed by: face/wire, word, character */
|
||||
VAO[][2][2] object_vaos;
|
||||
|
||||
void init()
|
||||
{
|
||||
object_indices = [[logoobj.get_fg(), logoobj.get_fc()],
|
||||
[logoobj.get_lg(), logoobj.get_lc()]];
|
||||
object_indices = [[logoobj.fg, logoobj.fc],
|
||||
[logoobj.lg, logoobj.lc]];
|
||||
Buffer vertices_buffer = new Buffer(logoobj.vertices);
|
||||
for (int draw_type = FACE; draw_type <= WIRE; draw_type++)
|
||||
{
|
||||
@@ -31,7 +31,9 @@ void init()
|
||||
vao.bind();
|
||||
|
||||
vertices_buffer.bind();
|
||||
ElementBuffer ibo = new ElementBuffer(object_indices[draw_type][word][char_index]);
|
||||
int start = object_indices[draw_type][word][char_index].start;
|
||||
int length = object_indices[draw_type][word][char_index].length;
|
||||
ElementBuffer ibo = new ElementBuffer(logoobj.indices[start .. (start + length)]);
|
||||
ibo.bind();
|
||||
|
||||
object_vaos[draw_type][word][char_index] = vao;
|
||||
|
||||
Reference in new issue
Block a user