code cleanup: use const float and define array size

This commit is contained in:
Campbell Barton 2012-05-26 22:21:56 +00:00
parent eda0f3b186
commit 54b64cfd61
18 changed files with 99 additions and 82 deletions

@ -734,7 +734,7 @@ static void pchan_deform_mat_add(bPoseChannel *pchan, float weight, float bbonem
}
static float dist_bone_deform(bPoseChannel *pchan, bPoseChanDeform *pdef_info, float vec[3], DualQuat *dq,
float mat[][3], float *co)
float mat[][3], const float co[3])
{
Bone *bone = pchan->bone;
float fac, contrib = 0.0;
@ -781,7 +781,7 @@ static float dist_bone_deform(bPoseChannel *pchan, bPoseChanDeform *pdef_info, f
}
static void pchan_bone_deform(bPoseChannel *pchan, bPoseChanDeform *pdef_info, float weight, float vec[3], DualQuat *dq,
float mat[][3], float *co, float *contrib)
float mat[][3], const float co[3], float *contrib)
{
float cop[3], bbonemat[3][3];
DualQuat bbonedq;

@ -83,8 +83,6 @@
#endif
typedef void (*Shrinkwrap_ForeachVertexCallback)(DerivedMesh *target, float *co, float *normal);
/* get derived mesh */
//TODO is anyfunction that does this? returning the derivedFinal without we caring if its in edit mode or not?
DerivedMesh *object_get_derived_final(Object *ob)
@ -109,23 +107,23 @@ void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float
invert_m4_m4(data->target2local, data->local2target);
}
void space_transform_apply(const SpaceTransform *data, float *co)
void space_transform_apply(const SpaceTransform *data, float co[3])
{
mul_v3_m4v3(co, ((SpaceTransform *)data)->local2target, co);
}
void space_transform_invert(const SpaceTransform *data, float *co)
void space_transform_invert(const SpaceTransform *data, float co[3])
{
mul_v3_m4v3(co, ((SpaceTransform *)data)->target2local, co);
}
static void space_transform_apply_normal(const SpaceTransform *data, float *no)
static void space_transform_apply_normal(const SpaceTransform *data, float no[3])
{
mul_mat3_m4_v3(((SpaceTransform *)data)->local2target, no);
normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
}
static void space_transform_invert_normal(const SpaceTransform *data, float *no)
static void space_transform_invert_normal(const SpaceTransform *data, float no[3])
{
mul_mat3_m4_v3(((SpaceTransform *)data)->target2local, no);
normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
@ -211,7 +209,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
* MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
* MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored)
*/
int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
int normal_projection_project_vertex(char options, const float vert[3], const float dir[3], const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
{
float tmp_co[3], tmp_no[3];
const float *co, *no;

@ -50,17 +50,17 @@ KDTree *BLI_kdtree_new(int maxsize);
void BLI_kdtree_free(KDTree *tree);
/* Construction: first insert points, then call balance. Normal is optional. */
void BLI_kdtree_insert(KDTree *tree, int index, float *co, float *nor);
void BLI_kdtree_insert(KDTree *tree, int index, const float co[3], const float nor[3]);
void BLI_kdtree_balance(KDTree *tree);
/* Find nearest returns index, and -1 if no node is found.
* Find n nearest returns number of points found, with results in nearest.
* Normal is optional, but if given will limit results to points in normal direction from co. */
int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *nearest);
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest);
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, const float co[3], const float nor[3], KDTreeNearest *nearest);
/* Range search returns number of points found, with results in nearest */
/* Normal is optional, but if given will limit results to points in normal direction from co. */
/* Remember to free nearest after use! */
int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest);
int BLI_kdtree_range_search(KDTree *tree, float range, const float co[3], const float nor[3], KDTreeNearest **nearest);
#endif

@ -73,7 +73,7 @@ void BLI_kdtree_free(KDTree *tree)
}
}
void BLI_kdtree_insert(KDTree *tree, int index, float *co, float *nor)
void BLI_kdtree_insert(KDTree *tree, int index, const float co[3], const float nor[3])
{
KDTreeNode *node = &tree->nodes[tree->totnode++];
@ -132,7 +132,7 @@ void BLI_kdtree_balance(KDTree *tree)
tree->root = kdtree_balance(tree->nodes, tree->totnode, 0);
}
static float squared_distance(const float v2[3], const float v1[3], float *UNUSED(n1), float *n2)
static float squared_distance(const float v2[3], const float v1[3], const float *UNUSED(n1), const float *n2)
{
float d[3], dist;
@ -258,7 +258,7 @@ static void add_nearest(KDTreeNearest *ptn, int *found, int n, int index, float
}
/* finds the nearest n entries in tree to specified coordinates */
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest)
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, const float co[3], const float nor[3], KDTreeNearest *nearest)
{
KDTreeNode *root, *node = NULL;
KDTreeNode **stack, *defaultstack[100];
@ -373,7 +373,7 @@ static void add_in_range(KDTreeNearest **ptn, int found, int *totfoundstack, int
to->dist = sqrt(dist);
copy_v3_v3(to->co, co);
}
int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest)
int BLI_kdtree_range_search(KDTree *tree, float range, const float co[3], const float nor[3], KDTreeNearest **nearest)
{
KDTreeNode *root, *node = NULL;
KDTreeNode **stack, *defaultstack[100];

@ -42,7 +42,7 @@ int nextAdaptativeSubdivision(struct ToolSettings *toolsettings, struct BArcIter
struct EditBone *subdivideArcBy(struct ToolSettings *toolsettings, struct bArmature *arm, ListBase *editbones, struct BArcIterator *iter, float invmat[][4], float tmat[][3], NextSubdivisionFunc next_subdividion);
void setBoneRollFromNormal(struct EditBone *bone, float *no, float invmat[][4], float tmat[][3]);
void setBoneRollFromNormal(struct EditBone *bone, const float no[3], float invmat[][4], float tmat[][3]);
#endif /* __BIF_GENERATE_H__ */

@ -50,7 +50,7 @@
#include "armature_intern.h"
#include "BIF_generate.h"
void setBoneRollFromNormal(EditBone *bone, float *no, float UNUSED(invmat[][4]), float tmat[][3])
void setBoneRollFromNormal(EditBone *bone, const float no[3], float UNUSED(invmat[][4]), float tmat[][3])
{
if (no != NULL && !is_zero_v3(no)) {
float normal[3];

@ -120,18 +120,19 @@ void ED_object_toggle_modes(struct bContext *C, int mode);
void ED_object_exit_editmode(struct bContext *C, int flag);
void ED_object_enter_editmode(struct bContext *C, int flag);
void ED_object_location_from_view(struct bContext *C, float *loc);
void ED_object_rotation_from_view(struct bContext *C, float *rot);
void ED_object_base_init_transform(struct bContext *C, struct Base *base, float *loc, float *rot);
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, float *loc, float *rot, float primmat[][4]);
void ED_object_location_from_view(struct bContext *C, float loc[3]);
void ED_object_rotation_from_view(struct bContext *C, float rot[3]);
void ED_object_base_init_transform(struct bContext *C, struct Base *base, const float loc[3], const float rot[3]);
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob,
const float loc[3], const float rot[3], float primmat[][4]);
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op,
float *loc, float *rot, int *enter_editmode, unsigned int *layer, int *is_view_aligned);
int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float loc[3], float rot[3],
int *enter_editmode, unsigned int *layer, int *is_view_aligned);
struct Object *ED_object_add_type(struct bContext *C, int type, float *loc,
float *rot, int enter_editmode, unsigned int layer);
struct Object *ED_object_add_type(struct bContext *C, int type, const float loc[3], const float rot[3],
int enter_editmode, unsigned int layer);
void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full);
void ED_object_single_user(struct Scene *scene, struct Object *ob);
@ -165,13 +166,17 @@ enum {
MODIFIER_APPLY_SHAPE
};
struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type);
int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
struct Object *ob, const char *name, int type);
int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
struct Object *ob, struct ModifierData *md);
void ED_object_modifier_clear(struct Main *bmain, struct Scene *scene, struct Object *ob);
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md, int mode);
int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
struct Object *ob, struct ModifierData *md);
int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene,
struct Object *ob, struct ModifierData *md, int mode);
int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
#ifdef __cplusplus

@ -55,7 +55,7 @@
/* uses context to figure out transform for primitive */
/* returns standard diameter */
static float new_primitive_matrix(bContext *C, float *loc, float *rot, float primmat[][4])
static float new_primitive_matrix(bContext *C, const float loc[3], const float rot[3], float primmat[][4])
{
Object *obedit = CTX_data_edit_object(C);
View3D *v3d = CTX_wm_view3d(C);
@ -85,7 +85,7 @@ static float new_primitive_matrix(bContext *C, float *loc, float *rot, float pri
static void make_prim_init(bContext *C, const char *idname,
float *dia, float mat[][4],
int *state, float *loc, float *rot, unsigned int layer)
int *state, const float loc[3], const float rot[3], const unsigned int layer)
{
Object *obedit = CTX_data_edit_object(C);

@ -120,7 +120,7 @@ EnumPropertyItem lamp_type_items[] = {
/************************** Exported *****************************/
void ED_object_location_from_view(bContext *C, float *loc)
void ED_object_location_from_view(bContext *C, float loc[3])
{
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
@ -131,7 +131,7 @@ void ED_object_location_from_view(bContext *C, float *loc)
copy_v3_v3(loc, cursor);
}
void ED_object_rotation_from_view(bContext *C, float *rot)
void ED_object_rotation_from_view(bContext *C, float rot[3])
{
RegionView3D *rv3d = CTX_wm_region_view3d(C);
if (rv3d) {
@ -145,7 +145,7 @@ void ED_object_rotation_from_view(bContext *C, float *rot)
}
}
void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *rot)
void ED_object_base_init_transform(bContext *C, Base *base, const float loc[3], const float rot[3])
{
Object *ob = base->object;
Scene *scene = CTX_data_scene(C);
@ -163,7 +163,8 @@ void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *r
/* uses context to figure out transform for primitive */
/* returns standard diameter */
float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, float *rot, float primmat[][4])
float ED_object_new_primitive_matrix(bContext *C, Object *obedit,
const float loc[3], const float rot[3], float primmat[][4])
{
View3D *v3d = CTX_wm_view3d(C);
float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3];
@ -260,8 +261,8 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
return op->type->exec(C, op);
}
int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
float *rot, int *enter_editmode, unsigned int *layer, int *is_view_aligned)
int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], float rot[3],
int *enter_editmode, unsigned int *layer, int *is_view_aligned)
{
View3D *v3d = CTX_wm_view3d(C);
int a, layer_values[20];
@ -324,7 +325,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
/* for object add primitive operators */
/* do not call undo push in this function (users of this function have to) */
Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot,
Object *ED_object_add_type(bContext *C, int type, const float loc[3], const float rot[3],
int enter_editmode, unsigned int layer)
{
Main *bmain = CTX_data_main(C);

@ -328,21 +328,15 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax))
{
MovieTrackingTrack *track = channel->track;
uiBut *but;
const int icon = (track->flag & TRACK_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
PointerRNA ptr;
int icon;
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, &ptr);
if (track->flag & TRACK_LOCKED)
icon = ICON_LOCKED;
else
icon = ICON_UNLOCKED;
uiBlockSetEmboss(block, UI_EMBOSSN);
but = uiDefIconButR(block, ICONTOG, 1, icon,
v2d->cur.xmax - UI_UNIT_X - CHANNEL_PAD, y - UI_UNIT_Y / 2.0f,
UI_UNIT_X, UI_UNIT_Y, &ptr, "lock", 0, 0, 0, 0, 0, NULL);
uiDefIconButR(block, ICONTOG, 1, icon,
v2d->cur.xmax - UI_UNIT_X - CHANNEL_PAD, y - UI_UNIT_Y / 2.0f,
UI_UNIT_X, UI_UNIT_Y, &ptr, "lock", 0, 0, 0, 0, 0, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}

@ -5393,7 +5393,7 @@ typedef struct TransDataTracking {
} TransDataTracking;
static void markerToTransDataInit(TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track,
int area, float *loc, float *rel, float *off)
int area, float loc[2], float rel[2], const float off[2])
{
int anchor = area == TRACK_AREA_POINT && off;

@ -97,8 +97,13 @@ struct VlakRen *RE_findOrAddVlak(struct ObjectRen *obr, int nr);
struct VertRen *RE_findOrAddVert(struct ObjectRen *obr, int nr);
struct StrandRen *RE_findOrAddStrand(struct ObjectRen *obr, int nr);
struct HaloRen *RE_findOrAddHalo(struct ObjectRen *obr, int nr);
struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Material *ma, float *vec, float *vec1, float *orco, float hasize, float vectsize, int seed);
struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed, float *pa_co);
struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Material *ma,
const float vec[3], const float vec1[3],
const float *orco, float hasize, float vectsize, int seed);
struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma,
const float vec[3], const float vec1[3],
const float *orco, const float *uvco, float hasize, float vectsize, int seed,
const float pa_co[3]);
struct StrandBuffer *RE_addStrandBuffer(struct ObjectRen *obr, int totvert);
struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struct Object *par, int index, int psysindex, int lay);

@ -91,7 +91,7 @@ typedef struct ZSpan {
int rectx, recty; /* range for clipping */
int miny1, maxy1, miny2, maxy2; /* actual filled in range */
float *minp1, *maxp1, *minp2, *maxp2; /* vertex pointers detect min/max range in */
const float *minp1, *maxp1, *minp2, *maxp2; /* vertex pointers detect min/max range in */
float *span1, *span2;
float zmulx, zmuly, zofsx, zofsy; /* transform from hoco to zbuf co */
@ -115,23 +115,26 @@ typedef struct ZSpan {
void *sss_handle; /* used by sss */
void (*sss_func)(void *, int, int, int, int, int);
void (*zbuffunc)(struct ZSpan *, int, int, float *, float *, float *, float *);
void (*zbuflinefunc)(struct ZSpan *, int, int, float *, float *);
void (*zbuffunc)(struct ZSpan *, int, int, const float *, const float *, const float *, const float *);
void (*zbuflinefunc)(struct ZSpan *, int, int, const float *, const float *);
} ZSpan;
/* exported to shadbuf.c */
void zbufclip4(struct ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, float *f4, int c1, int c2, int c3, int c4);
void zbufclip4(struct ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, float *f4,
int c1, int c2, int c3, int c4);
void zbuf_free_span(struct ZSpan *zspan);
void freepsA(struct ListBase *lb);
/* to rendercore.c */
void zspan_scanconvert(struct ZSpan *zpan, void *handle, float *v1, float *v2, float *v3, void (*func)(void *, int, int, float, float) );
void zspan_scanconvert(struct ZSpan *zpan, void *handle, float *v1, float *v2, float *v3,
void (*func)(void *, int, int, float, float) );
/* exported to edge render... */
void zbufclip(struct ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, int c1, int c2, int c3);
void zbuf_alloc_span(struct ZSpan *zspan, int rectx, int recty, float clipcrop);
void zbufclipwire(struct ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *ho2, float *ho3, float *ho4, int c1, int c2, int c3, int c4);
void zbufclipwire(struct ZSpan *zspan, int obi, int zvlnr, int ec,
float *ho1, float *ho2, float *ho3, float *ho4, int c1, int c2, int c3, int c4);
/* exported to shadeinput.c */
void zbuf_make_winmat(Render *re, float winmat[][4]);

@ -130,7 +130,7 @@
/* ------------------------------------------------------------------------- */
/* this is a bad beast, since it is misused by the 3d view drawing as well. */
static HaloRen *initstar(Render *re, ObjectRen *obr, float *vec, float hasize)
static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float hasize)
{
HaloRen *har;
float hoco[4];
@ -1324,7 +1324,8 @@ static void static_particle_wire(ObjectRen *obr, Material *ma, const float vec[3
}
static void particle_curve(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, ParticleStrandData *sd, float *loc, float *loc1, int seed, float *pa_co)
static void particle_curve(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, ParticleStrandData *sd,
const float loc[3], const float loc1[3], int seed, float *pa_co)
{
HaloRen *har=0;

@ -586,7 +586,7 @@ void make_envmaps(Render *re)
/* ------------------------------------------------------------------------- */
static int envcube_isect(EnvMap *env, float *vec, float *answ)
static int envcube_isect(EnvMap *env, const float vec[3], float answ[2])
{
float labda;
int face;

@ -444,16 +444,16 @@ VlakRen *RE_vlakren_copy(ObjectRen *obr, VlakRen *vlr)
return vlr1;
}
void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen *vlr, float *nor)
void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen *vlr, float r_nor[3])
{
float (*nmat)[3]= obi->nmat;
if (obi->flag & R_TRANSFORMED) {
mul_v3_m3v3(nor, nmat, vlr->n);
normalize_v3(nor);
mul_v3_m3v3(r_nor, nmat, vlr->n);
normalize_v3(r_nor);
}
else {
copy_v3_v3(nor, vlr->n);
copy_v3_v3(r_nor, vlr->n);
}
}
@ -931,8 +931,9 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
/* ------------------------------------------------------------------------- */
HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, float *vec1,
float *orco, float hasize, float vectsize, int seed)
HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma,
const float vec[3], const float vec1[3],
const float *orco, float hasize, float vectsize, int seed)
{
HaloRen *har;
MTex *mtex;
@ -1044,8 +1045,9 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
return har;
}
HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, float *vec, float *vec1,
float *orco, float *uvco, float hasize, float vectsize, int seed, float *pa_co)
HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma,
const float vec[3], const float vec1[3],
const float *orco, const float *uvco, float hasize, float vectsize, int seed, const float pa_co[3])
{
HaloRen *har;
MTex *mtex;

@ -1449,7 +1449,7 @@ typedef struct ISBBranch {
typedef struct BSPFace {
Boxf box;
float *v1, *v2, *v3, *v4;
const float *v1, *v2, *v3, *v4;
int obi; /* object for face lookup */
int facenr; /* index to retrieve VlakRen */
int type; /* only for strand now */
@ -1868,7 +1868,8 @@ static void isb_bsp_recalc_box(ISBBranch *root)
}
/* callback function for zbuf clip */
static void isb_bsp_test_strand(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void isb_bsp_test_strand(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
BSPFace face;
@ -1902,7 +1903,8 @@ static void isb_bsp_test_strand(ZSpan *zspan, int obi, int zvlnr, float *v1, flo
}
/* callback function for zbuf clip */
static void isb_bsp_test_face(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void isb_bsp_test_face(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
BSPFace face;

@ -116,9 +116,10 @@ static void zbuf_init_span(ZSpan *zspan)
zspan->minp1= zspan->maxp1= zspan->minp2= zspan->maxp2= NULL;
}
static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
static void zbuf_add_to_span(ZSpan *zspan, const float *v1, const float *v2)
{
float *minv, *maxv, *span;
const float *minv, *maxv;
float *span;
float xx1, dx0, xs0;
int y, my0, my2;
@ -301,7 +302,8 @@ static APixstr *addpsA(ZSpan *zspan)
return zspan->curpstr;
}
static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
APixstr *ap, *apofs, *apn;
double zxd, zyd, zy0, zverg;
@ -427,7 +429,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, const float vec1[3], const float vec2[3])
{
APixstr *ap, *apn;
int *rectz, *rectmask;
@ -584,7 +586,7 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
/* ************* NORMAL ZBUFFER ************ */
static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
static void zbufline(ZSpan *zspan, int obi, int zvlnr, const float vec1[3], const float vec2[3])
{
int *rectz, *rectp, *recto, *rectmask;
int start, end, x, y, oldx, oldy, ofs;
@ -714,7 +716,7 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
}
}
static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), float *vec1, float *vec2)
static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), const float vec1[3], const float vec2[3])
{
int *rectz, *rectz1= NULL;
int start, end, x, y, oldx, oldy, ofs;
@ -1039,7 +1041,8 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const
/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines,
* commented below */
static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
@ -1161,7 +1164,8 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines,
* commented below */
static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
@ -1291,7 +1295,8 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
*/
/* now: filling two Z values, the closest and 2nd closest */
static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), float *v1, float *v2, float *v3, float *v4)
static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr),
const float *v1, const float *v2, const float *v3, const float *v4)
{
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
@ -2445,7 +2450,8 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
zbuf_free_span(&zspan);
}
static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr,
const float *v1, const float *v2, const float *v3, const float *v4)
{
double zxd, zyd, zy0, z;
float x0, y0, x1, y1, x2, y2, z0, z1, z2, xx1, *span1, *span2;