code cleanup: minor style change & quiet warning, also add assert for BM_vert_splice() to check for invalid use.
This commit is contained in:
@@ -20,25 +20,24 @@
|
|||||||
#include "oslutil.h"
|
#include "oslutil.h"
|
||||||
|
|
||||||
shader node_rgb_ramp(
|
shader node_rgb_ramp(
|
||||||
color ramp_color[RAMP_TABLE_SIZE] = {0.0},
|
color ramp_color[RAMP_TABLE_SIZE] = {0.0},
|
||||||
float ramp_alpha[RAMP_TABLE_SIZE] = {0.0},
|
float ramp_alpha[RAMP_TABLE_SIZE] = {0.0},
|
||||||
|
|
||||||
float Fac = 0.0,
|
float Fac = 0.0,
|
||||||
output color Color = color(0.0, 0.0, 0.0),
|
output color Color = color(0.0, 0.0, 0.0),
|
||||||
output float Alpha = 1.0
|
output float Alpha = 1.0)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
float f = clamp(Fac, 0.0, 1.0) * (RAMP_TABLE_SIZE - 1);
|
float f = clamp(Fac, 0.0, 1.0) * (RAMP_TABLE_SIZE - 1);
|
||||||
|
|
||||||
int i = (int)f;
|
int i = (int)f;
|
||||||
float t = f - (float)i;
|
float t = f - (float)i;
|
||||||
|
|
||||||
Color = ramp_color[i];
|
Color = ramp_color[i];
|
||||||
Alpha = ramp_alpha[i];
|
Alpha = ramp_alpha[i];
|
||||||
|
|
||||||
if (t > 0.0) {
|
if (t > 0.0) {
|
||||||
Color = (1.0 - t) * Color + t * ramp_color[i + 1];
|
Color = (1.0 - t) * Color + t * ramp_color[i + 1];
|
||||||
Alpha = (1.0 - t) * Alpha + t * ramp_alpha[i + 1];
|
Alpha = (1.0 - t) * Alpha + t * ramp_alpha[i + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1607,10 +1607,10 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
|
|||||||
BMESH_ASSERT(edok != FALSE);
|
BMESH_ASSERT(edok != FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* deallocate edg */
|
/* deallocate edge */
|
||||||
bm_kill_only_edge(bm, ke);
|
bm_kill_only_edge(bm, ke);
|
||||||
|
|
||||||
/* deallocate verte */
|
/* deallocate vertex */
|
||||||
bm_kill_only_vert(bm, kv);
|
bm_kill_only_vert(bm, kv);
|
||||||
|
|
||||||
/* Validate disk cycle lengths of ov, tv are unchanged */
|
/* Validate disk cycle lengths of ov, tv are unchanged */
|
||||||
@@ -1619,7 +1619,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
|
|||||||
edok = bmesh_disk_validate(valence2, tv->e, tv);
|
edok = bmesh_disk_validate(valence2, tv->e, tv);
|
||||||
BMESH_ASSERT(edok != FALSE);
|
BMESH_ASSERT(edok != FALSE);
|
||||||
|
|
||||||
/* Validate loop cycle of all faces attached to oe */
|
/* Validate loop cycle of all faces attached to 'oe' */
|
||||||
for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) {
|
for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) {
|
||||||
BMESH_ASSERT(l->e == oe);
|
BMESH_ASSERT(l->e == oe);
|
||||||
edok = bmesh_verts_in_edge(l->v, l->next->v, oe);
|
edok = bmesh_verts_in_edge(l->v, l->next->v, oe);
|
||||||
@@ -1800,6 +1800,10 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
|
|||||||
* Merges two verts into one (\a v into \a vtarget).
|
* Merges two verts into one (\a v into \a vtarget).
|
||||||
*
|
*
|
||||||
* \return Success
|
* \return Success
|
||||||
|
*
|
||||||
|
* \warning This does't work for collapsing edges,
|
||||||
|
* where \a v and \a vtarget are connected by an edge
|
||||||
|
* (assert checks for this case).
|
||||||
*/
|
*/
|
||||||
int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
|
int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
|
||||||
{
|
{
|
||||||
@@ -1827,6 +1831,7 @@ int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
|
|||||||
bmesh_disk_edge_remove(e, v);
|
bmesh_disk_edge_remove(e, v);
|
||||||
bmesh_edge_swapverts(e, v, vtarget);
|
bmesh_edge_swapverts(e, v, vtarget);
|
||||||
bmesh_disk_edge_append(e, vtarget);
|
bmesh_disk_edge_append(e, vtarget);
|
||||||
|
BLI_assert(e->v1 != e->v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
BM_CHECK_ELEMENT(v);
|
BM_CHECK_ELEMENT(v);
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ static void deformVerts(ModifierData *md, Object *ob,
|
|||||||
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
|
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
|
||||||
ParticleSystem *psys = NULL;
|
ParticleSystem *psys = NULL;
|
||||||
int needsFree = 0;
|
int needsFree = 0;
|
||||||
float cfra = BKE_scene_frame_get(md->scene);
|
/* float cfra = BKE_scene_frame_get(md->scene); */ /* UNUSED */
|
||||||
|
|
||||||
if (ob->particlesystem.first)
|
if (ob->particlesystem.first)
|
||||||
psys = psmd->psys;
|
psys = psmd->psys;
|
||||||
|
|||||||
Reference in New Issue
Block a user