forked from bartvdbraak/blender
cleanup: style
This commit is contained in:
parent
e40387b1e2
commit
6d78936c43
@ -1175,7 +1175,7 @@ void BKE_sim_debug_data_clear_category(const char *category)
|
||||
if (_sim_debug_data->gh) {
|
||||
GHashIterator iter;
|
||||
BLI_ghashIterator_init(&iter, _sim_debug_data->gh);
|
||||
while(!BLI_ghashIterator_done(&iter)) {
|
||||
while (!BLI_ghashIterator_done(&iter)) {
|
||||
SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
|
||||
BLI_ghashIterator_step(&iter); /* removing invalidates the current iterator, so step before removing */
|
||||
|
||||
|
@ -373,7 +373,7 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
|
||||
bool ok = false;
|
||||
int track;
|
||||
|
||||
#pragma omp parallel for if(context->num_tracks > 1)
|
||||
#pragma omp parallel for if (context->num_tracks > 1)
|
||||
for (track = 0; track < context->num_tracks; ++track) {
|
||||
AutoTrackOptions *options = &context->options[track];
|
||||
libmv_Marker libmv_current_marker,
|
||||
|
@ -4549,7 +4549,7 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
steeringa->target = newlibadr(fd, ob->id.lib, steeringa->target);
|
||||
steeringa->navmesh = newlibadr(fd, ob->id.lib, steeringa->navmesh);
|
||||
}
|
||||
else if(act->type == ACT_MOUSE) {
|
||||
else if (act->type == ACT_MOUSE) {
|
||||
/* bMouseActuator *moa= act->data; */
|
||||
}
|
||||
}
|
||||
|
@ -479,11 +479,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
|
||||
for (ob = main->object.first; ob; ob = ob->id.next) {
|
||||
for (md = ob->modifiers.first; md; md = md->next) {
|
||||
if (md->type == eModifierType_Cloth) {
|
||||
ClothModifierData *clmd = (ClothModifierData*) md;
|
||||
ClothModifierData *clmd = (ClothModifierData *)md;
|
||||
clmd->sim_parms->bending_damping = 0.5f;
|
||||
}
|
||||
else if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystemModifierData *pmd = (ParticleSystemModifierData*) md;
|
||||
ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md;
|
||||
if (pmd->psys->clmd) {
|
||||
pmd->psys->clmd->sim_parms->bending_damping = 0.5f;
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
|
||||
std::set<Image *>::iterator uv_t_iter;
|
||||
int idx;
|
||||
for (idx = 0, uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++, idx++ ) {
|
||||
if(active_uv_layer>-1 && idx==active_uv_layer) {
|
||||
if (active_uv_layer>-1 && idx==active_uv_layer) {
|
||||
Image *ima = *uv_t_iter;
|
||||
std::string key(id_name(ima));
|
||||
key = translate_id(key);
|
||||
|
@ -227,8 +227,7 @@ void MeshImporter::set_vcol(MLoopCol *mlc, VCOLDataWrapper &vob, int loop_index,
|
||||
{
|
||||
COLLADAFW::UIntValuesArray& indices =index_list.getIndices();
|
||||
int index;
|
||||
for(index = 0; index < count; index++,mlc++)
|
||||
{
|
||||
for (index = 0; index < count; index++, mlc++) {
|
||||
int v_index = indices[index+loop_index];
|
||||
vob.get_vcol(v_index,mlc);
|
||||
}
|
||||
@ -708,8 +707,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
|
||||
mpoly->flag |= ME_SMOOTH;
|
||||
}
|
||||
|
||||
for(unsigned int vcolor_index = 0 ; vcolor_index < index_list_array_vcolor.getCount();vcolor_index++)
|
||||
{
|
||||
for (unsigned int vcolor_index = 0 ; vcolor_index < index_list_array_vcolor.getCount();vcolor_index++) {
|
||||
COLLADAFW::IndexList& index_list = *index_list_array_vcolor[vcolor_index];
|
||||
COLLADAFW::String colname = extract_vcolname(index_list.getName());
|
||||
MLoopCol *mloopcol = (MLoopCol *)CustomData_get_layer_named(&me->ldata, CD_MLOOPCOL, colname.c_str());
|
||||
|
@ -27,15 +27,16 @@
|
||||
using std::min;
|
||||
using std::max;
|
||||
|
||||
static unsigned int determine_num_channels(DataType datatype) {
|
||||
static unsigned int determine_num_channels(DataType datatype)
|
||||
{
|
||||
switch (datatype) {
|
||||
case COM_DT_VALUE:
|
||||
return COM_NUM_CHANNELS_VALUE;
|
||||
case COM_DT_VECTOR:
|
||||
return COM_NUM_CHANNELS_VECTOR;
|
||||
case COM_DT_COLOR:
|
||||
default:
|
||||
return COM_NUM_CHANNELS_COLOR;
|
||||
case COM_DT_VALUE:
|
||||
return COM_NUM_CHANNELS_VALUE;
|
||||
case COM_DT_VECTOR:
|
||||
return COM_NUM_CHANNELS_VECTOR;
|
||||
case COM_DT_COLOR:
|
||||
default:
|
||||
return COM_NUM_CHANNELS_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,7 +227,7 @@ static void read_ewa_pixel_sampled(void *userdata, int x, int y, float result[4]
|
||||
|
||||
void MemoryBuffer::readEWA(float *result, const float uv[2], const float derivatives[2][2], PixelSampler sampler)
|
||||
{
|
||||
BLI_assert(this->m_datatype==COM_DT_COLOR);
|
||||
BLI_assert(this->m_datatype == COM_DT_COLOR);
|
||||
ReadEWAData data;
|
||||
data.buffer = this;
|
||||
data.sampler = sampler;
|
||||
|
@ -215,7 +215,7 @@ public:
|
||||
bool clip_y = (extend_y == COM_MB_CLIP && (y < m_rect.ymin || y >= m_rect.ymax));
|
||||
if (clip_x || clip_y) {
|
||||
/* clip result outside rect is zero */
|
||||
memset(result, 0, this->m_num_channels*sizeof(float));
|
||||
memset(result, 0, this->m_num_channels * sizeof(float));
|
||||
}
|
||||
else {
|
||||
int u = x;
|
||||
@ -223,7 +223,7 @@ public:
|
||||
this->wrap_pixel(u, v, extend_x, extend_y);
|
||||
const int offset = (this->m_width * y + x) * this->m_num_channels;
|
||||
float* buffer = &this->m_buffer[offset];
|
||||
memcpy(result, buffer, sizeof(float)*this->m_num_channels);
|
||||
memcpy(result, buffer, sizeof(float) * this->m_num_channels);
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,14 +240,14 @@ public:
|
||||
BLI_assert(offset >= 0);
|
||||
BLI_assert(offset < this->determineBufferSize() * this->m_num_channels);
|
||||
BLI_assert(!(extend_x == COM_MB_CLIP && (u < m_rect.xmin || u >= m_rect.xmax)) &&
|
||||
!(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax)));
|
||||
!(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax)));
|
||||
#if 0
|
||||
/* always true */
|
||||
BLI_assert((int)(MEM_allocN_len(this->m_buffer) / sizeof(*this->m_buffer)) ==
|
||||
(int)(this->determineBufferSize() * COM_NUMBER_OF_CHANNELS));
|
||||
#endif
|
||||
float* buffer = &this->m_buffer[offset];
|
||||
memcpy(result, buffer, sizeof(float)*this->m_num_channels);
|
||||
float *buffer = &this->m_buffer[offset];
|
||||
memcpy(result, buffer, sizeof(float) * this->m_num_channels);
|
||||
}
|
||||
|
||||
void writePixel(int x, int y, const float color[4]);
|
||||
|
@ -90,9 +90,11 @@ const cl_image_format* OpenCLDevice::determineImageFormat(MemoryBuffer *memoryBu
|
||||
int num_channels = memoryBuffer->get_num_channels();
|
||||
if (num_channels == 1) {
|
||||
imageFormat = &IMAGE_FORMAT_VALUE;
|
||||
} else if (num_channels == 3) {
|
||||
}
|
||||
else if (num_channels == 3) {
|
||||
imageFormat = &IMAGE_FORMAT_VECTOR;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
imageFormat = &IMAGE_FORMAT_COLOR;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
* @brief determine an image format
|
||||
* @param memorybuffer
|
||||
*/
|
||||
static const cl_image_format* determineImageFormat(MemoryBuffer *memoryBuffer);
|
||||
static const cl_image_format *determineImageFormat(MemoryBuffer *memoryBuffer);
|
||||
|
||||
cl_context getContext() { return this->m_context; }
|
||||
|
||||
|
@ -72,7 +72,7 @@ void DilateErodeThresholdOperation::executePixel(float output[4], int x, int y,
|
||||
const float inset = this->m_inset;
|
||||
float mindist = rd * 2;
|
||||
|
||||
MemoryBuffer *inputBuffer = (MemoryBuffer*)data;
|
||||
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
||||
float *buffer = inputBuffer->getBuffer();
|
||||
rcti *rect = inputBuffer->getRect();
|
||||
const int minx = max(x - this->m_scope, rect->xmin);
|
||||
|
@ -83,8 +83,8 @@ float *InpaintSimpleOperation::get_pixel(int x, int y)
|
||||
ASSERT_XY_RANGE(x, y);
|
||||
|
||||
return &this->m_cached_buffer[
|
||||
y * width * COM_NUM_CHANNELS_COLOR +
|
||||
x * COM_NUM_CHANNELS_COLOR];
|
||||
y * width * COM_NUM_CHANNELS_COLOR +
|
||||
x * COM_NUM_CHANNELS_COLOR];
|
||||
}
|
||||
|
||||
int InpaintSimpleOperation::mdist(int x, int y)
|
||||
|
@ -60,18 +60,17 @@ void ReadBufferOperation::executePixelSampled(float output[4], float x, float y,
|
||||
}
|
||||
else {
|
||||
switch (sampler) {
|
||||
case COM_PS_NEAREST:
|
||||
m_buffer->read(output, x, y);
|
||||
break;
|
||||
case COM_PS_BILINEAR:
|
||||
default:
|
||||
m_buffer->readBilinear(output, x, y);
|
||||
break;
|
||||
case COM_PS_BICUBIC:
|
||||
m_buffer->readBilinear(output, x, y);
|
||||
break;
|
||||
case COM_PS_NEAREST:
|
||||
m_buffer->read(output, x, y);
|
||||
break;
|
||||
case COM_PS_BILINEAR:
|
||||
default:
|
||||
m_buffer->readBilinear(output, x, y);
|
||||
break;
|
||||
case COM_PS_BICUBIC:
|
||||
m_buffer->readBilinear(output, x, y);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,8 @@ void RenderLayersBaseProg::executePixelSampled(float output[4], float x, float y
|
||||
}
|
||||
else if (elemsize == 3) {
|
||||
zero_v3(output);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
BLI_assert(elemsize == 4);
|
||||
zero_v4(output);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ static void joined_armature_fix_animdata_cb(ID *id, AnimData *adt, void *user_da
|
||||
/* only remap if changed; this still means there will be some waste if there aren't many drivers/keys */
|
||||
if (strcmp(old_name, new_name) && strstr(fcu->rna_path, old_name)) {
|
||||
fcu->rna_path = BKE_animsys_fix_rna_path_rename(id, fcu->rna_path, "pose.bones",
|
||||
old_name, new_name, 0, 0, false);
|
||||
old_name, new_name, 0, 0, false);
|
||||
|
||||
/* we don't want to apply a second remapping on this driver now,
|
||||
* so stop trying names, but keep fixing drivers
|
||||
@ -193,7 +193,7 @@ static void joined_armature_fix_animdata_cb(ID *id, AnimData *adt, void *user_da
|
||||
if ((dtar->rna_path) && strstr(dtar->rna_path, old_name)) {
|
||||
/* Fix up path */
|
||||
dtar->rna_path = BKE_animsys_fix_rna_path_rename(id, dtar->rna_path, "pose.bones",
|
||||
old_name, new_name, 0, 0, false);
|
||||
old_name, new_name, 0, 0, false);
|
||||
break; /* no need to try any more names for bone path */
|
||||
}
|
||||
else if (strcmp(dtar->pchan_name, old_name) == 0) {
|
||||
|
@ -135,7 +135,7 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, rctf *input, c
|
||||
bool GPU_select_load_id(unsigned int id)
|
||||
{
|
||||
/* if no selection mode active, ignore */
|
||||
if(!g_query_state.select_is_active)
|
||||
if (!g_query_state.select_is_active)
|
||||
return true;
|
||||
|
||||
if (!g_query_state.use_gpu_select) {
|
||||
@ -191,7 +191,7 @@ unsigned int GPU_select_end(void)
|
||||
glGetQueryObjectuivARB(g_query_state.queries[i], GL_QUERY_RESULT_ARB, &result);
|
||||
if (result > 0) {
|
||||
if (g_query_state.mode != GPU_SELECT_NEAREST_SECOND_PASS) {
|
||||
if(hits < g_query_state.bufsize) {
|
||||
if (hits < g_query_state.bufsize) {
|
||||
g_query_state.buffer[hits * 4] = 1;
|
||||
g_query_state.buffer[hits * 4 + 1] = 0xFFFF;
|
||||
g_query_state.buffer[hits * 4 + 2] = 0xFFFF;
|
||||
|
@ -611,7 +611,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
|
||||
render_layer_add_pass(rr, rl, 3, SCE_PASS_SUBSURFACE_COLOR);
|
||||
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
if(BKE_scene_use_new_shading_nodes(re->scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(re->scene)) {
|
||||
render_layer_add_debug_pass(rr, rl, 1, SCE_PASS_DEBUG,
|
||||
RENDER_PASS_DEBUG_BVH_TRAVERSAL_STEPS);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user