style cleanup: blenkernel
This commit is contained in:
@@ -2375,8 +2375,7 @@ float *mesh_get_mapped_verts_nors(Scene *scene, Object *ob)
|
||||
|
||||
/* ******************* GLSL ******************** */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
float *precomputedFaceNormals;
|
||||
MTFace *mtface; // texture coordinates
|
||||
MFace *mface; // indices
|
||||
|
@@ -459,7 +459,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
|
||||
}
|
||||
}
|
||||
|
||||
hlength1 = bone->ease1 * length * 0.390464f; /* 0.5*sqrt(2)*kappa, the handle length for near-perfect circles */
|
||||
hlength1 = bone->ease1 * length * 0.390464f; /* 0.5f * sqrt(2) * kappa, the handle length for near-perfect circles */
|
||||
hlength2 = bone->ease2 * length * 0.390464f;
|
||||
|
||||
/* evaluate next and prev bones */
|
||||
@@ -566,14 +566,10 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
|
||||
if (bone->segments > MAX_BBONE_SUBDIV)
|
||||
bone->segments = MAX_BBONE_SUBDIV;
|
||||
|
||||
BKE_curve_forward_diff_bezier(0.0, h1[0], h2[0], 0.0, data[0],
|
||||
MAX_BBONE_SUBDIV, 4*sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(0.0, h1[1], length + h2[1], length, data[0]+1,
|
||||
MAX_BBONE_SUBDIV, 4*sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(0.0, h1[2], h2[2], 0.0, data[0]+2,
|
||||
MAX_BBONE_SUBDIV, 4*sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(roll1, roll1 + 0.390464f*(roll2-roll1), roll2 - 0.390464f*(roll2-roll1), roll2, data[0]+3,
|
||||
MAX_BBONE_SUBDIV, 4*sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(0.0f, h1[0], h2[0], 0.0f, data[0], MAX_BBONE_SUBDIV, 4 * sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(0.0f, h1[1], length + h2[1], length, data[0] + 1, MAX_BBONE_SUBDIV, 4 * sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(0.0f, h1[2], h2[2], 0.0f, data[0] + 2, MAX_BBONE_SUBDIV, 4 * sizeof(float));
|
||||
BKE_curve_forward_diff_bezier(roll1, roll1 + 0.390464f * (roll2 - roll1), roll2 - 0.390464f * (roll2 - roll1), roll2, data[0] + 3, MAX_BBONE_SUBDIV, 4 * sizeof(float));
|
||||
|
||||
equalize_bezier(data[0], bone->segments); /* note: does stride 4! */
|
||||
|
||||
|
@@ -2385,7 +2385,7 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
|
||||
/* if we have a windowmanager, look into windows */
|
||||
for (win = wm->windows.first; win; win = win->next) {
|
||||
if (win->screen) {
|
||||
if (!*sce) *sce = win->screen->scene;
|
||||
if (*sce == NULL) *sce = win->screen->scene;
|
||||
*lay |= BKE_screen_visible_layers(win->screen, win->screen->scene);
|
||||
}
|
||||
}
|
||||
|
@@ -351,8 +351,7 @@ static void emDM_recalcTessellation(DerivedMesh *UNUSED(dm))
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
static void emDM_foreachMappedVert(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_foreachMappedVert(DerivedMesh *dm,
|
||||
void (*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]),
|
||||
void *userData)
|
||||
{
|
||||
@@ -372,8 +371,7 @@ static void emDM_foreachMappedVert(
|
||||
}
|
||||
}
|
||||
}
|
||||
static void emDM_foreachMappedEdge(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_foreachMappedEdge(DerivedMesh *dm,
|
||||
void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]),
|
||||
void *userData)
|
||||
{
|
||||
@@ -399,8 +397,7 @@ static void emDM_foreachMappedEdge(
|
||||
}
|
||||
}
|
||||
|
||||
static void emDM_drawMappedEdges(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedEdges(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData)
|
||||
{
|
||||
@@ -435,16 +432,14 @@ static void emDM_drawMappedEdges(
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
static void emDM_drawEdges(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawEdges(DerivedMesh *dm,
|
||||
int UNUSED(drawLooseEdges),
|
||||
int UNUSED(drawAllEdges))
|
||||
{
|
||||
emDM_drawMappedEdges(dm, NULL, NULL);
|
||||
}
|
||||
|
||||
static void emDM_drawMappedEdgesInterp(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedEdgesInterp(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetDrawInterpOptions setDrawInterpOptions,
|
||||
void *userData)
|
||||
@@ -552,8 +547,7 @@ static void emDM__calcFaceCent(BMesh *bm, BMFace *efa, float cent[3], float (*ve
|
||||
mul_v3_fl(cent, 1.0f / (float)tot);
|
||||
}
|
||||
|
||||
static void emDM_foreachMappedFaceCenter(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_foreachMappedFaceCenter(DerivedMesh *dm,
|
||||
void (*func)(void *userData, int index, const float co[3], const float no[3]),
|
||||
void *userData)
|
||||
{
|
||||
@@ -578,8 +572,7 @@ static void emDM_foreachMappedFaceCenter(
|
||||
}
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFaces(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedFaces(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetMaterial setMaterial,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
@@ -782,8 +775,7 @@ static void bmdm_get_tri_tex(BMesh *bm, BMLoop **ls, MLoopUV *luv[3], MLoopCol *
|
||||
|
||||
}
|
||||
|
||||
static void emDM_drawFacesTex_common(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawFacesTex_common(DerivedMesh *dm,
|
||||
DMSetDrawOptionsTex drawParams,
|
||||
DMSetDrawOptions drawParamsMapped,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
@@ -965,8 +957,7 @@ static void emDM_drawFacesTex_common(
|
||||
glShadeModel(GL_FLAT);
|
||||
}
|
||||
|
||||
static void emDM_drawFacesTex(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawFacesTex(DerivedMesh *dm,
|
||||
DMSetDrawOptionsTex setDrawOptions,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData)
|
||||
@@ -974,8 +965,7 @@ static void emDM_drawFacesTex(
|
||||
emDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFacesTex(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedFacesTex(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData)
|
||||
@@ -983,8 +973,7 @@ static void emDM_drawMappedFacesTex(
|
||||
emDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFacesGLSL(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
|
||||
DMSetMaterial setMaterial,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData)
|
||||
@@ -1103,15 +1092,13 @@ static void emDM_drawMappedFacesGLSL(
|
||||
#undef PASSATTRIB
|
||||
}
|
||||
|
||||
static void emDM_drawFacesGLSL(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawFacesGLSL(DerivedMesh *dm,
|
||||
int (*setMaterial)(int, void *attribs))
|
||||
{
|
||||
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
|
||||
}
|
||||
|
||||
static void emDM_drawMappedFacesMat(
|
||||
DerivedMesh *dm,
|
||||
static void emDM_drawMappedFacesMat(DerivedMesh *dm,
|
||||
void (*setMaterial)(void *userData, int, void *attribs),
|
||||
int (*setFace)(void *userData, int index), void *userData)
|
||||
{
|
||||
@@ -1620,8 +1607,7 @@ static CustomData *bmDm_getPolyDataLayout(DerivedMesh *dm)
|
||||
}
|
||||
|
||||
|
||||
DerivedMesh *getEditDerivedBMesh(
|
||||
BMEditMesh *em,
|
||||
DerivedMesh *getEditDerivedBMesh(BMEditMesh *em,
|
||||
Object *UNUSED(ob),
|
||||
float (*vertexCos)[3])
|
||||
{
|
||||
|
@@ -158,13 +158,11 @@ static float gaussRand (void)
|
||||
float y; // numbers, we make these variables singe-precision
|
||||
float length2; // floats, but later we call the double-precision log()
|
||||
// and sqrt() functions instead of logf() and sqrtf().
|
||||
do
|
||||
{
|
||||
do {
|
||||
x = (float) (nextfr(-1, 1));
|
||||
y = (float)(nextfr(-1, 1));
|
||||
length2 = x * x + y * y;
|
||||
}
|
||||
while (length2 >= 1 || length2 == 0);
|
||||
} while (length2 >= 1 || length2 == 0);
|
||||
|
||||
return x * sqrtf(-2.0f * logf(length2) / length2);
|
||||
}
|
||||
@@ -737,8 +735,7 @@ static void set_height_normalize_factor(struct Ocean *oc)
|
||||
oc->normalize_factor = res;
|
||||
}
|
||||
|
||||
struct Ocean *BKE_add_ocean(void)
|
||||
{
|
||||
struct Ocean *BKE_add_ocean(void){
|
||||
Ocean *oc = MEM_callocN(sizeof(Ocean), "ocean sim data");
|
||||
|
||||
BLI_rw_mutex_init(&oc->oceanmutex);
|
||||
@@ -1082,8 +1079,7 @@ void BKE_ocean_cache_eval_ij(struct OceanCache *och, struct OceanResult *ocr, in
|
||||
|
||||
struct OceanCache *BKE_init_ocean_cache(const char *bakepath, const char *relbase,
|
||||
int start, int end, float wave_scale,
|
||||
float chop_amount, float foam_coverage, float foam_fade, int resolution)
|
||||
{
|
||||
float chop_amount, float foam_coverage, float foam_fade, int resolution){
|
||||
OceanCache *och = MEM_callocN(sizeof(OceanCache), "ocean cache data");
|
||||
|
||||
och->bakepath = bakepath;
|
||||
@@ -1366,8 +1362,7 @@ void BKE_ocean_cache_eval_ij(struct OceanCache *UNUSED(och), struct OceanResult
|
||||
|
||||
struct OceanCache *BKE_init_ocean_cache(const char *UNUSED(bakepath), const char *UNUSED(relbase),
|
||||
int UNUSED(start), int UNUSED(end), float UNUSED(wave_scale),
|
||||
float UNUSED(chop_amount), float UNUSED(foam_coverage), float UNUSED(foam_fade), int UNUSED(resolution))
|
||||
{
|
||||
float UNUSED(chop_amount), float UNUSED(foam_coverage), float UNUSED(foam_fade), int UNUSED(resolution)){
|
||||
OceanCache *och = MEM_callocN(sizeof(OceanCache), "ocean cache data");
|
||||
|
||||
return och;
|
||||
|
Reference in New Issue
Block a user