Cleanup: warnings & style
This commit is contained in:
parent
a1d7f67d81
commit
05dbc470ad
|
@ -399,7 +399,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree(
|
|||
for (i = 0; i < numVerts; i++) {
|
||||
if (BLI_BITMAP_TEST_BOOL(mask, i)) {
|
||||
if (em != NULL) {
|
||||
if (index_array){
|
||||
if (index_array) {
|
||||
index = index_array[i];
|
||||
if (index == ORIGINDEX_NONE) {
|
||||
continue;
|
||||
|
@ -432,7 +432,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree(
|
|||
continue;
|
||||
}
|
||||
if (em != NULL) {
|
||||
if (index_array){
|
||||
if (index_array) {
|
||||
index = index_array[i];
|
||||
if (index == ORIGINDEX_NONE) {
|
||||
continue;
|
||||
|
|
|
@ -188,7 +188,7 @@ static void mesh_calc_normals_poly_accum_task_cb(void *userdata, const int pidx)
|
|||
MeshCalcNormalsData *data = userdata;
|
||||
const MPoly *mp = &data->mpolys[pidx];
|
||||
const MLoop *ml = &data->mloop[mp->loopstart];
|
||||
const MVert *mverts = data->mverts;
|
||||
const MVert *mverts = data->mverts;
|
||||
|
||||
float pnor_temp[3];
|
||||
float *pnor = data->pnors ? data->pnors[pidx] : pnor_temp;
|
||||
|
|
|
@ -1015,7 +1015,8 @@ static void pbvh_update_normals_store_task_cb(void *userdata, const int n)
|
|||
MVert *mvert = &bvh->verts[v];
|
||||
|
||||
/* mvert is shared between nodes, hence between threads. */
|
||||
if (atomic_fetch_and_and_uint8((uint8_t *)&mvert->flag, (uint8_t)~ME_VERT_PBVH_UPDATE) & ME_VERT_PBVH_UPDATE)
|
||||
if (atomic_fetch_and_and_uint8(
|
||||
(uint8_t *)&mvert->flag, (uint8_t)~ME_VERT_PBVH_UPDATE) & ME_VERT_PBVH_UPDATE)
|
||||
{
|
||||
normalize_v3(vnors[v]);
|
||||
normal_float_to_short_v3(mvert->no, vnors[v]);
|
||||
|
@ -1056,7 +1057,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
|
|||
|
||||
PBVHUpdateData data = {
|
||||
.bvh = bvh, .nodes = nodes,
|
||||
.fnors = fnors, .vnors = vnors,
|
||||
.fnors = fnors, .vnors = vnors,
|
||||
};
|
||||
|
||||
BLI_task_parallel_range(0, totnode, &data, pbvh_update_normals_accum_task_cb, totnode > PBVH_THREADED_LIMIT);
|
||||
|
@ -1090,7 +1091,7 @@ void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag)
|
|||
/* update BB, redraw flag */
|
||||
PBVHUpdateData data = {
|
||||
.bvh = bvh, .nodes = nodes,
|
||||
.flag = flag,
|
||||
.flag = flag,
|
||||
};
|
||||
|
||||
BLI_task_parallel_range(0, totnode, &data, pbvh_update_BB_redraw_task_cb, totnode > PBVH_THREADED_LIMIT);
|
||||
|
|
|
@ -486,7 +486,7 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
|
|||
/* Could happen when trying to get reference marker for the fist
|
||||
* one on the segment which isn't surrounded by disabled markers.
|
||||
*
|
||||
* There's no really good choise here, just use the reference
|
||||
* There's no really good choice here, just use the reference
|
||||
* marker which looks correct..
|
||||
*/
|
||||
if (marker_keyed_fallback == NULL) {
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
} (void)0
|
||||
|
||||
/**
|
||||
* _AVERAGED variants do same thing as their basic counterpart, but additionnally add elapsed time to an averaged
|
||||
* _AVERAGED variants do same thing as their basic counterpart, but additionally add elapsed time to an averaged
|
||||
* static value, useful to get sensible timing of code running fast and often.
|
||||
*/
|
||||
#define TIMEIT_START_AVERAGED(var) \
|
||||
|
|
|
@ -4819,7 +4819,7 @@ static void sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
|
|||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
const Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
|
||||
/* XXX Cancelling strokes that way does not work with dynamic topology, user will have to do real undo for now.
|
||||
/* XXX Canceling strokes that way does not work with dynamic topology, user will have to do real undo for now.
|
||||
* See T46456. */
|
||||
if (ss->cache && !sculpt_stroke_is_dynamic_topology(ss, brush)) {
|
||||
paint_mesh_restore_co(sd, ob);
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#include "clip_intern.h" // own include
|
||||
#include "tracking_ops_intern.h" /* own include */
|
||||
#include "clip_intern.h" /* own include */
|
||||
|
||||
static float dist_to_crns(float co[2], float pos[2], float crns[4][2]);
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ GPUTexture *GPU_texture_create_2D_multisample(
|
|||
int w, int h, const float *pixels, GPUHDRType hdr, int samples, char err_out[256]);
|
||||
GPUTexture *GPU_texture_create_depth_multisample(int w, int h, int samples, char err_out[256]);
|
||||
GPUTexture *GPU_texture_from_blender(
|
||||
struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
|
||||
struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
|
||||
GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
|
||||
void GPU_invalid_tex_init(void);
|
||||
void GPU_invalid_tex_bind(int mode);
|
||||
|
|
|
@ -226,8 +226,8 @@ static bool is_power_of_2_resolution(int w, int h)
|
|||
|
||||
static bool is_over_resolution_limit(GLenum textarget, int w, int h)
|
||||
{
|
||||
int size = (textarget == GL_TEXTURE_2D)?
|
||||
GPU_max_texture_size() : GPU_max_cube_map_size();
|
||||
int size = (textarget == GL_TEXTURE_2D) ?
|
||||
GPU_max_texture_size() : GPU_max_cube_map_size();
|
||||
int reslimit = (U.glreslimit != 0) ?
|
||||
min_ii(U.glreslimit, size) : size;
|
||||
|
||||
|
@ -237,8 +237,8 @@ static bool is_over_resolution_limit(GLenum textarget, int w, int h)
|
|||
static int smaller_power_of_2_limit(int num)
|
||||
{
|
||||
int reslimit = (U.glreslimit != 0) ?
|
||||
min_ii(U.glreslimit, GPU_max_texture_size()) :
|
||||
GPU_max_texture_size();
|
||||
min_ii(U.glreslimit, GPU_max_texture_size()) :
|
||||
GPU_max_texture_size();
|
||||
/* take texture clamping into account */
|
||||
if (num > reslimit)
|
||||
return reslimit;
|
||||
|
@ -744,7 +744,7 @@ static void **gpu_gen_cube_map(unsigned int *rect, float *frect, int rectw, int
|
|||
return sides;
|
||||
|
||||
/* PosX, NegX, PosY, NegY, PosZ, NegZ */
|
||||
sides = MEM_mallocN(sizeof(void*) * 6, "");
|
||||
sides = MEM_mallocN(sizeof(void *) * 6, "");
|
||||
for (int i = 0; i < 6; i++)
|
||||
sides[i] = MEM_mallocN(block_size * w * h, "");
|
||||
|
||||
|
@ -813,8 +813,8 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int
|
|||
* GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures
|
||||
* Then don't bother scaling for hardware that supports NPOT textures! */
|
||||
if (textarget == GL_TEXTURE_2D &&
|
||||
(!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth) ||
|
||||
is_over_resolution_limit(textarget, rectw, recth)))
|
||||
((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth)) ||
|
||||
is_over_resolution_limit(textarget, rectw, recth)))
|
||||
{
|
||||
rectw = smaller_power_of_2_limit(rectw);
|
||||
recth = smaller_power_of_2_limit(recth);
|
||||
|
@ -918,8 +918,9 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int
|
|||
|
||||
for (int i = 1; i < ibuf->miptot; i++) {
|
||||
ImBuf *mip = ibuf->mipmap[i - 1];
|
||||
void **mip_cube_map = gpu_gen_cube_map(mip->rect, mip->rect_float,
|
||||
mip->x, mip->y, use_high_bit_depth);
|
||||
void **mip_cube_map = gpu_gen_cube_map(
|
||||
mip->rect, mip->rect_float,
|
||||
mip->x, mip->y, use_high_bit_depth);
|
||||
int mipw = mip->x / 3, miph = mip->y / 2;
|
||||
|
||||
if (mip_cube_map) {
|
||||
|
@ -1157,7 +1158,7 @@ void GPU_paint_set_mipmap(bool mipmap)
|
|||
static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h)
|
||||
{
|
||||
if ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) ||
|
||||
is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y))
|
||||
is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y))
|
||||
{
|
||||
int x_limit = smaller_power_of_2_limit(ibuf->x);
|
||||
int y_limit = smaller_power_of_2_limit(ibuf->y);
|
||||
|
|
|
@ -1924,16 +1924,17 @@ static void do_world_tex(GPUShadeInput *shi, struct World *wo, GPUNodeLink **hor
|
|||
if (mtex->mapto & WOMAP_ZENUP) {
|
||||
if (mtex->mapto & WOMAP_ZENDOWN) {
|
||||
GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac),
|
||||
GPU_uniform(&mtex->zendownfac), &zenfac);
|
||||
GPU_uniform(&mtex->zendownfac), &zenfac);
|
||||
}
|
||||
else {
|
||||
GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac),
|
||||
GPU_uniform(&zero), &zenfac);
|
||||
GPU_uniform(&zero), &zenfac);
|
||||
}
|
||||
}
|
||||
else if (mtex->mapto & WOMAP_ZENDOWN)
|
||||
else if (mtex->mapto & WOMAP_ZENDOWN) {
|
||||
GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&zero),
|
||||
GPU_uniform(&mtex->zendownfac), &zenfac);
|
||||
GPU_uniform(&mtex->zendownfac), &zenfac);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (mtex->mapto & WOMAP_ZENUP)
|
||||
|
|
Loading…
Reference in New Issue