diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 10:31:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-28 10:31:57 +0400 |
commit | b340f930ec5639f24e7e2d47fab221fb752b61dd (patch) | |
tree | 0e880a36bb528d133af6d10701fc090716b3b7f8 /source/blender/gpu/intern | |
parent | 09dc600839904a198ab4ba3fad62ce58c2d3aa07 (diff) |
style cleanup: changes to brace placement / newlines - for/while/if/switch
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 8 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 18 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 17 |
5 files changed, 31 insertions, 24 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 1dee327a066..980aed64ed9 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -861,7 +861,7 @@ const GPUBufferTypeSettings gpu_buffer_type_settings[] = { /* get the GPUDrawObject buffer associated with a type */ static GPUBuffer **gpu_drawobject_buffer_from_type(GPUDrawObject *gdo, GPUBufferType type) { - switch(type) { + switch (type) { case GPU_BUFFER_VERTEX: return &gdo->points; case GPU_BUFFER_NORMAL: @@ -882,7 +882,7 @@ static GPUBuffer **gpu_drawobject_buffer_from_type(GPUDrawObject *gdo, GPUBuffer /* get the amount of space to allocate for a buffer of a particular type */ static int gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type) { - switch(type) { + switch (type) { case GPU_BUFFER_VERTEX: return sizeof(float)*3 * (dm->drawObject->tot_triangle_point + dm->drawObject->tot_loose_point); case GPU_BUFFER_NORMAL: @@ -1059,7 +1059,7 @@ void GPU_uvedge_setup(DerivedMesh *dm) static int GPU_typesize(int type) { - switch(type) { + switch (type) { case GL_FLOAT: return sizeof(float); case GL_INT: diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index fc3878e2532..4113344760b 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -710,8 +710,10 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes) /* attributes don't need to be bound, they already have * an id that the drawing functions will use */ if (input->source == GPU_SOURCE_ATTRIB || - input->source == GPU_SOURCE_BUILTIN) + input->source == GPU_SOURCE_BUILTIN) + { continue; + } if (input->ima || input->tex) BLI_snprintf(input->shadername, sizeof(input->shadername), "samp%d", input->texid); @@ -1034,8 +1036,10 @@ static void gpu_nodes_get_vertex_attributes(ListBase *nodes, GPUVertexAttribs *a if (input->source == GPU_SOURCE_ATTRIB) { for (a=0; a<attribs->totlayer; a++) { if (attribs->layer[a].type == input->attribtype && - strcmp(attribs->layer[a].name, input->attribname) == 0) + strcmp(attribs->layer[a].name, input->attribname) == 0) + { break; + } } if (a == attribs->totlayer && a < GPU_MAX_ATTRIB) { diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 01f000e3314..c830971dcbd 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -441,9 +441,11 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int /* if same image & tile, we're done */ if (compare && ima == GTS.curima && GTS.curtile == GTS.tile && - GTS.tilemode == GTS.curtilemode && GTS.curtileXRep == GTS.tileXRep && - GTS.curtileYRep == GTS.tileYRep) + GTS.tilemode == GTS.curtilemode && GTS.curtileXRep == GTS.tileXRep && + GTS.curtileYRep == GTS.tileYRep) + { return (ima != NULL); + } /* if tiling mode or repeat changed, change texture matrix to fit */ if (GTS.tilemode!=GTS.curtilemode || GTS.curtileXRep!=GTS.tileXRep || diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 6c30c95f355..83d9619f217 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -171,14 +171,16 @@ void GPU_extensions_init(void) * New IDs from MESA's src/gallium/drivers/r300/r300_screen.c */ if (strstr(renderer, "R3") || strstr(renderer, "RV3") || - strstr(renderer, "R4") || strstr(renderer, "RV4") || - strstr(renderer, "RS4") || strstr(renderer, "RC4") || - strstr(renderer, "R5") || strstr(renderer, "RV5") || - strstr(renderer, "RS600") || strstr(renderer, "RS690") || - strstr(renderer, "RS740") || strstr(renderer, "X1") || - strstr(renderer, "X2") || strstr(renderer, "Radeon 9") || - strstr(renderer, "RADEON 9")) + strstr(renderer, "R4") || strstr(renderer, "RV4") || + strstr(renderer, "RS4") || strstr(renderer, "RC4") || + strstr(renderer, "R5") || strstr(renderer, "RV5") || + strstr(renderer, "RS600") || strstr(renderer, "RS690") || + strstr(renderer, "RS740") || strstr(renderer, "X1") || + strstr(renderer, "X2") || strstr(renderer, "Radeon 9") || + strstr(renderer, "RADEON 9")) + { GG.npotdisabled = 1; + } } /* make sure double side isn't used by default and only getting enabled in places where it's @@ -236,7 +238,7 @@ static void GPU_print_framebuffer_error(GLenum status, char err_out[256]) { const char *err= "unknown"; - switch(status) { + switch (status) { case GL_FRAMEBUFFER_COMPLETE_EXT: break; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index ab5f2040175..e14e4dce405 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -397,8 +397,7 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode if (lamp->type==LA_AREA) return visifac; - switch(lamp->falloff_type) - { + switch (lamp->falloff_type) { case LA_FALLOFF_CONSTANT: break; case LA_FALLOFF_INVLINEAR: @@ -535,7 +534,7 @@ static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, G } else { /* input */ - switch(ma->rampin_col) { + switch (ma->rampin_col) { case MA_RAMP_IN_ENERGY: GPU_link(mat, "ramp_rgbtobw", rgb, &fac); break; @@ -588,7 +587,7 @@ static void do_specular_ramp(GPUShadeInput *shi, GPUNodeLink *is, GPUNodeLink *t if (ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) { /* input */ - switch(ma->rampin_spec) { + switch (ma->rampin_spec) { case MA_RAMP_IN_ENERGY: fac = t; break; @@ -807,7 +806,7 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr) static void texture_rgb_blend(GPUMaterial *mat, GPUNodeLink *tex, GPUNodeLink *out, GPUNodeLink *fact, GPUNodeLink *facg, int blendtype, GPUNodeLink **in) { - switch(blendtype) { + switch (blendtype) { case MTEX_BLEND: GPU_link(mat, "mtex_rgb_blend", out, tex, fact, facg, in); break; @@ -858,7 +857,7 @@ static void texture_rgb_blend(GPUMaterial *mat, GPUNodeLink *tex, GPUNodeLink *o static void texture_value_blend(GPUMaterial *mat, GPUNodeLink *tex, GPUNodeLink *out, GPUNodeLink *fact, GPUNodeLink *facg, int blendtype, GPUNodeLink **in) { - switch(blendtype) { + switch (blendtype) { case MTEX_BLEND: GPU_link(mat, "mtex_value_blend", out, tex, fact, facg, in); break; @@ -1767,7 +1766,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma) uniform->datatype = GPU_DATA_1I; BLI_strncpy(uniform->varname, input->shadername, sizeof(uniform->varname)); - switch(input->textype) { + switch (input->textype) { case GPU_SHADOW2D: uniform->type = GPU_DYNAMIC_SAMPLER_2DSHADOW; uniform->lamp = input->dynamicdata; @@ -1788,7 +1787,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma) else { uniform->type = input->dynamictype; BLI_strncpy(uniform->varname, input->shadername, sizeof(uniform->varname)); - switch(input->type) { + switch (input->type) { case 1: uniform->datatype = GPU_DATA_1F; break; @@ -1847,7 +1846,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma) attribute->number = mat->attribs.layer[i].glindex; BLI_snprintf(attribute->varname, sizeof(attribute->varname), "att%d", mat->attribs.layer[i].attribid); - switch(attribute->type) { + switch (attribute->type) { case CD_TANGENT: attribute->datatype = GPU_DATA_4F; break; |