[Bf-blender-cvs] [d859bac9e83] blender2.8: Cleanup: Make Gawain code style more consistent

Sergey Sharybin noreply at git.blender.org
Tue May 23 11:54:28 CEST 2017


Commit: d859bac9e838cbaf90761f6d1768a6a7e8cf2fe2
Author: Sergey Sharybin
Date:   Tue May 23 11:53:47 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBd859bac9e838cbaf90761f6d1768a6a7e8cf2fe2

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.

===================================================================

M	intern/gawain/src/batch.c

===================================================================

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);
-}
-
+	}




More information about the Bf-blender-cvs mailing list