Cleanup: only use "r_" prefix for return arguments

This commit is contained in:
Campbell Barton
2025-09-14 23:03:01 +10:00
parent d1b76b6554
commit 62d791c8d6
5 changed files with 18 additions and 18 deletions

View File

@@ -342,7 +342,7 @@ bool psys_render_simplify_params(struct ParticleSystem *psys,
struct ChildParticle *cpa,
float *params);
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2]);
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float r_uv[2]);
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc);
void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time);

View File

@@ -1723,7 +1723,7 @@ void psys_interpolate_face(Mesh *mesh,
}
}
}
void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float uvco[2])
void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float r_uv[2])
{
float v10 = tface->uv[0][0];
float v11 = tface->uv[0][1];
@@ -1737,12 +1737,12 @@ void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float
v40 = tface->uv[3][0];
v41 = tface->uv[3][1];
uvco[0] = w[0] * v10 + w[1] * v20 + w[2] * v30 + w[3] * v40;
uvco[1] = w[0] * v11 + w[1] * v21 + w[2] * v31 + w[3] * v41;
r_uv[0] = w[0] * v10 + w[1] * v20 + w[2] * v30 + w[3] * v40;
r_uv[1] = w[0] * v11 + w[1] * v21 + w[2] * v31 + w[3] * v41;
}
else {
uvco[0] = w[0] * v10 + w[1] * v20 + w[2] * v30;
uvco[1] = w[0] * v11 + w[1] * v21 + w[2] * v31;
r_uv[0] = w[0] * v10 + w[1] * v20 + w[2] * v30;
r_uv[1] = w[0] * v11 + w[1] * v21 + w[2] * v31;
}
}

View File

@@ -162,10 +162,10 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context,
MTFace *tface = mtface + num;
if (mface) {
float r_uv[2], mapfw[4], vec[3];
float uv[2], mapfw[4], vec[3];
psys_interpolate_uvs(tface, face->v4, pa->fuv, r_uv);
uv_values.emplace_back(r_uv[0], r_uv[1]);
psys_interpolate_uvs(tface, face->v4, pa->fuv, uv);
uv_values.emplace_back(uv[0], uv[1]);
psys_interpolate_face(mesh,
reinterpret_cast<const float(*)[3]>(positions.data()),
@@ -280,10 +280,10 @@ void ABCHairWriter::write_hair_child_sample(const HierarchyContext &context,
const MFace *face = &mface[num];
MTFace *tface = mtface + num;
float r_uv[2], tmpnor[3], mapfw[4], vec[3];
float uv[2], tmpnor[3], mapfw[4], vec[3];
psys_interpolate_uvs(tface, face->v4, pc->fuv, r_uv);
uv_values.emplace_back(r_uv[0], r_uv[1]);
psys_interpolate_uvs(tface, face->v4, pc->fuv, uv);
uv_values.emplace_back(uv[0], uv[1]);
psys_interpolate_face(mesh,
reinterpret_cast<const float(*)[3]>(positions.data()),

View File

@@ -265,7 +265,7 @@ void HairData::write_curves()
ParticleSystemModifierData *psmd = psys_get_modifier(object, particle_system_);
int num = ELEM(pa.num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND) ? pa.num : pa.num_dmcache;
float r_uv[2] = {0.0f, 0.0f};
float uv[2] = {0.0f, 0.0f};
if (ELEM(psmd->psys->part->from, PART_FROM_FACE, PART_FROM_VOLUME) &&
!ELEM(num, DMCACHE_NOTFOUND, DMCACHE_ISCHILD))
{
@@ -276,10 +276,10 @@ void HairData::write_curves()
if (mface && mtface) {
mtface += num;
psys_interpolate_uvs(mtface, mface->v4, pa.fuv, r_uv);
psys_interpolate_uvs(mtface, mface->v4, pa.fuv, uv);
}
}
uvs_.push_back(pxr::GfVec2f(r_uv[0], r_uv[1]));
uvs_.push_back(pxr::GfVec2f(uv[0], uv[1]));
}
}
}

View File

@@ -229,7 +229,7 @@ PyDoc_STRVAR(
static PyObject *py_blf_dimensions(PyObject * /*self*/, PyObject *args)
{
const char *text;
float r_width, r_height;
float width, height;
PyObject *ret;
int fontid;
@@ -237,10 +237,10 @@ static PyObject *py_blf_dimensions(PyObject * /*self*/, PyObject *args)
return nullptr;
}
BLF_width_and_height(fontid, text, INT_MAX, &r_width, &r_height);
BLF_width_and_height(fontid, text, INT_MAX, &width, &height);
ret = PyTuple_New(2);
PyTuple_SET_ITEMS(ret, PyFloat_FromDouble(r_width), PyFloat_FromDouble(r_height));
PyTuple_SET_ITEMS(ret, PyFloat_FromDouble(width), PyFloat_FromDouble(height));
return ret;
}