diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-23 12:53:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-23 12:53:47 +0300 |
commit | d859bac9e838cbaf90761f6d1768a6a7e8cf2fe2 (patch) | |
tree | c8adf53d5eefc4bbce9c66bad4cdc02417a375c7 /intern/gawain | |
parent | 96f7b08aecfd2626ddfca56265ab5e953c084b68 (diff) |
Cleanup: Make Gawain code style more consistent
Not as if i'm totally fine with such style, but i'd better be consistent
with whatever the project is using.
Diffstat (limited to 'intern/gawain')
-rw-r--r-- | intern/gawain/src/batch.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/intern/gawain/src/batch.c b/intern/gawain/src/batch.c index 059de41ab3e..33bb31cc3f7 100644 --- a/intern/gawain/src/batch.c +++ b/intern/gawain/src/batch.c @@ -291,7 +291,7 @@ void Batch_draw(Batch* batch) // clement : temp stuff void Batch_draw_stupid(Batch* batch) -{ + { if (batch->vao_id) glBindVertexArray(batch->vao_id); else @@ -322,12 +322,12 @@ void Batch_draw_stupid(Batch* batch) // Batch_done_using_program(batch); glBindVertexArray(0); -} + } // clement : temp stuff void Batch_draw_stupid_instanced(Batch* batch, unsigned int instance_vbo, int instance_count, int attrib_nbr, int attrib_stride, int attrib_size[16], int attrib_loc[16]) -{ + { if (batch->vao_id) glBindVertexArray(batch->vao_id); else @@ -338,12 +338,14 @@ void Batch_draw_stupid_instanced(Batch* batch, unsigned int instance_vbo, int in glBindBuffer(GL_ARRAY_BUFFER, instance_vbo); int ptr_ofs = 0; - for (int i = 0; i < attrib_nbr; ++i) { + for (int i = 0; i < attrib_nbr; ++i) + { int size = attrib_size[i]; int loc = attrib_loc[i]; int atr_ofs = 0; - while (size > 0) { + while (size > 0) + { glEnableVertexAttribArray(loc + atr_ofs); glVertexAttribPointer(loc + atr_ofs, (size > 4) ? 4 : size, GL_FLOAT, GL_FALSE, sizeof(float) * attrib_stride, (GLvoid*)(sizeof(float) * ptr_ofs)); @@ -351,8 +353,8 @@ void Batch_draw_stupid_instanced(Batch* batch, unsigned int instance_vbo, int in atr_ofs++; ptr_ofs += (size > 4) ? 4 : size; size -= 4; + } } - } glBindBuffer(GL_ARRAY_BUFFER, 0); // Batch_use_program(batch); @@ -370,5 +372,4 @@ void Batch_draw_stupid_instanced(Batch* batch, unsigned int instance_vbo, int in // Batch_done_using_program(batch); glBindVertexArray(0); -} - + } |