diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-22 20:52:07 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-22 20:54:56 +0300 |
commit | 9c106ff2112dedb4bb7e36f9c0805921c82aede0 (patch) | |
tree | 3d2628471423e0faac0962a7aa0dd09d5487406e /source | |
parent | efc499cb991f1a432632d7c3a38070d36a3168b4 (diff) |
Cleanup: Style
Diffstat (limited to 'source')
31 files changed, 218 insertions, 202 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 24f97c00afb..92121ff8270 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -100,8 +100,7 @@ static void collection_free(SceneCollection *sc) */ bool collection_remlink(SceneCollection *sc_parent, SceneCollection *sc_gone) { - for (SceneCollection *sc = sc_parent->scene_collections.first; sc; sc = sc->next) - { + for (SceneCollection *sc = sc_parent->scene_collections.first; sc; sc = sc->next) { if (sc == sc_gone) { BLI_remlink(&sc_parent->scene_collections, sc_gone); return true; @@ -120,7 +119,7 @@ bool collection_remlink(SceneCollection *sc_parent, SceneCollection *sc_gone) static void layer_collection_remove(SceneLayer *sl, ListBase *lb, const SceneCollection *sc) { LayerCollection *lc = lb->first; - while(lc) { + while (lc) { if (lc->scene_collection == sc) { BKE_scene_layer_engine_settings_collection_recalculate(sl, lc); BKE_layer_collection_free(sl, lc); @@ -214,7 +213,8 @@ SceneCollection *BKE_collection_master(const Scene *scene) * Free (or release) any data used by the master collection (does not free the master collection itself). * Used only to clear the entire scene data since it's not doing re-syncing of the LayerCollection tree */ -void BKE_collection_master_free(Scene *scene){ +void BKE_collection_master_free(Scene *scene) +{ collection_free(BKE_collection_master(scene)); } @@ -300,7 +300,7 @@ typedef struct SceneCollectionsIteratorData { Scene *scene; void **array; int tot, cur; - } SceneCollectionsIteratorData; +} SceneCollectionsIteratorData; static void scene_collection_callback(SceneCollection *sc, BKE_scene_collections_Cb callback, void *data) { diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 3653a9ac651..c664429dbe7 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -32,7 +32,6 @@ #include "BLI_string_utils.h" #include "BLT_translation.h" -#include "BKE_layer.h" #include "BKE_collection.h" #include "BKE_layer.h" #include "BKE_main.h" @@ -227,7 +226,7 @@ void BKE_scene_layer_base_select(struct SceneLayer *sl, Base *selbase) } } -static void scene_layer_object_base_unref(SceneLayer* sl, Base *base) +static void scene_layer_object_base_unref(SceneLayer *sl, Base *base) { base->refcount--; @@ -242,7 +241,8 @@ static void scene_layer_object_base_unref(SceneLayer* sl, Base *base) } } -static void layer_collection_base_flag_recalculate(LayerCollection *lc, const bool tree_is_visible, const bool tree_is_selectable) +static void layer_collection_base_flag_recalculate( + LayerCollection *lc, const bool tree_is_visible, const bool tree_is_selectable) { bool is_visible = tree_is_visible && ((lc->flag & COLLECTION_VISIBLE) != 0); /* an object can only be selected if it's visible */ @@ -793,7 +793,8 @@ void BKE_layer_collection_engine_settings_callback_register( CollectionEngineSettingsCB_Type *ces_type; /* cleanup in case it existed */ - ces_type = BLI_findstring(&R_engines_settings_callbacks, engine_name, offsetof(CollectionEngineSettingsCB_Type, name)); + ces_type = BLI_findstring(&R_engines_settings_callbacks, engine_name, + offsetof(CollectionEngineSettingsCB_Type, name)); if (ces_type) { BLI_remlink(&R_engines_settings_callbacks, ces_type); @@ -839,7 +840,8 @@ static CollectionEngineSettings *collection_engine_settings_create(CollectionEng CollectionEngineSettings *BKE_layer_collection_engine_settings_create(const char *engine_name) { CollectionEngineSettingsCB_Type *ces_type; - ces_type = BLI_findstring(&R_engines_settings_callbacks, engine_name, offsetof(CollectionEngineSettingsCB_Type, name)); + ces_type = BLI_findstring(&R_engines_settings_callbacks, engine_name, + offsetof(CollectionEngineSettingsCB_Type, name)); BLI_assert(ces_type); CollectionEngineSettings *ces = collection_engine_settings_create(ces_type); @@ -920,7 +922,8 @@ static void layer_collection_create_mode_settings(LayerCollection *lc) /** * Return collection enginne settings for either Object s of LayerCollection s */ -static CollectionEngineSettings *collection_engine_get(ListBase *lb_render, ListBase *lb_mode, const int type, const char *engine_name) +static CollectionEngineSettings *collection_engine_get( + ListBase *lb_render, ListBase *lb_mode, const int type, const char *engine_name) { if (type == COLLECTION_MODE_NONE) { return BLI_findstring(lb_render, engine_name, offsetof(CollectionEngineSettings, name)); @@ -993,28 +996,32 @@ CollectionEngineProperty *BKE_collection_engine_property_get(CollectionEngineSet int BKE_collection_engine_property_value_get_int(CollectionEngineSettings *ces, const char *name) { CollectionEnginePropertyInt *prop; - prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); return prop->value; } float BKE_collection_engine_property_value_get_float(CollectionEngineSettings *ces, const char *name) { CollectionEnginePropertyFloat *prop; - prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); return prop->value; } bool BKE_collection_engine_property_value_get_bool(CollectionEngineSettings *ces, const char *name) { CollectionEnginePropertyBool *prop; - prop = (CollectionEnginePropertyBool *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyBool *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); return prop->value; } void BKE_collection_engine_property_value_set_int(CollectionEngineSettings *ces, const char *name, int value) { CollectionEnginePropertyInt *prop; - prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); prop->value = value; prop->data.flag |= COLLECTION_PROP_USE; } @@ -1022,7 +1029,8 @@ void BKE_collection_engine_property_value_set_int(CollectionEngineSettings *ces, void BKE_collection_engine_property_value_set_float(CollectionEngineSettings *ces, const char *name, float value) { CollectionEnginePropertyFloat *prop; - prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); prop->value = value; prop->data.flag |= COLLECTION_PROP_USE; } @@ -1030,7 +1038,8 @@ void BKE_collection_engine_property_value_set_float(CollectionEngineSettings *ce void BKE_collection_engine_property_value_set_bool(CollectionEngineSettings *ces, const char *name, bool value) { CollectionEnginePropertyBool *prop; - prop = (CollectionEnginePropertyBool *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name)); + prop = (CollectionEnginePropertyBool *)BLI_findstring(&ces->properties, name, + offsetof(CollectionEngineProperty, name)); prop->value = value; prop->data.flag |= COLLECTION_PROP_USE; } @@ -1076,7 +1085,7 @@ static void collection_engine_settings_init(ListBase *lb) static void collection_engine_settings_copy(ListBase *lb_dst, ListBase *lb_src) { for (CollectionEngineSettings *ces_src = lb_src->first; ces_src; ces_src = ces_src->next) { - CollectionEngineSettings *ces_dst = MEM_callocN(sizeof(CollectionEngineSettings), "CollectionEngineSettings copy"); + CollectionEngineSettings *ces_dst = MEM_callocN(sizeof(*ces_dst), "CollectionEngineSettings copy"); BLI_strncpy_utf8(ces_dst->name, ces_src->name, sizeof(ces_dst->name)); ces_dst->type = ces_src->type; @@ -1092,23 +1101,24 @@ static void collection_engine_settings_copy(ListBase *lb_dst, ListBase *lb_src) /** * Set a value from a CollectionProperty to another */ -static void collection_engine_property_set (CollectionEngineProperty *prop_dst, CollectionEngineProperty *prop_src){ +static void collection_engine_property_set (CollectionEngineProperty *prop_dst, CollectionEngineProperty *prop_src) +{ if ((prop_src->flag & COLLECTION_PROP_USE) != 0) { /* mark the property as used, so the engine knows if the value was ever set*/ prop_dst->flag |= COLLECTION_PROP_USE; switch (prop_src->type) { - case COLLECTION_PROP_TYPE_FLOAT: - ((CollectionEnginePropertyFloat *)prop_dst)->value = ((CollectionEnginePropertyFloat *)prop_src)->value; - break; - case COLLECTION_PROP_TYPE_INT: - ((CollectionEnginePropertyInt *)prop_dst)->value = ((CollectionEnginePropertyInt *)prop_src)->value; - break; - case COLLECTION_PROP_TYPE_BOOL: - ((CollectionEnginePropertyBool *)prop_dst)->value = ((CollectionEnginePropertyBool *)prop_src)->value; - break; - default: - BLI_assert(false); - break; + case COLLECTION_PROP_TYPE_FLOAT: + ((CollectionEnginePropertyFloat *)prop_dst)->value = ((CollectionEnginePropertyFloat *)prop_src)->value; + break; + case COLLECTION_PROP_TYPE_INT: + ((CollectionEnginePropertyInt *)prop_dst)->value = ((CollectionEnginePropertyInt *)prop_src)->value; + break; + case COLLECTION_PROP_TYPE_BOOL: + ((CollectionEnginePropertyBool *)prop_dst)->value = ((CollectionEnginePropertyBool *)prop_src)->value; + break; + default: + BLI_assert(false); + break; } } } @@ -1405,7 +1415,10 @@ static bool scene_layer_doversion_is_outdated_engines(ListBase *lb_ces, ListBase } CollectionEngineProperty *cep, *cep_ref; - for (cep = ces->properties.first, cep_ref = ces_ref->properties.first; cep; cep = cep->next, cep_ref = cep_ref->next) { + for (cep = ces->properties.first, cep_ref = ces_ref->properties.first; + cep != NULL; + cep = cep->next, cep_ref = cep_ref->next) + { if (cep->type != cep_ref->type) { return true; } diff --git a/source/blender/draw/engines/clay/clay.c b/source/blender/draw/engines/clay/clay.c index 9766bccd32c..54bae5de85c 100644 --- a/source/blender/draw/engines/clay/clay.c +++ b/source/blender/draw/engines/clay/clay.c @@ -101,7 +101,7 @@ typedef struct CLAY_StorageList { } CLAY_StorageList; /* keep it under MAX_BUFFERS */ -typedef struct CLAY_FramebufferList{ +typedef struct CLAY_FramebufferList { /* default */ struct GPUFrameBuffer *default_fb; /* engine specific */ @@ -109,7 +109,7 @@ typedef struct CLAY_FramebufferList{ } CLAY_FramebufferList; /* keep it under MAX_TEXTURES */ -typedef struct CLAY_TextureList{ +typedef struct CLAY_TextureList { /* default */ struct GPUTexture *color; struct GPUTexture *depth; @@ -125,7 +125,7 @@ enum { }; /* keep it under MAX_PASSES */ -typedef struct CLAY_PassList{ +typedef struct CLAY_PassList { struct DRWPass *depth_pass; struct DRWPass *depth_pass_cull; struct DRWPass *clay_pass; @@ -463,8 +463,7 @@ static int search_mat_to_ubo(CLAY_Storage *storage, float matcap_rot, float matc { /* For now just use a linear search and test all parameters */ /* TODO make a hash table */ - for (int i = 0; i < storage->ubo_current_id; ++i) - { + for (int i = 0; i < storage->ubo_current_id; ++i) { CLAY_UBO_Material *ubo = &storage->mat_storage.materials[i]; if ((ubo->matcap_rot[0] == cosf(matcap_rot * 3.14159f * 2.0f)) && @@ -584,7 +583,7 @@ static DRWShadingGroup *CLAY_object_shgrp_get(Object *ob, CLAY_StorageList *stl, override_setting(ces, "ssao_factor_edge", &ssao_factor_edge); override_setting(ces, "ssao_attenuation", &ssao_attenuation); override_setting(ces, "matcap_icon", &matcap_icon); - }; + } int id = mat_in_ubo(stl->storage, matcap_rot, matcap_hue, matcap_sat, matcap_val, ssao_distance, ssao_factor_cavity, ssao_factor_edge, diff --git a/source/blender/draw/engines/clay/clay.h b/source/blender/draw/engines/clay/clay.h index 404924be2a1..add2a45fbd7 100644 --- a/source/blender/draw/engines/clay/clay.h +++ b/source/blender/draw/engines/clay/clay.h @@ -23,8 +23,8 @@ * \ingroup DNA */ -#ifndef __ENGINE_CLAY_H__ -#define __ENGINE_CLAY_H__ +#ifndef __CLAY_H__ +#define __CLAY_H__ extern RenderEngineType viewport_clay_type; @@ -33,4 +33,4 @@ struct MaterialEngineSettings *CLAY_material_settings_create(void); void clay_engine_free(void); -#endif /* __ENGINE_CLAY_H__ */
\ No newline at end of file +#endif /* __CLAY_H__ */ diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 1fa3b84effd..7ad1c309581 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -92,11 +92,11 @@ typedef enum { } DRWTextureFlag; struct GPUTexture *DRW_texture_create_1D( - int w, DRWTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, DRWTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_2D( - int w, int h, DRWTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, int h, DRWTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_2D_array( - int w, int h, int d, DRWTextureFormat UNUSED(format), DRWTextureFlag flags, const float *fpixels); + int w, int h, int d, DRWTextureFormat UNUSED(format), DRWTextureFlag flags, const float *fpixels); void DRW_texture_free(struct GPUTexture *tex); /* UBOs */ @@ -231,4 +231,4 @@ void *DRW_mode_pass_list_get(void); void *DRW_mode_storage_list_get(void); void *DRW_mode_texture_list_get(void); void *DRW_mode_framebuffer_list_get(void); -#endif /* __DRW_RENDER_H__ */
\ No newline at end of file +#endif /* __DRW_RENDER_H__ */ diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 8f30f8936d0..4f9b4926fb6 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -37,7 +37,7 @@ #include "draw_cache.h" -static struct DRWShapeCache{ +static struct DRWShapeCache { Batch *drw_single_vertice; Batch *drw_fullscreen_quad; Batch *drw_plain_axes; @@ -201,8 +201,8 @@ static VertexBuffer *sphere_wire_vbo(const float rad) for (int j = 0; j < 2; ++j) { float cv[2], v[3]; - cv[0] = p[(i+j) % NSEGMENTS][0]; - cv[1] = p[(i+j) % NSEGMENTS][1]; + cv[0] = p[(i + j) % NSEGMENTS][0]; + cv[1] = p[(i + j) % NSEGMENTS][1]; if (axis == 0) v[0] = cv[0], v[1] = cv[1], v[2] = 0.0f; @@ -211,7 +211,7 @@ static VertexBuffer *sphere_wire_vbo(const float rad) else v[0] = 0.0f, v[1] = cv[0], v[2] = cv[1]; - setAttrib(vbo, pos_id, i*2 + j + (NSEGMENTS * 2 * axis), v); + setAttrib(vbo, pos_id, i * 2 + j + (NSEGMENTS * 2 * axis), v); } } } @@ -268,7 +268,7 @@ Batch *DRW_cache_cube_get(void) { 1.0f, 1.0f, 1.0f} }; - const GLubyte indices[24] = {0,1,1,3,3,2,2,0,0,4,4,5,5,7,7,6,6,4,1,5,3,7,2,6}; + const GLubyte indices[24] = {0, 1, 1, 3, 3, 2, 2, 0, 0, 4, 4, 5, 5, 7, 7, 6, 6, 4, 1, 5, 3, 7, 2, 6}; /* Position Only 3D format */ static VertexFormat format = { 0 }; @@ -460,17 +460,17 @@ Batch *DRW_cache_empty_cone_get(void) /* cone sides */ v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1]; - setAttrib(vbo, pos_id, i*4, v); + setAttrib(vbo, pos_id, i * 4, v); v[0] = 0.0f, v[1] = 2.0f, v[2] = 0.0f; - setAttrib(vbo, pos_id, i*4 + 1, v); + setAttrib(vbo, pos_id, i * 4 + 1, v); /* end ring */ v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1]; - setAttrib(vbo, pos_id, i*4 + 2, v); - cv[0] = p[(i+1) % NSEGMENTS][0]; - cv[1] = p[(i+1) % NSEGMENTS][1]; + setAttrib(vbo, pos_id, i * 4 + 2, v); + cv[0] = p[(i + 1) % NSEGMENTS][0]; + cv[1] = p[(i + 1) % NSEGMENTS][1]; v[0] = cv[0], v[1] = 0.0f, v[2] = cv[1]; - setAttrib(vbo, pos_id, i*4 + 3, v); + setAttrib(vbo, pos_id, i * 4 + 3, v); } SHC.drw_empty_cone = Batch_create(GL_LINES, vbo, NULL); @@ -768,10 +768,10 @@ Batch *DRW_cache_bone_octahedral_wire_outline_get(void) VertexBuffer_allocate_data(vbo, 12 * 2); for (int i = 0; i < 12; i++) { - const float *co1 = bone_octahedral_verts[bone_octahedral_wire[i*2]]; - const float *co2 = bone_octahedral_verts[bone_octahedral_wire[i*2+1]]; - const float *n1 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i*2]]; - const float *n2 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i*2+1]]; + const float *co1 = bone_octahedral_verts[bone_octahedral_wire[i * 2]]; + const float *co2 = bone_octahedral_verts[bone_octahedral_wire[i * 2 + 1]]; + const float *n1 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i * 2]]; + const float *n2 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i * 2 + 1]]; add_fancy_edge(vbo, pos_id, n1_id, n2_id, &v_idx, co1, co2, n1, n2); } @@ -799,22 +799,22 @@ Batch *DRW_cache_bone_point_get(void) /* Vertices */ VertexBuffer *vbo = VertexBuffer_create_with_format(&format); - VertexBuffer_allocate_data(vbo, (lat_res-1) * lon_res * 6); + VertexBuffer_allocate_data(vbo, (lat_res - 1) * lon_res * 6); float lon = 0.0f; - for(int i = 0; i < lon_res; i++, lon += lon_inc) { + for (int i = 0; i < lon_res; i++, lon += lon_inc) { float lat = 0.0f; - for(int j = 0; j < lat_res; j++, lat += lat_inc) { + for (int j = 0; j < lat_res; j++, lat += lat_inc) { if (j != lat_res - 1) { /* Pole */ - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat+lat_inc, lon+lon_inc); - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat+lat_inc, lon); - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat + lat_inc, lon + lon_inc); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat + lat_inc, lon); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon); } if (j != 0) { /* Pole */ - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon+lon_inc); - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat+lat_inc, lon+lon_inc); - add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon + lon_inc); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat + lat_inc, lon + lon_inc); + add_lat_lon_vert(vbo, pos_id, nor_id, &v_idx, rad, lat, lon); } } } @@ -910,4 +910,4 @@ struct Batch *DRW_cache_surface_material_get(Object *ob, int nr) { /* TODO */ return NULL; } -#endif
\ No newline at end of file +#endif diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index ccd3198de4f..f481965678c 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -19,7 +19,7 @@ * */ -/** \file blender/draw/draw_manager.c +/** \file blender/draw/intern/draw_manager.c * \ingroup draw */ @@ -160,7 +160,7 @@ enum { }; /* Render State */ -static struct DRWGlobalState{ +static struct DRWGlobalState { GPUShader *shader; struct GPUFrameBuffer *default_framebuffer; FramebufferList *fbl, *fbl_mode; @@ -680,8 +680,10 @@ static void shgroup_dynamic_instance(DRWShadingGroup *shgroup) static void shgroup_dynamic_batch_from_calls(DRWShadingGroup *shgroup) { if ((shgroup->interface->instance_vbo || shgroup->batch_geom) && - (G.debug_value == 667)) + (G.debug_value == 667)) + { return; + } if (shgroup->type == DRW_SHG_INSTANCE) { shgroup_dynamic_instance(shgroup); @@ -924,7 +926,8 @@ static void set_state(short flag) /* Backface Culling */ if (flag & DRW_STATE_CULL_BACK || - flag & DRW_STATE_CULL_FRONT) { + flag & DRW_STATE_CULL_FRONT) + { glEnable(GL_CULL_FACE); @@ -939,7 +942,8 @@ static void set_state(short flag) /* Depht Test */ if (flag & DRW_STATE_DEPTH_LESS || - flag & DRW_STATE_DEPTH_EQUAL) { + flag & DRW_STATE_DEPTH_EQUAL) + { glEnable(GL_DEPTH_TEST); @@ -1187,14 +1191,14 @@ void DRW_framebuffer_init(struct GPUFrameBuffer **fb, int width, int height, DRW int color_attachment = -1; *fb = GPU_framebuffer_create(); - for (int i = 0; i < texnbr; ++i) - { + for (int i = 0; i < texnbr; ++i) { DRWFboTexture fbotex = textures[i]; if (!*fbotex.tex) { /* TODO refine to opengl formats */ if (fbotex.format == DRW_BUF_DEPTH_16 || - fbotex.format == DRW_BUF_DEPTH_24) { + fbotex.format == DRW_BUF_DEPTH_24) + { *fbotex.tex = GPU_texture_create_depth(width, height, NULL); GPU_texture_compare_mode(*fbotex.tex, false); GPU_texture_filter_mode(*fbotex.tex, false); diff --git a/source/blender/draw/intern/draw_mode_pass.c b/source/blender/draw/intern/draw_mode_pass.c index 9e71de01070..043ac9573a3 100644 --- a/source/blender/draw/intern/draw_mode_pass.c +++ b/source/blender/draw/intern/draw_mode_pass.c @@ -19,7 +19,7 @@ * */ -/** \file blender/draw/draw_mode_pass.c +/** \file blender/draw/intern/draw_mode_pass.c * \ingroup draw */ diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 9d8699d24ee..f3865a7a92f 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -19,7 +19,7 @@ * */ -/** \file blender/draw/draw_view.c +/** \file blender/draw/intern/draw_view.c * \ingroup draw * * Contains dynamic drawing using immediate mode @@ -65,7 +65,7 @@ void DRW_draw_region_info(void) /* ************************* Grid ************************** */ -static void gridline_range(double x0, double dx, double max, int* first_out, int* count_out) +static void gridline_range(double x0, double dx, double max, int *r_first, int *r_count) { /* determine range of gridlines that appear in this Area -- similar calc but separate ranges for x & y * x0 is gridline 0, the axis in screen space @@ -75,12 +75,12 @@ static void gridline_range(double x0, double dx, double max, int* first_out, int int last = (int)floor((max - x0) / dx); if (first <= last) { - *first_out = first; - *count_out = last - first + 1; + *r_first = first; + *r_count = last - first + 1; } else { - *first_out = 0; - *count_out = 0; + *r_first = 0; + *r_count = 0; } } @@ -198,9 +198,9 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** glDepthMask(GL_FALSE); /* disable write in zbuffer */ #endif - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); @@ -273,7 +273,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** } } else { - if (dx >(GRID_MIN_PX_D * 10.0)) { /* start blending in */ + if (dx > (GRID_MIN_PX_D * 10.0)) { /* start blending in */ rv3d->gridview /= sublines_fl; dx /= sublines; if (dx > (GRID_MIN_PX_D * 10.0)) { /* start blending in */ @@ -364,9 +364,9 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3]; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); @@ -452,9 +452,9 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) if (show_axis_x || show_axis_y || show_axis_z) { /* draw axis lines -- sometimes grid floor is off, other times we still need to draw the Z axis */ - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); immBegin(GL_LINES, (show_axis_x + show_axis_y + show_axis_z) * 2); @@ -636,10 +636,10 @@ void DRW_draw_cursor(void) const float f10 = 0.5f; const float f20 = 1.0f; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); - unsigned wpos = add_attrib(format, "world_pos", COMP_F32, 3, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + unsigned int wpos = add_attrib(format, "world_pos", COMP_F32, 3, KEEP_FLOAT); /* XXX Using instance shader without instance */ immBindBuiltinProgram(GPU_SHADER_3D_SCREENSPACE_VARIYING_COLOR); diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c index 016c392e515..e55a368c9be 100644 --- a/source/blender/draw/modes/edit_armature_mode.c +++ b/source/blender/draw/modes/edit_armature_mode.c @@ -33,7 +33,7 @@ #include "edit_armature_mode.h" /* keep it under MAX_PASSES */ -typedef struct EDIT_ARMATURE_PassList{ +typedef struct EDIT_ARMATURE_PassList { struct DRWPass *non_meshes_pass; struct DRWPass *ob_center_pass; struct DRWPass *wire_outline_pass; diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index ec19a466a13..d2299158e44 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -31,7 +31,7 @@ #include "edit_mesh_mode.h" /* keep it under MAX_PASSES */ -typedef struct EDIT_MESH_PassList{ +typedef struct EDIT_MESH_PassList { struct DRWPass *non_meshes_pass; struct DRWPass *ob_center_pass; struct DRWPass *wire_outline_pass; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 811d1928336..e9fec871528 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -31,7 +31,7 @@ #include "object_mode.h" /* keep it under MAX_PASSES */ -typedef struct OBJECT_PassList{ +typedef struct OBJECT_PassList { struct DRWPass *non_meshes_pass; struct DRWPass *ob_center_pass; struct DRWPass *wire_outline_pass; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 7d87527bdad..d6dcd0208f4 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1051,9 +1051,9 @@ static void icon_draw_texture( glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, -0.5f); glBindTexture(GL_TEXTURE_2D, icongltex.id); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned texCoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int texCoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); if (rgb) immUniformColor3fvAlpha(rgb, alpha); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 6356ce1574c..ab6d14dd0e6 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2351,9 +2351,9 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * ui_color_picker_to_rgb(0.0f, 0.0f, hsv[2], colcent, colcent + 1, colcent + 2); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index bcac8d0b825..5c2d4cafd84 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1468,9 +1468,9 @@ void UI_view2d_constant_grid_draw(View2D *v2d) count_y = (v2d->cur.ymax - start_y) / step + 1; if (count_x > 0 || count_y > 0) { - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); float theme_color[3]; UI_GetThemeColorShade3fv(TH_BACK, -10, theme_color); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cc47667772d..46864f6c549 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -92,9 +92,9 @@ static void region_draw_emboss(const ARegion *ar, const rcti *scirct) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GL_LINE_STRIP, 5); @@ -222,9 +222,9 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); immAttrib4ub(color, 255, 0, 0, alpha_debug); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); @@ -255,9 +255,9 @@ static void area_draw_azone(short x1, short y1, short x2, short y2) glEnable(GL_LINE_SMOOTH); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - unsigned col = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int col = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GL_LINES, 12); @@ -297,8 +297,8 @@ static void region_draw_azone_icon(AZone *az) float midx = az->x1 + (az->x2 - az->x1) * 0.5f; float midy = az->y1 + (az->y2 - az->y1) * 0.5f; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); /* outlined circle */ GPU_enable_program_point_size(); /* TODO: make a fixed-size shader to avoid this */ @@ -330,8 +330,8 @@ static void draw_azone_plus(float x1, float y1, float x2, float y2) float width = 0.1f * U.widget_unit; float pad = 0.2f * U.widget_unit; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); glEnable(GL_BLEND); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -570,8 +570,8 @@ void ED_region_do_draw(bContext *C, ARegion *ar) /* for debugging unneeded area redraws and partial redraw */ #if 0 glEnable(GL_BLEND); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, @@ -2014,8 +2014,8 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c /* view should be in pixelspace */ UI_view2d_view_restore(C); glEnable(GL_BLEND); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor((ar->type->regionid == RGN_TYPE_PREVIEW) ? TH_PREVIEW_BACK : TH_BACK); immRecti(pos, 0, 0, BLI_rcti_size_x(&ar->winrct), BLI_rcti_size_y(&ar->winrct) + 1); @@ -2148,8 +2148,8 @@ void ED_region_info_draw(ARegion *ar, const char *text, float fill_color[4], con glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(fill_color); immRecti(pos, rect.xmin, rect.ymin, rect.xmax + 1, rect.ymax + 1); @@ -2355,8 +2355,8 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, /* set up rect */ BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y); /* draw top box */ - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2380,8 +2380,8 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, /* set up box rect */ BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin); /* draw top box */ - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2409,8 +2409,8 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x1, &y1); UI_view2d_view_to_region(&ar->v2d, 1.0f, 1.0f, &x2, &y2); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, 20); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 6bfa51bf9fc..5a8ea10cb0a 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -456,8 +456,8 @@ static void screencast_draw_cursor(bContext *UNUSED(C), int x, int y, void *UNUS glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index ffaaed8ab42..9850b2c93f0 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -722,8 +722,8 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index f2707b9399f..4c65207d9a0 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -204,8 +204,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* first backdrop strips */ y = (float)(-ACHANNEL_HEIGHT(ac)); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index c45b8acae0a..8055e262611 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -158,8 +158,8 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha int offl = 0, offc = 0; int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN}; int pen[2]; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); xy[1] += tvc->lheight / 6; console_cursor_wrap_offset(sc->prompt, tvc->console_width, &offl, &offc, NULL); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 06066372828..dff32a5f0d5 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -400,8 +400,8 @@ static void file_draw_preview( /* border */ if (use_dropshadow) { - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2,KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2,KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); @@ -481,9 +481,9 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) unsigned int vertex_ct = 0; unsigned char col_hi[3], col_lo[3]; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); - unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); + unsigned int color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT); vertex_ct = (v2d->cur.xmax - v2d->tot.xmin) / step + 1; /* paint at least 1 divider */ vertex_ct *= 4; /* vertex_count = 2 points per divider * 2 lines per divider */ diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5940ed5f0c1..0b292e242f0 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2176,8 +2176,8 @@ static void node_composit_backdrop_viewer(SpaceNode *snode, ImBuf *backdrop, bNo const float cx = x + snode->zoom * backdropWidth * node->custom3; const float cy = y + snode->zoom * backdropHeight * node->custom4; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2221,8 +2221,8 @@ static void node_composit_backdrop_boxmask(SpaceNode *snode, ImBuf *backdrop, bN y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2265,8 +2265,8 @@ static void node_composit_backdrop_ellipsemask(SpaceNode *snode, ImBuf *backdrop y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 7ef968fb33a..5f3931a4a77 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -855,7 +855,7 @@ bool outliner_set_flag(ListBase *lb, short flag, short set) changed = true; } } - else if (!has_flag){ + else if (!has_flag) { tselem->flag |= flag; changed = true; } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 38b83179e7f..85b4c33c3f1 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -199,7 +199,7 @@ static eOLDrawState tree_element_set_active_object( } static eOLDrawState tree_element_active_material( - bContext *C, Scene* UNUSED(scene), SceneLayer *sl, SpaceOops *soops, + bContext *C, Scene *UNUSED(scene), SceneLayer *sl, SpaceOops *soops, TreeElement *te, const eOLSetState set) { TreeElement *tes; @@ -786,17 +786,17 @@ eOLDrawState tree_element_active(bContext *C, Scene *scene, SceneLayer *sl, Spac } break; case ID_MA: - return tree_element_active_material(C, scene, sl, soops, te, set); + return tree_element_active_material(C, scene, sl, soops, te, set); case ID_WO: - return tree_element_active_world(C, scene, sl, soops, te, set); + return tree_element_active_world(C, scene, sl, soops, te, set); case ID_LA: - return tree_element_active_lamp(C, scene, sl, soops, te, set); + return tree_element_active_lamp(C, scene, sl, soops, te, set); case ID_TE: - return tree_element_active_texture(C, scene, sl, soops, te, set); + return tree_element_active_texture(C, scene, sl, soops, te, set); case ID_TXT: - return tree_element_active_text(C, scene, sl, soops, te, set); + return tree_element_active_text(C, scene, sl, soops, te, set); case ID_CA: - return tree_element_active_camera(C, scene, sl, soops, te, set); + return tree_element_active_camera(C, scene, sl, soops, te, set); } return OL_DRAWSEL_NONE; } @@ -818,7 +818,7 @@ eOLDrawState tree_element_type_active( case TSE_EBONE: return tree_element_active_ebone(C, scene, te, tselem, set, recursive); case TSE_MODIFIER: - return tree_element_active_modifier(C, scene, sl, te, tselem, set); + return tree_element_active_modifier(C, scene, sl, te, tselem, set); case TSE_LINKED_OB: if (set != OL_SETSEL_NONE) { tree_element_set_active_object(C, scene, sl, soops, te, set, false); @@ -832,21 +832,21 @@ eOLDrawState tree_element_type_active( case TSE_POSE_BASE: return tree_element_active_pose(C, scene, sl, te, tselem, set); case TSE_POSE_CHANNEL: - return tree_element_active_posechannel(C, scene, sl, te, tselem, set, recursive); + return tree_element_active_posechannel(C, scene, sl, te, tselem, set, recursive); case TSE_CONSTRAINT: - return tree_element_active_constraint(C, scene, sl, te, tselem, set); + return tree_element_active_constraint(C, scene, sl, te, tselem, set); case TSE_R_LAYER: - return tree_element_active_renderlayer(C, scene, sl, te, tselem, set); + return tree_element_active_renderlayer(C, scene, sl, te, tselem, set); case TSE_POSEGRP: - return tree_element_active_posegroup(C, scene, sl, te, tselem, set); + return tree_element_active_posegroup(C, scene, sl, te, tselem, set); case TSE_SEQUENCE: return tree_element_active_sequence(C, scene, te, tselem, set); case TSE_SEQUENCE_DUP: return tree_element_active_sequence_dup(scene, te, tselem, set); case TSE_KEYMAP_ITEM: - return tree_element_active_keymap_item(C, scene, sl, te, tselem, set); + return tree_element_active_keymap_item(C, scene, sl, te, tselem, set); case TSE_GP_LAYER: - //return tree_element_active_gplayer(C, scene, s, te, tselem, set); + //return tree_element_active_gplayer(C, scene, s, te, tselem, set); break; case TSE_COLLECTION: return tree_element_active_collection(C, te, tselem, set); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 10d29436c74..320e38e82be 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -809,7 +809,7 @@ static void modifier_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem static void collection_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *Carg) { bContext *C = (bContext *)Carg; - Scene *scene= CTX_data_scene(C); + Scene *scene = CTX_data_scene(C); LayerCollection *lc = te->directdata; SceneCollection *sc = lc->scene_collection; diff --git a/source/blender/editors/space_view3d/drawsimdebug.c b/source/blender/editors/space_view3d/drawsimdebug.c index 2baa6304cd9..e47adbea657 100644 --- a/source/blender/editors/space_view3d/drawsimdebug.c +++ b/source/blender/editors/space_view3d/drawsimdebug.c @@ -49,9 +49,9 @@ static void draw_sim_debug_elements(SimDebugData *debug_data, float imat[4][4]) { - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 3, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 3, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fe4574f2fda..325c81a3fd2 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -308,7 +308,7 @@ static void view3d_draw_debug_store_depth(ARegion *UNUSED(ar), DrawData *draw_da if (GPU_viewport_debug_depth_is_valid(viewport)) { if ((GPU_viewport_debug_depth_width(viewport) != w) || - (GPU_viewport_debug_depth_height(viewport) != h)) + (GPU_viewport_debug_depth_height(viewport) != h)) { GPU_viewport_debug_depth_free(viewport); } @@ -344,7 +344,7 @@ static void view3d_draw_debug(const bContext *C, ARegion *ar, DrawData *draw_dat } if (((v3d->tmp_compat_flag & V3D_DEBUG_SHOW_SCENE_DEPTH) != 0) || - ((v3d->tmp_compat_flag & V3D_DEBUG_SHOW_COMBINED_DEPTH) != 0)) + ((v3d->tmp_compat_flag & V3D_DEBUG_SHOW_COMBINED_DEPTH) != 0)) { /* draw */ if (GPU_viewport_debug_depth_is_valid(draw_data->viewport)) { @@ -965,7 +965,7 @@ static void view3d_draw_outline_plates(const bContext *UNUSED(C)) #define DEBUG_GRID 0 -static void gridline_range(double x0, double dx, double max, int* first_out, int* count_out) +static void gridline_range(double x0, double dx, double max, int *r_first, int *r_count) { /* determine range of gridlines that appear in this Area -- similar calc but separate ranges for x & y * x0 is gridline 0, the axis in screen space @@ -975,12 +975,12 @@ static void gridline_range(double x0, double dx, double max, int* first_out, int int last = (int)floor((max - x0) / dx); if (first <= last) { - *first_out = first; - *count_out = last - first + 1; + *r_first = first; + *r_count = last - first + 1; } else { - *first_out = 0; - *count_out = 0; + *r_first = 0; + *r_count = 0; } #if DEBUG_GRID @@ -1125,9 +1125,9 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** glDepthMask(GL_FALSE); /* disable write in zbuffer */ #endif - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); @@ -1207,7 +1207,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** } } else { - if (dx >(GRID_MIN_PX_D * 10.0)) { /* start blending in */ + if (dx > (GRID_MIN_PX_D * 10.0)) { /* start blending in */ rv3d->gridview /= sublines_fl; dx /= sublines; if (dx > (GRID_MIN_PX_D * 10.0)) { /* start blending in */ @@ -1301,9 +1301,9 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3]; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); @@ -1389,9 +1389,9 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr if (show_axis_x || show_axis_y || show_axis_z) { /* draw axis lines -- sometimes grid floor is off, other times we still need to draw the Z axis */ - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); immBegin(GL_LINES, (show_axis_x + show_axis_y + show_axis_z) * 2); @@ -1547,9 +1547,9 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d) glLineWidth(1.0f); - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index c4d980ec7e9..84f0e296a1f 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -24,7 +24,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/editors/space_view3d/view3d_draw.c +/** \file blender/editors/space_view3d/view3d_draw_legacy.c * \ingroup spview3d */ diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index b42afd3a7a9..328e0b03bb8 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -259,8 +259,8 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), x2 = xoff + 0.55f * fly->width; y2 = yoff + 0.55f * fly->height; - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index d4e78035b84..8390d56c610 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -340,8 +340,8 @@ static void drawWalkPixel(const struct bContext *UNUSED(C), ARegion *ar, void *a yoff = walk->ar->winy / 2; } - VertexFormat* format = immVertexFormat(); - unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); + VertexFormat *format = immVertexFormat(); + unsigned int pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 996b07b72ff..32e7bb44375 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -332,7 +332,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe col[3] = 0.5f; /* hard coded alpha, not that nice */ - VertexFormat* format = immVertexFormat(); + VertexFormat *format = immVertexFormat(); unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); unsigned int color = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); @@ -902,7 +902,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, SceneLayer *sl, Object *obe int sel; UI_GetThemeColor4ubv(TH_EDGE_SELECT, col1); - VertexFormat* format = immVertexFormat(); + VertexFormat *format = immVertexFormat(); pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); unsigned int color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); @@ -989,7 +989,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, SceneLayer *sl, Object *obe float cent[2]; bool col_set = false; - VertexFormat* format = immVertexFormat(); + VertexFormat *format = immVertexFormat(); pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); unsigned int color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT); |