- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
*/
/* See the python script above to regenerate the 48x48 icon within blender */
-#define BLENDER_ICON_WIDTH 48
-#define BLENDER_ICON_HEIGHT 48
static long BLENDER_ICON_48x48x32[] = {
48,48,
4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303,
float rgba[4], const int thread, struct ImagePool *pool);
float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2],
float rgba[4]);
-float BKE_brush_sample_masktex (const Scene *scene, struct Brush *br,const float point[3],
- const int thread, struct ImagePool *pool);
+float BKE_brush_sample_masktex(const Scene *scene, struct Brush *br, const float point[3],
+ const int thread, struct ImagePool *pool);
void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
struct ImBuf **imbuf, int use_color_correction);
return intensity;
}
-float BKE_brush_sample_masktex (const Scene *scene, Brush *br,
- const float point[3],
- const int thread,
- struct ImagePool *pool) {
+float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
+ const float point[3],
+ const int thread,
+ struct ImagePool *pool)
+{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
MTex *mtex = &br->mask_mtex;
/* if object has parents, update them too */
if (parent_recursion) {
- int recursion = parent_recursion-1;
+ int recursion = parent_recursion - 1;
int is_canvas = 0;
if (ob->parent) is_canvas += subframe_updateObject(scene, ob->parent, 0, recursion, frame);
if (ob->track) is_canvas += subframe_updateObject(scene, ob->track, 0, recursion, frame);
#include "bmesh.h"
#include "./intern/bmesh_private.h"
-
-
#define BEVEL_EPSILON_D 1e-6
#define BEVEL_EPSILON 1e-6f
+/* happens far too often, uncomment for development */
+// #define BEVEL_ASSERT_PROJECT
+
/* for testing */
// #pragma GCC diagnostic error "-Wpadded"
/* intersect the lines; by construction they should be on the same plane and not parallel */
if (!isect_line_line_v3(off1a, off1b, off2a, off2b, meetco, isect2)) {
+#ifdef BEVEL_ASSERT_PROJECT
BLI_assert(!"offset_meet failure");
+#endif
copy_v3_v3(meetco, off1a); /* just to do something */
}
}
float otherco[3];
if (!isect_line_line_v3(e->v1->co, e->v2->co, co_a, co_b, projco, otherco)) {
+#ifdef BEVEL_ASSERT_PROJECT
BLI_assert(!"project meet failure");
+#endif
copy_v3_v3(projco, e->v1->co);
}
}
*/
void bc_match_scale(std::vector<Object *> *objects_done,
Scene &sce,
- UnitConverter &bc_unit) {
-
+ UnitConverter &bc_unit)
+{
Object *ob = NULL;
PointerRNA scene_ptr, unit_settings;
Full frame
*/
- int full_width = rd->xsch * rd->size / 100;
- int full_height =rd->ysch * rd->size / 100;
+ int full_width = rd->xsch * rd->size / 100;
+ int full_height = rd->ysch * rd->size / 100;
dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f;
dy = rd->border.ymin * full_height - (full_height - this->getHeight()) / 2.0f;
return s;
}
-void paint_2d_redraw (const bContext *C, void *ps, int final)
+void paint_2d_redraw(const bContext *C, void *ps, int final)
{
ImagePaintState *s = ps;
SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE)))
{
if (((brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) ||
- (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) &&
+ (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) &&
!(brush->flag & BRUSH_RAKE))
{
if (brush->flag & BRUSH_RANDOM_ROTATION)
if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) {
ups->tex_mouse[0] = BLI_frand() * stroke->vc.ar->sizex;
ups->tex_mouse[1] = BLI_frand() * stroke->vc.ar->sizey;;
- } else {
+ }
+ else {
copy_v2_v2(ups->tex_mouse, mouse);
}
}
{
int poll = ED_operator_file_active(C);
SpaceFile *sfile = CTX_wm_space_file(C);
- struct direntry *file;
- if (sfile && sfile->params) {
+ if (sfile && sfile->params) {
char dir[FILE_MAX], group[FILE_MAX];
int numfiles = filelist_numfiles(sfile->files);
int i;
int num_selected = 0;
if (filelist_islibrary(sfile->files, dir, group)) poll = 0;
- for (i = 0; i < numfiles; i++) {
+ for (i = 0; i < numfiles; i++) {
if (filelist_is_selected(sfile->files, i, CHECK_FILES)) {
num_selected++;
}
}
if (num_selected <= 0) {
poll = 0;
- }
+ }
}
else
poll = 0;
/* setup face preview for all coincident uvs and their faces */
static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
- PreviewPosition *preview_position) {
+ PreviewPosition *preview_position)
+{
StitchPreviewer *preview = state->stitch_preview;
/* static island does not change so returning immediately */
/* checks if uvs are indeed stitchable and registers so that they can be shown in preview */
static void stitch_validate_uv_stichability(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
- PreviewPosition *preview_position) {
+ PreviewPosition *preview_position)
+{
UvElement *element_iter;
StitchPreviewer *preview = state->stitch_preview;
int vert_index;
static void stitch_validate_edge_stichability(UvEdge *edge, StitchState *state, IslandStitchData *island_stitch_data,
- PreviewPosition *preview_position) {
+ PreviewPosition *preview_position)
+{
UvEdge *edge_iter = edge->first;
StitchPreviewer *preview = state->stitch_preview;
}
static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
- IMB_Timecode_Type tc) {
+ IMB_Timecode_Type tc)
+{
int64_t pts_to_search = 0;
double frame_rate;
double pts_time_base;
struct ImBuf *IMB_anim_absolute(struct anim *anim, int position,
IMB_Timecode_Type tc,
- IMB_Proxy_Size preview_size) {
+ IMB_Proxy_Size preview_size)
+{
struct ImBuf *ibuf = NULL;
char head[256], tail[256];
unsigned short digits;
static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffer, const float *linear_buffer,
const unsigned char *byte_buffer, int display_stride, int linear_stride,
int linear_offset_x, int linear_offset_y, ColormanageProcessor *cm_processor,
- int xmin, int ymin, int xmax, int ymax)
+ const int xmin, const int ymin, const int xmax, const int ymax)
{
int x, y;
int channels = ibuf->channels;
float dither = ibuf->dither;
ColorSpace *rect_colorspace = ibuf->rect_colorspace;
float *display_buffer_float = NULL;
- int width = xmax - xmin;
- int height = ymax - ymin;
+ const int width = xmax - xmin;
+ const int height = ymax - ymin;
int is_data = ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA;
if (dither != 0.0f) {
width, height, width, display_stride);
}
else {
- int i, width = xmax - xmin;
+ int i;
for (i = ymin; i < ymax; i++) {
int byte_offset = (linear_stride * i + xmin) * 4;
#define SetIntItem(flag) \
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag))
#endif
+#ifndef WITH_FFMPEG
#define SetStrItem(str) \
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyUnicode_FromString(str))
+#endif
#define SetObjItem(obj) \
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
mainl = BLO_library_append_begin(bmain, &(self->blo_handle), self->relpath);
{
- int i = 0, code;
- while ((code = BKE_idcode_iter_step(&i))) {
- if (BKE_idcode_is_linkable(code)) {
- const char *name_plural = BKE_idcode_to_name_plural(code);
+ int idcode_step = 0, idcode;
+ while ((idcode = BKE_idcode_iter_step(&idcode_step))) {
+ if (BKE_idcode_is_linkable(idcode)) {
+ const char *name_plural = BKE_idcode_to_name_plural(idcode);
PyObject *ls = PyDict_GetItemString(self->dict, name_plural);
// printf("lib: %s\n", name_plural);
if (ls && PyList_Check(ls)) {
// printf(" %s\n", item_str);
if (item_str) {
- ID *id = BLO_library_append_named_part(mainl, &(self->blo_handle), item_str, code);
+ ID *id = BLO_library_append_named_part(mainl, &(self->blo_handle), item_str, idcode);
if (id) {
#ifdef USE_RNA_DATABLOCKS
PointerRNA id_ptr;
}
-void BL_ActionActuator::SetBlendTime (float newtime)
+void BL_ActionActuator::SetBlendTime(float newtime)
{
m_blendframe = newtime;
}
#include "DNA_constraint_types.h"
//XXX #include "BIF_editconstraint.h"
-static bPoseChannel *get_active_posechannel2 (Object *ob)
+static bPoseChannel *get_active_posechannel2(Object *ob)
{
bArmature *arm= (bArmature*)ob->data;
bPoseChannel *pchan;
m_lastUpdate=-1;
}
-void BL_ShapeActionActuator::SetBlendTime (float newtime)
+void BL_ShapeActionActuator::SetBlendTime(float newtime)
{
m_blendframe = newtime;
}
#define VALUE_POS(val1) (val1)->Calc(VALUE_POS_OPERATOR, val1)
-STR_String CValue::op2str (VALUE_OPERATOR op)
+STR_String CValue::op2str(VALUE_OPERATOR op)
{
//pre:
//ret: the stringrepresentation of operator op
-void* SCA_LogicManager::GetActionByName (const STR_String& actname)
+void *SCA_LogicManager::GetActionByName(const STR_String& actname)
{
STR_HashedString an = actname;
void** actptr = m_mapStringToActions[an];
KX_GetActiveScene()->AddFont(this);
}
-int GetFontId (VFont *vfont)
+int GetFontId(VFont *vfont)
{
PackedFile *packedfile=NULL;
int fontid = -1;
ExceptionID ErrGeneral, ErrNotFound;
// exception descriptions
-ExpDesc errGenerDesc (ErrGeneral, "General Error");
-ExpDesc errNFoundDesc (ErrNotFound, "Error description not found");
+ExpDesc errGenerDesc(ErrGeneral, "General Error");
+ExpDesc errNFoundDesc(ErrNotFound, "Error description not found");
}
// object deallocation
-void Filter_dealloc (PyFilter *self)
+void Filter_dealloc(PyFilter *self)
{
// release object attributes
if (self->m_filter != NULL)
// set previous pixel filter object
-int Filter_setPrevious (PyFilter *self, PyObject *value, void *closure)
+int Filter_setPrevious(PyFilter *self, PyObject *value, void *closure)
{
// if filter object is available
if (self->m_filter != NULL)
}
// set color
-static int setColor (PyFilter *self, PyObject *value, void *closure)
+static int setColor(PyFilter *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL ||
}
// set limit
-static int setLimits (PyFilter *self, PyObject *value, void *closure)
+static int setLimits(PyFilter *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL ||
}
// set color matrix
-static int setMatrix (PyFilter *self, PyObject *value, void *closure)
+static int setMatrix(PyFilter *self, PyObject *value, void *closure)
{
// matrix to store items
ColorMatrix mat;
}
// set color levels
-static int setLevels (PyFilter *self, PyObject *value, void *closure)
+static int setLevels(PyFilter *self, PyObject *value, void *closure)
{
// matrix to store items
ColorLevel lev;
}
// set index of color used to calculate normal
-static int setColor (PyFilter *self, PyObject *value, void *closure)
+static int setColor(PyFilter *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL || !PyLong_Check(value))
}
// set depth
-static int setDepth (PyFilter *self, PyObject *value, void *closure)
+static int setDepth(PyFilter *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value)
ExceptionID ImageHasExports;
ExceptionID InvalidColorChannel;
-ExpDesc ImageHasExportsDesc (ImageHasExports, "Image has exported buffers, cannot resize");
-ExpDesc InvalidColorChannelDesc (InvalidColorChannel, "Invalid or too many color channels specified. At most 4 values within R, G, B, A, 0, 1");
+ExpDesc ImageHasExportsDesc(ImageHasExports, "Image has exported buffers, cannot resize");
+ExpDesc InvalidColorChannelDesc(InvalidColorChannel, "Invalid or too many color channels specified. At most 4 values within R, G, B, A, 0, 1");
// initialize image data
void ImageBase::init (short width, short height)
}
// object deallocation
-void Image_dealloc (PyImage *self)
+void Image_dealloc(PyImage *self)
{
// release object attributes
if (self->m_image != NULL)
}
// set scale
-int Image_setScale (PyImage *self, PyObject *value, void *closure)
+int Image_setScale(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
}
// set flip
-int Image_setFlip (PyImage *self, PyObject *value, void *closure)
+int Image_setFlip(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
}
// set zbuff
-int Image_setZbuff (PyImage * self, PyObject * value, void * closure)
+int Image_setZbuff(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
}
// set depth
-int Image_setDepth (PyImage * self, PyObject * value, void * closure)
+int Image_setDepth(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
// set pixel filter object
-int Image_setFilter (PyImage *self, PyObject *value, void *closure)
+int Image_setFilter(PyImage *self, PyObject *value, void *closure)
{
// if image object is available
if (self->m_image != NULL)
// forward declaration;
extern PyTypeObject ImageBuffType;
-static int ImageBuff_init (PyObject *pySelf, PyObject *args, PyObject *kwds)
+static int ImageBuff_init(PyObject *pySelf, PyObject *args, PyObject *kwds)
{
short width = -1;
short height = -1;
ExceptionID ImageSizesNotMatch;
-ExpDesc ImageSizesNotMatchDesc (ImageSizesNotMatch, "Image sizes of sources are different");
+ExpDesc ImageSizesNotMatchDesc(ImageSizesNotMatch, "Image sizes of sources are different");
// calculate image from sources and set its availability
void ImageMix::calcImage (unsigned int texId, double ts)
ExceptionID SceneInvalid, CameraInvalid, ObserverInvalid;
ExceptionID MirrorInvalid, MirrorSizeInvalid, MirrorNormalInvalid, MirrorHorizontal, MirrorTooSmall;
-ExpDesc SceneInvalidDesc (SceneInvalid, "Scene object is invalid");
-ExpDesc CameraInvalidDesc (CameraInvalid, "Camera object is invalid");
-ExpDesc ObserverInvalidDesc (ObserverInvalid, "Observer object is invalid");
-ExpDesc MirrorInvalidDesc (MirrorInvalid, "Mirror object is invalid");
-ExpDesc MirrorSizeInvalidDesc (MirrorSizeInvalid, "Mirror has no vertex or no size");
-ExpDesc MirrorNormalInvalidDesc (MirrorNormalInvalid, "Cannot determine mirror plane");
-ExpDesc MirrorHorizontalDesc (MirrorHorizontal, "Mirror is horizontal in local space");
-ExpDesc MirrorTooSmallDesc (MirrorTooSmall, "Mirror is too small");
+ExpDesc SceneInvalidDesc(SceneInvalid, "Scene object is invalid");
+ExpDesc CameraInvalidDesc(CameraInvalid, "Camera object is invalid");
+ExpDesc ObserverInvalidDesc(ObserverInvalid, "Observer object is invalid");
+ExpDesc MirrorInvalidDesc(MirrorInvalid, "Mirror object is invalid");
+ExpDesc MirrorSizeInvalidDesc(MirrorSizeInvalid, "Mirror has no vertex or no size");
+ExpDesc MirrorNormalInvalidDesc(MirrorNormalInvalid, "Cannot determine mirror plane");
+ExpDesc MirrorHorizontalDesc(MirrorHorizontal, "Mirror is horizontal in local space");
+ExpDesc MirrorTooSmallDesc(MirrorTooSmall, "Mirror is too small");
// constructor
ImageRender::ImageRender (KX_Scene * scene, KX_Camera * camera) :
// object initialization
-static int ImageRender_init (PyObject *pySelf, PyObject *args, PyObject *kwds)
+static int ImageRender_init(PyObject *pySelf, PyObject *args, PyObject *kwds)
{
// parameters - scene object
PyObject *scene;
}
// set color
-static int setBackground (PyImage *self, PyObject *value, void *closure)
+static int setBackground(PyImage *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL || !PySequence_Check(value) || PySequence_Size(value) != 4
};
// object initialization
-static int ImageMirror_init (PyObject *pySelf, PyObject *args, PyObject *kwds)
+static int ImageMirror_init(PyObject *pySelf, PyObject *args, PyObject *kwds)
{
// parameters - scene object
PyObject *scene;
}
// set clip
-static int setClip (PyImage *self, PyObject *value, void *closure)
+static int setClip(PyImage *self, PyObject *value, void *closure)
{
// check validity of parameter
double clip;
}
// set whole
-int ImageViewport_setWhole (PyImage *self, PyObject *value, void *closure)
+int ImageViewport_setWhole(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
}
// set whole
-int ImageViewport_setAlpha (PyImage *self, PyObject *value, void *closure)
+int ImageViewport_setAlpha(PyImage *self, PyObject *value, void *closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
}
// set position
-static int ImageViewport_setPosition (PyImage *self, PyObject *value, void *closure)
+static int ImageViewport_setPosition(PyImage *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL ||
}
// set capture size
-int ImageViewport_setCaptureSize (PyImage *self, PyObject *value, void *closure)
+int ImageViewport_setCaptureSize(PyImage *self, PyObject *value, void *closure)
{
// check validity of parameter
if (value == NULL ||
// load texture
-void loadTexture (unsigned int texId, unsigned int * texture, short * size,
- bool mipmap)
+void loadTexture(unsigned int texId, unsigned int *texture, short *size,
+ bool mipmap)
{
// load texture for rendering
glBindTexture(GL_TEXTURE_2D, texId);
// forward declaration
-PyObject *Texture_close(Texture * self);
-int Texture_setSource (Texture * self, PyObject *value, void *closure);
+PyObject *Texture_close(Texture *self);
+int Texture_setSource(Texture *self, PyObject *value, void *closure);
// Texture object deallocation
ExceptionID MaterialNotAvail;
-ExpDesc MaterialNotAvailDesc (MaterialNotAvail, "Texture material is not available");
+ExpDesc MaterialNotAvailDesc(MaterialNotAvail, "Texture material is not available");
// Texture object initialization
static int Texture_init(Texture *self, PyObject *args, PyObject *kwds)
// set source object
-int Texture_setSource (Texture * self, PyObject *value, void *closure)
+int Texture_setSource(Texture *self, PyObject *value, void *closure)
{
// check new value
if (value == NULL || !pyImageTypes.in(Py_TYPE(value)))
// exceptions for video source initialization
ExceptionID SourceVideoEmpty, SourceVideoCreation;
-ExpDesc SourceVideoEmptyDesc (SourceVideoEmpty, "Source Video is empty");
-ExpDesc SourceVideoCreationDesc (SourceVideoCreation, "SourceVideo object was not created");
+ExpDesc SourceVideoEmptyDesc(SourceVideoEmpty, "Source Video is empty");
+ExpDesc SourceVideoCreationDesc(SourceVideoCreation, "SourceVideo object was not created");
// open video source
-void Video_open (VideoBase * self, char * file, short captureID)
+void Video_open(VideoBase * self, char * file, short captureID)
{
// if file is empty, throw exception
if (file == NULL) THRWEXCP(SourceVideoEmpty, S_OK);
// object initialization
-static int VideoFFmpeg_init (PyObject *pySelf, PyObject *args, PyObject *kwds)
+static int VideoFFmpeg_init(PyObject *pySelf, PyObject *args, PyObject *kwds)
{
PyImage *self = reinterpret_cast<PyImage*>(pySelf);
// parameters - video source
};
// object initialization
-static int ImageFFmpeg_init (PyObject *pySelf, PyObject *args, PyObject *kwds)
+static int ImageFFmpeg_init(PyObject *pySelf, PyObject *args, PyObject *kwds)
{
PyImage *self = reinterpret_cast<PyImage*>(pySelf);
// parameters - video source