Cleanup: style, spelling

This commit is contained in:
2016-07-19 08:39:38 +10:00
parent 5234e9ddd3
commit bd59206b5c
9 changed files with 92 additions and 53 deletions

View File

@@ -86,7 +86,7 @@ void ccg_ehashIterator_next(EHashIterator *ehi);
int ccg_ehashIterator_isStopped(EHashIterator *ehi);
/**
* Standard allocator implementarion.
* Standard allocator implementation.
*/
CCGAllocatorIFC *ccg_getStandardAllocatorIFC(void);

View File

@@ -1266,7 +1266,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB:
//break;
/* fall-through */
case SCOPES_WAVEFRM_RGB_PARADE:
ycc_mode = -1;
break;

View File

@@ -1083,39 +1083,48 @@ int BKE_image_imtype_to_ftype(const char imtype, ImbFormatOptions *r_options)
{
memset(r_options, 0, sizeof(*r_options));
if (imtype == R_IMF_IMTYPE_TARGA)
if (imtype == R_IMF_IMTYPE_TARGA) {
return IMB_FTYPE_TGA;
}
else if (imtype == R_IMF_IMTYPE_RAWTGA) {
r_options->flag = RAWTGA;
return IMB_FTYPE_TGA;
}
else if (imtype == R_IMF_IMTYPE_IRIS)
else if (imtype == R_IMF_IMTYPE_IRIS) {
return IMB_FTYPE_IMAGIC;
}
#ifdef WITH_HDR
else if (imtype == R_IMF_IMTYPE_RADHDR)
else if (imtype == R_IMF_IMTYPE_RADHDR) {
return IMB_FTYPE_RADHDR;
}
#endif
else if (imtype == R_IMF_IMTYPE_PNG) {
r_options->quality = 15;
return IMB_FTYPE_PNG;
}
#ifdef WITH_DDS
else if (imtype == R_IMF_IMTYPE_DDS)
else if (imtype == R_IMF_IMTYPE_DDS) {
return IMB_FTYPE_DDS;
}
#endif
else if (imtype == R_IMF_IMTYPE_BMP)
else if (imtype == R_IMF_IMTYPE_BMP) {
return IMB_FTYPE_BMP;
}
#ifdef WITH_TIFF
else if (imtype == R_IMF_IMTYPE_TIFF)
else if (imtype == R_IMF_IMTYPE_TIFF) {
return IMB_FTYPE_TIF;
}
#endif
else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER)
else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER) {
return IMB_FTYPE_OPENEXR;
}
#ifdef WITH_CINEON
else if (imtype == R_IMF_IMTYPE_CINEON)
else if (imtype == R_IMF_IMTYPE_CINEON) {
return IMB_FTYPE_CINEON;
else if (imtype == R_IMF_IMTYPE_DPX)
}
else if (imtype == R_IMF_IMTYPE_DPX) {
return IMB_FTYPE_DPX;
}
#endif
#ifdef WITH_OPENJPEG
else if (imtype == R_IMF_IMTYPE_JP2) {
@@ -1132,46 +1141,60 @@ int BKE_image_imtype_to_ftype(const char imtype, ImbFormatOptions *r_options)
char BKE_image_ftype_to_imtype(const int ftype, const ImbFormatOptions *options)
{
if (ftype == 0)
if (ftype == 0) {
return R_IMF_IMTYPE_TARGA;
else if (ftype == IMB_FTYPE_IMAGIC)
}
else if (ftype == IMB_FTYPE_IMAGIC) {
return R_IMF_IMTYPE_IRIS;
}
#ifdef WITH_HDR
else if (ftype == IMB_FTYPE_RADHDR)
else if (ftype == IMB_FTYPE_RADHDR) {
return R_IMF_IMTYPE_RADHDR;
}
#endif
else if (ftype == IMB_FTYPE_PNG)
else if (ftype == IMB_FTYPE_PNG) {
return R_IMF_IMTYPE_PNG;
}
#ifdef WITH_DDS
else if (ftype == IMB_FTYPE_DDS)
else if (ftype == IMB_FTYPE_DDS) {
return R_IMF_IMTYPE_DDS;
}
#endif
else if (ftype == IMB_FTYPE_BMP)
else if (ftype == IMB_FTYPE_BMP) {
return R_IMF_IMTYPE_BMP;
}
#ifdef WITH_TIFF
else if (ftype == IMB_FTYPE_TIF)
else if (ftype == IMB_FTYPE_TIF) {
return R_IMF_IMTYPE_TIFF;
}
#endif
else if (ftype == IMB_FTYPE_OPENEXR)
else if (ftype == IMB_FTYPE_OPENEXR) {
return R_IMF_IMTYPE_OPENEXR;
}
#ifdef WITH_CINEON
else if (ftype == IMB_FTYPE_CINEON)
else if (ftype == IMB_FTYPE_CINEON) {
return R_IMF_IMTYPE_CINEON;
else if (ftype == IMB_FTYPE_DPX)
}
else if (ftype == IMB_FTYPE_DPX) {
return R_IMF_IMTYPE_DPX;
}
#endif
else if (ftype == IMB_FTYPE_TGA) {
if (options && (options->flag & RAWTGA))
if (options && (options->flag & RAWTGA)) {
return R_IMF_IMTYPE_RAWTGA;
else
}
else {
return R_IMF_IMTYPE_TARGA;
}
}
#ifdef WITH_OPENJPEG
else if (ftype == IMB_FTYPE_JP2)
else if (ftype == IMB_FTYPE_JP2) {
return R_IMF_IMTYPE_JP2;
}
#endif
else
else {
return R_IMF_IMTYPE_JPEG90;
}
}

View File

@@ -1917,7 +1917,7 @@ static void dist_squared_ray_to_aabb_scaled_v3_precalc(
}
/* un-normalize ray */
if (ray_is_normalized && scale &&
(data->scale[0] != 1.0f || data->scale[1] != 1.0f || data->scale[2] != 1.0f))
(data->scale[0] != 1.0f || data->scale[1] != 1.0f || data->scale[2] != 1.0f))
{
data->ray.direction[0] = ray_direction[0] * data->scale[0];
data->ray.direction[1] = ray_direction[1] * data->scale[1];

View File

@@ -2268,7 +2268,7 @@ static void write_meshes(WriteData *wd, ListBase *idbase)
mesh->edit_btmesh = NULL;
/* now fill in polys to mfaces */
/* XXX This breaks writing design, by using temp allocated memory, which will likely generate
/* XXX This breaks writing desing, by using temp allocated memory, which will likely generate
* duplicates in stored 'old' addresses.
* This is very bad, but do not see easy way to avoid this, aside from generating those data
* outside of save process itself.

View File

@@ -57,10 +57,9 @@
static bool testedgesidef(const float v1[2], const float v2[2], const float v3[2])
{
/* is v3 to the right of v1 - v2 ? With exception: v3 == v1 || v3 == v2 */
double inp;
//inp = (v2[cox] - v1[cox]) * (v1[coy] - v3[coy]) + (v1[coy] - v2[coy]) * (v1[cox] - v3[cox]);
inp = (v2[0] - v1[0]) * (v1[1] - v3[1]) + (v1[1] - v2[1]) * (v1[0] - v3[0]);
const float inp =
((v2[0] - v1[0]) * (v1[1] - v3[1])) +
((v1[1] - v2[1]) * (v1[0] - v3[0]));
if (inp < 0.0) {
return false;

View File

@@ -231,8 +231,9 @@ struct RenderStats *RE_GetStats(struct Render *re);
void RE_ResultGet32(struct Render *re, unsigned int *rect);
void RE_AcquiredResultGet32(struct Render *re, struct RenderResult *result, unsigned int *rect, const int view_id);
void RE_render_result_rect_from_ibuf(struct RenderResult *rr, struct RenderData *rd,
struct ImBuf *ibuf, const int view_id);
void RE_render_result_rect_from_ibuf(
struct RenderResult *rr, struct RenderData *rd,
struct ImBuf *ibuf, const int view_id);
struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name);
float *RE_RenderLayerGetPass(volatile struct RenderLayer *rl, int passtype, const char *viewname);
@@ -249,8 +250,8 @@ struct Object *RE_GetCamera(struct Render *re); /* return camera override if set
void RE_SetOverrideCamera(struct Render *re, struct Object *camera);
void RE_SetCamera(struct Render *re, struct Object *camera);
void RE_SetEnvmapCamera(struct Render *re, struct Object *cam_ob, float viewscale, float clipsta, float clipend);
void RE_SetWindow(struct Render *re, rctf *viewplane, float clipsta, float clipend);
void RE_SetOrtho(struct Render *re, rctf *viewplane, float clipsta, float clipend);
void RE_SetWindow(struct Render *re, const rctf *viewplane, float clipsta, float clipend);
void RE_SetOrtho(struct Render *re, const rctf *viewplane, float clipsta, float clipend);
void RE_SetPixelSize(struct Render *re, float pixsize);
/* option to set viewmatrix before making dbase */
@@ -258,10 +259,12 @@ void RE_SetView(struct Render *re, float mat[4][4]);
/* get current view and window transform */
void RE_GetView(struct Render *re, float mat[4][4]);
void RE_GetViewPlane(struct Render *re, rctf *viewplane, rcti *disprect);
void RE_GetViewPlane(struct Render *re, rctf *r_viewplane, rcti *r_disprect);
/* make or free the dbase */
void RE_Database_FromScene(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, int use_camera_view);
void RE_Database_FromScene(
struct Render *re, struct Main *bmain, struct Scene *scene,
unsigned int lay, int use_camera_view);
void RE_Database_Preprocess(struct Render *re);
void RE_Database_Free(struct Render *re);
@@ -304,11 +307,16 @@ void RE_SetReports(struct Render *re, struct ReportList *reports);
void RE_PreviewRender(struct Render *re, struct Main *bmain, struct Scene *scene);
bool RE_ReadRenderResult(struct Scene *scene, struct Scene *scenode);
bool RE_WriteRenderResult(struct ReportList *reports, RenderResult *rr, const char *filename, struct ImageFormatData *imf, const bool multiview, const char *view);
struct RenderResult *RE_MultilayerConvert(void *exrhandle, const char *colorspace, bool predivide, int rectx, int recty);
bool RE_WriteRenderResult(
struct ReportList *reports, RenderResult *rr, const char *filename,
struct ImageFormatData *imf, const bool multiview, const char *view);
struct RenderResult *RE_MultilayerConvert(
void *exrhandle, const char *colorspace, bool predivide, int rectx, int recty);
extern const float default_envmap_layout[];
bool RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct EnvMap *env, const char *relpath, const char imtype, float layout[12]);
bool RE_WriteEnvmapResult(
struct ReportList *reports, struct Scene *scene, struct EnvMap *env,
const char *relpath, const char imtype, float layout[12]);
/* do a full sample buffer compo */
void RE_MergeFullSample(struct Render *re, struct Main *bmain, struct Scene *sce, struct bNodeTree *ntree);
@@ -326,7 +334,9 @@ void RE_current_scene_update_cb(struct Render *re, void *handle, void (*f)(void
/* should move to kernel once... still unsure on how/where */
float RE_filter_value(int type, float x);
/* vector blur zbuffer method */
void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect);
void RE_zbuf_accumulate_vecblur(
struct NodeBlurData *nbd, int xsize, int ysize, float *newrect,
const float *imgrect, float *vecbufrect, const float *zbufrect);
int RE_seq_render_active(struct Scene *scene, struct RenderData *rd);
@@ -351,7 +361,9 @@ struct RenderPass *RE_pass_find_by_type(volatile struct RenderLayer *rl, int pas
#define RE_BAKE_DERIVATIVE 13
#define RE_BAKE_VERTEX_COLORS 14
void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, const int type, struct Object *actob);
void RE_Database_Baking(
struct Render *re, struct Main *bmain, struct Scene *scene,
unsigned int lay, const int type, struct Object *actob);
void RE_DataBase_GetView(struct Render *re, float mat[4][4]);
void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[4][4]);

View File

@@ -931,7 +931,7 @@ void render_update_anim_renderdata(Render *re, RenderData *rd)
BLI_duplicatelist(&re->r.views, &rd->views);
}
void RE_SetWindow(Render *re, rctf *viewplane, float clipsta, float clipend)
void RE_SetWindow(Render *re, const rctf *viewplane, float clipsta, float clipend)
{
/* re->ok flag? */
@@ -946,7 +946,7 @@ void RE_SetWindow(Render *re, rctf *viewplane, float clipsta, float clipend)
}
void RE_SetOrtho(Render *re, rctf *viewplane, float clipsta, float clipend)
void RE_SetOrtho(Render *re, const rctf *viewplane, float clipsta, float clipend)
{
/* re->ok flag? */
@@ -967,15 +967,17 @@ void RE_SetView(Render *re, float mat[4][4])
invert_m4_m4(re->viewinv, re->viewmat);
}
void RE_GetViewPlane(Render *re, rctf *viewplane, rcti *disprect)
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
{
*viewplane = re->viewplane;
*r_viewplane = re->viewplane;
/* make disprect zero when no border render, is needed to detect changes in 3d view render */
if (re->r.mode & R_BORDER)
*disprect = re->disprect;
else
BLI_rcti_init(disprect, 0, 0, 0, 0);
if (re->r.mode & R_BORDER) {
*r_disprect = re->disprect;
}
else {
BLI_rcti_init(r_disprect, 0, 0, 0, 0);
}
}
void RE_GetView(Render *re, float mat[4][4])

View File

@@ -2883,14 +2883,17 @@ static void set_quad_bezier_ipo(float fac, float *data)
data[2]= fac*fac;
}
void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect)
void RE_zbuf_accumulate_vecblur(
NodeBlurData *nbd, int xsize, int ysize, float *newrect,
const float *imgrect, float *vecbufrect, const float *zbufrect)
{
ZSpan zspan;
DrawBufPixel *rectdraw, *dr;
static float jit[256][2];
float v1[3], v2[3], v3[3], v4[3], fx, fy;
float *rectvz, *dvz, *dimg, *dvec1, *dvec2, *dz, *dz1, *dz2, *rectz;
float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm, *ro;
const float *dimg, *dz, *ro;
float *rectvz, *dvz, *dvec1, *dvec2, *dz1, *dz2, *rectz;
float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm;
float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed;
int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples;
int tsktsk= 0;