whitespace edits, make formatting for functions consustent at least within the file.
This commit is contained in:
@@ -44,7 +44,8 @@
|
|||||||
|
|
||||||
/* implementation */
|
/* implementation */
|
||||||
|
|
||||||
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
|
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
|
||||||
|
{
|
||||||
int x, y,i, rowstride;
|
int x, y,i, rowstride;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
AviBitmapInfoHeader *bi;
|
AviBitmapInfoHeader *bi;
|
||||||
@@ -116,7 +117,8 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
|
void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
|
||||||
|
{
|
||||||
int y, x, i, rowstride;
|
int y, x, i, rowstride;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
|
|
||||||
|
|||||||
@@ -908,7 +908,8 @@ static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val,
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa) {
|
static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa)
|
||||||
|
{
|
||||||
BoidState *state = boids->states.first;
|
BoidState *state = boids->states.first;
|
||||||
BoidParticle *bpa = pa->boid;
|
BoidParticle *bpa = pa->boid;
|
||||||
|
|
||||||
|
|||||||
@@ -1374,7 +1374,8 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTree
|
|||||||
return collpair;
|
return collpair;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void machine_epsilon_offset(Cloth *cloth) {
|
static void machine_epsilon_offset(Cloth *cloth)
|
||||||
|
{
|
||||||
ClothVertex *cv;
|
ClothVertex *cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
|||||||
@@ -3937,7 +3937,8 @@ static bConstraintTypeInfo *constraintsTypeInfo[NUM_CONSTRAINT_TYPES];
|
|||||||
static short CTI_INIT= 1; /* when non-zero, the list needs to be updated */
|
static short CTI_INIT= 1; /* when non-zero, the list needs to be updated */
|
||||||
|
|
||||||
/* This function only gets called when CTI_INIT is non-zero */
|
/* This function only gets called when CTI_INIT is non-zero */
|
||||||
static void constraints_init_typeinfo (void) {
|
static void constraints_init_typeinfo (void)
|
||||||
|
{
|
||||||
constraintsTypeInfo[0]= NULL; /* 'Null' Constraint */
|
constraintsTypeInfo[0]= NULL; /* 'Null' Constraint */
|
||||||
constraintsTypeInfo[1]= &CTI_CHILDOF; /* ChildOf Constraint */
|
constraintsTypeInfo[1]= &CTI_CHILDOF; /* ChildOf Constraint */
|
||||||
constraintsTypeInfo[2]= &CTI_TRACKTO; /* TrackTo Constraint */
|
constraintsTypeInfo[2]= &CTI_TRACKTO; /* TrackTo Constraint */
|
||||||
|
|||||||
@@ -1406,7 +1406,8 @@ void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, stru
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add Orco layer to the displist object which has got derived mesh and return orco */
|
/* add Orco layer to the displist object which has got derived mesh and return orco */
|
||||||
float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender) {
|
float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
|
||||||
|
{
|
||||||
float *orco;
|
float *orco;
|
||||||
|
|
||||||
if (derivedFinal == NULL)
|
if (derivedFinal == NULL)
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ int BKE_idcode_is_valid(int code)
|
|||||||
return idtype_from_code(code)?1:0;
|
return idtype_from_code(code)?1:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BKE_idcode_is_linkable(int code) {
|
int BKE_idcode_is_linkable(int code)
|
||||||
|
{
|
||||||
IDType *idt= idtype_from_code(code);
|
IDType *idt= idtype_from_code(code);
|
||||||
return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0;
|
return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2829,7 +2829,8 @@ void object_sculpt_modifiers_changed(Object *ob)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float give_timeoffset(Object *ob) {
|
float give_timeoffset(Object *ob)
|
||||||
|
{
|
||||||
if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
|
if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
|
||||||
return ob->sf + give_timeoffset(ob->parent);
|
return ob->sf + give_timeoffset(ob->parent);
|
||||||
} else {
|
} else {
|
||||||
@@ -2837,7 +2838,8 @@ float give_timeoffset(Object *ob) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot) {
|
int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot)
|
||||||
|
{
|
||||||
|
|
||||||
if (ob->data==NULL)
|
if (ob->data==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -2544,7 +2544,8 @@ static void ptcache_dt_to_str(char *str, double dtime)
|
|||||||
sprintf(str, "%is", ((int)dtime) % 60);
|
sprintf(str, "%is", ((int)dtime) % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *ptcache_bake_thread(void *ptr) {
|
static void *ptcache_bake_thread(void *ptr)
|
||||||
|
{
|
||||||
int usetimer = 0, sfra, efra;
|
int usetimer = 0, sfra, efra;
|
||||||
double stime, ptime, ctime, fetd;
|
double stime, ptime, ctime, fetd;
|
||||||
char run[32], cur[32], etd[32];
|
char run[32], cur[32], etd[32];
|
||||||
|
|||||||
@@ -2852,7 +2852,8 @@ void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_ch
|
|||||||
left and right are the bounds at which the sequence is rendered,
|
left and right are the bounds at which the sequence is rendered,
|
||||||
start and end are from the start and fixed length of the sequence.
|
start and end are from the start and fixed length of the sequence.
|
||||||
*/
|
*/
|
||||||
int seq_tx_get_start(Sequence *seq) {
|
int seq_tx_get_start(Sequence *seq)
|
||||||
|
{
|
||||||
return seq->start;
|
return seq->start;
|
||||||
}
|
}
|
||||||
int seq_tx_get_end(Sequence *seq)
|
int seq_tx_get_end(Sequence *seq)
|
||||||
|
|||||||
@@ -2792,7 +2792,8 @@ int setcurr_tab_spaces (Text *text, int space)
|
|||||||
/*********************************/
|
/*********************************/
|
||||||
|
|
||||||
/* Creates and adds a marker to the list maintaining sorted order */
|
/* Creates and adds a marker to the list maintaining sorted order */
|
||||||
void txt_add_marker(Text *text, TextLine *line, int start, int end, const unsigned char color[4], int group, int flags) {
|
void txt_add_marker(Text *text, TextLine *line, int start, int end, const unsigned char color[4], int group, int flags)
|
||||||
|
{
|
||||||
TextMarker *tmp, *marker;
|
TextMarker *tmp, *marker;
|
||||||
|
|
||||||
marker= MEM_mallocN(sizeof(TextMarker), "text_marker");
|
marker= MEM_mallocN(sizeof(TextMarker), "text_marker");
|
||||||
@@ -2841,7 +2842,8 @@ TextMarker *txt_find_marker_region(Text *text, TextLine *line, int start, int en
|
|||||||
/* Clears all markers on the specified line between two points. If the group or
|
/* Clears all markers on the specified line between two points. If the group or
|
||||||
flags fields are non-zero the returned flag must be in the specified group
|
flags fields are non-zero the returned flag must be in the specified group
|
||||||
and have at least the specified flags set. */
|
and have at least the specified flags set. */
|
||||||
short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags) {
|
short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags)
|
||||||
|
{
|
||||||
TextMarker *marker, *next;
|
TextMarker *marker, *next;
|
||||||
int lineno= txt_get_span(text->lines.first, line);
|
int lineno= txt_get_span(text->lines.first, line);
|
||||||
short cleared= 0;
|
short cleared= 0;
|
||||||
@@ -2866,7 +2868,8 @@ short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, in
|
|||||||
/* Clears all markers in the specified group (if given) with at least the
|
/* Clears all markers in the specified group (if given) with at least the
|
||||||
specified flags set. Useful for clearing temporary markers (group=0,
|
specified flags set. Useful for clearing temporary markers (group=0,
|
||||||
flags=TMARK_TEMP) */
|
flags=TMARK_TEMP) */
|
||||||
short txt_clear_markers(Text *text, int group, int flags) {
|
short txt_clear_markers(Text *text, int group, int flags)
|
||||||
|
{
|
||||||
TextMarker *marker, *next;
|
TextMarker *marker, *next;
|
||||||
short cleared= 0;
|
short cleared= 0;
|
||||||
|
|
||||||
|
|||||||
@@ -808,7 +808,8 @@ void flush_ffmpeg(void)
|
|||||||
********************************************************************** */
|
********************************************************************** */
|
||||||
|
|
||||||
/* Get the output filename-- similar to the other output formats */
|
/* Get the output filename-- similar to the other output formats */
|
||||||
void filepath_ffmpeg(char* string, RenderData* rd) {
|
void filepath_ffmpeg(char* string, RenderData* rd)
|
||||||
|
{
|
||||||
char autosplit[20];
|
char autosplit[20];
|
||||||
|
|
||||||
const char ** exts = get_file_extensions(rd->ffcodecdata.type);
|
const char ** exts = get_file_extensions(rd->ffcodecdata.type);
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ struct bArgs {
|
|||||||
int *passes;
|
int *passes;
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned int case_strhash(const void *ptr) {
|
static unsigned int case_strhash(const void *ptr)
|
||||||
|
{
|
||||||
const char *s= ptr;
|
const char *s= ptr;
|
||||||
unsigned int i= 0;
|
unsigned int i= 0;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ struct DynStr {
|
|||||||
|
|
||||||
/***/
|
/***/
|
||||||
|
|
||||||
DynStr *BLI_dynstr_new(void) {
|
DynStr *BLI_dynstr_new(void)
|
||||||
|
{
|
||||||
DynStr *ds= MEM_mallocN(sizeof(*ds), "DynStr");
|
DynStr *ds= MEM_mallocN(sizeof(*ds), "DynStr");
|
||||||
ds->elems= ds->last= NULL;
|
ds->elems= ds->last= NULL;
|
||||||
ds->curlen= 0;
|
ds->curlen= 0;
|
||||||
@@ -78,7 +79,8 @@ DynStr *BLI_dynstr_new(void) {
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLI_dynstr_append(DynStr *ds, const char *cstr) {
|
void BLI_dynstr_append(DynStr *ds, const char *cstr)
|
||||||
|
{
|
||||||
DynStrElem *dse= malloc(sizeof(*dse));
|
DynStrElem *dse= malloc(sizeof(*dse));
|
||||||
int cstrlen= strlen(cstr);
|
int cstrlen= strlen(cstr);
|
||||||
|
|
||||||
@@ -220,7 +222,8 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int BLI_dynstr_get_len(DynStr *ds) {
|
int BLI_dynstr_get_len(DynStr *ds)
|
||||||
|
{
|
||||||
return ds->curlen;
|
return ds->curlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,7 +350,8 @@ static void sort_along_axis(BVHTree *tree, int start, int end, int axis)
|
|||||||
//after a call to this function you can expect one of:
|
//after a call to this function you can expect one of:
|
||||||
// every node to left of a[n] are smaller or equal to it
|
// every node to left of a[n] are smaller or equal to it
|
||||||
// every node to the right of a[n] are greater or equal to it
|
// every node to the right of a[n] are greater or equal to it
|
||||||
static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){
|
static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis)
|
||||||
|
{
|
||||||
int begin = _begin, end = _end, cut;
|
int begin = _begin, end = _end, cut;
|
||||||
while(end-begin > 3)
|
while(end-begin > 3)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -644,7 +644,8 @@ void BLI_bpathIterator_step(struct BPathIterator *bpi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int BLI_bpathIterator_isDone( struct BPathIterator *bpi) {
|
int BLI_bpathIterator_isDone( struct BPathIterator *bpi)
|
||||||
|
{
|
||||||
return bpi->type==BPATH_DONE;
|
return bpi->type==BPATH_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,7 +700,8 @@ static void bpath_as_report(struct BPathIterator *bpi, const char *message, Repo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* high level function */
|
/* high level function */
|
||||||
void checkMissingFiles(Main *bmain, ReportList *reports) {
|
void checkMissingFiles(Main *bmain, ReportList *reports)
|
||||||
|
{
|
||||||
struct BPathIterator *bpi;
|
struct BPathIterator *bpi;
|
||||||
|
|
||||||
/* be sure there is low chance of the path being too short */
|
/* be sure there is low chance of the path being too short */
|
||||||
@@ -718,7 +720,8 @@ void checkMissingFiles(Main *bmain, ReportList *reports) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* dont log any errors at the moment, should probably do this */
|
/* dont log any errors at the moment, should probably do this */
|
||||||
void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
|
void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
|
||||||
|
{
|
||||||
int tot= 0, changed= 0, failed= 0, linked= 0;
|
int tot= 0, changed= 0, failed= 0, linked= 0;
|
||||||
struct BPathIterator *bpi;
|
struct BPathIterator *bpi;
|
||||||
char filepath[FILE_MAX];
|
char filepath[FILE_MAX];
|
||||||
@@ -886,7 +889,8 @@ static int findFileRecursive(char *filename_new, const char *dirname, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* high level function - call from fileselector */
|
/* high level function - call from fileselector */
|
||||||
void findMissingFiles(Main *bmain, const char *str) {
|
void findMissingFiles(Main *bmain, const char *str)
|
||||||
|
{
|
||||||
struct BPathIterator *bpi;
|
struct BPathIterator *bpi;
|
||||||
|
|
||||||
/* be sure there is low chance of the path being too short */
|
/* be sure there is low chance of the path being too short */
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ double round(double x);
|
|||||||
|
|
||||||
/* from python 3.1 floatobject.c
|
/* from python 3.1 floatobject.c
|
||||||
* ndigits must be between 0 and 21 */
|
* ndigits must be between 0 and 21 */
|
||||||
double double_round(double x, int ndigits) {
|
double double_round(double x, int ndigits)
|
||||||
|
{
|
||||||
double pow1, pow2, y, z;
|
double pow1, pow2, y, z;
|
||||||
if (ndigits >= 0) {
|
if (ndigits >= 0) {
|
||||||
pow1 = pow(10.0, (double)ndigits);
|
pow1 = pow(10.0, (double)ndigits);
|
||||||
|
|||||||
@@ -785,7 +785,8 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
|
|||||||
/* This is now only used to really get the user's default document folder */
|
/* This is now only used to really get the user's default document folder */
|
||||||
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
|
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
|
||||||
as default location to save documents */
|
as default location to save documents */
|
||||||
const char *BLI_getDefaultDocumentFolder(void) {
|
const char *BLI_getDefaultDocumentFolder(void)
|
||||||
|
{
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
return getenv("HOME");
|
return getenv("HOME");
|
||||||
|
|
||||||
@@ -1206,7 +1207,8 @@ void BLI_char_switch(char *string, char from, char to)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLI_make_exist(char *dir) {
|
void BLI_make_exist(char *dir)
|
||||||
|
{
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
BLI_char_switch(dir, ALTSEP, SEP);
|
BLI_char_switch(dir, ALTSEP, SEP);
|
||||||
@@ -1550,7 +1552,8 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *BLI_first_slash(char *string) {
|
char *BLI_first_slash(char *string)
|
||||||
|
{
|
||||||
char *ffslash, *fbslash;
|
char *ffslash, *fbslash;
|
||||||
|
|
||||||
ffslash= strchr(string, '/');
|
ffslash= strchr(string, '/');
|
||||||
@@ -1563,7 +1566,8 @@ char *BLI_first_slash(char *string) {
|
|||||||
else return fbslash;
|
else return fbslash;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *BLI_last_slash(const char *string) {
|
char *BLI_last_slash(const char *string)
|
||||||
|
{
|
||||||
char *lfslash, *lbslash;
|
char *lfslash, *lbslash;
|
||||||
|
|
||||||
lfslash= strrchr(string, '/');
|
lfslash= strrchr(string, '/');
|
||||||
@@ -1577,7 +1581,8 @@ char *BLI_last_slash(const char *string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* adds a slash if there isnt one there already */
|
/* adds a slash if there isnt one there already */
|
||||||
int BLI_add_slash(char *string) {
|
int BLI_add_slash(char *string)
|
||||||
|
{
|
||||||
int len = strlen(string);
|
int len = strlen(string);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (len==0 || string[len-1]!='\\') {
|
if (len==0 || string[len-1]!='\\') {
|
||||||
@@ -1596,7 +1601,8 @@ int BLI_add_slash(char *string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* removes a slash if there is one */
|
/* removes a slash if there is one */
|
||||||
void BLI_del_slash(char *string) {
|
void BLI_del_slash(char *string)
|
||||||
|
{
|
||||||
int len = strlen(string);
|
int len = strlen(string);
|
||||||
while (len) {
|
while (len) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|||||||
@@ -469,7 +469,8 @@ int BLI_exist(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* would be better in fileops.c except that it needs stat.h so add here */
|
/* would be better in fileops.c except that it needs stat.h so add here */
|
||||||
int BLI_is_dir(const char *file) {
|
int BLI_is_dir(const char *file)
|
||||||
|
{
|
||||||
return S_ISDIR(BLI_exist(file));
|
return S_ISDIR(BLI_exist(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,16 @@
|
|||||||
#include "BLI_dynstr.h"
|
#include "BLI_dynstr.h"
|
||||||
#include "BLI_string.h"
|
#include "BLI_string.h"
|
||||||
|
|
||||||
char *BLI_strdupn(const char *str, const size_t len) {
|
char *BLI_strdupn(const char *str, const size_t len)
|
||||||
|
{
|
||||||
char *n= MEM_mallocN(len+1, "strdup");
|
char *n= MEM_mallocN(len+1, "strdup");
|
||||||
memcpy(n, str, len);
|
memcpy(n, str, len);
|
||||||
n[len]= '\0';
|
n[len]= '\0';
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
char *BLI_strdup(const char *str) {
|
char *BLI_strdup(const char *str)
|
||||||
|
{
|
||||||
return BLI_strdupn(str, strlen(str));
|
return BLI_strdupn(str, strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +69,8 @@ char *BLI_strdupcat(const char *str1, const char *str2)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy) {
|
char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
|
||||||
|
{
|
||||||
size_t srclen= strlen(src);
|
size_t srclen= strlen(src);
|
||||||
size_t cpylen= (srclen>(maxncpy-1))?(maxncpy-1):srclen;
|
size_t cpylen= (srclen>(maxncpy-1))?(maxncpy-1):srclen;
|
||||||
|
|
||||||
@@ -87,7 +90,8 @@ size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
|
|||||||
|
|
||||||
if (n != -1 && n < count) {
|
if (n != -1 && n < count) {
|
||||||
buffer[n] = '\0';
|
buffer[n] = '\0';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
buffer[count-1] = '\0';
|
buffer[count-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +284,8 @@ char *BLI_strcasestr(const char *s, const char *find)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int BLI_strcasecmp(const char *s1, const char *s2) {
|
int BLI_strcasecmp(const char *s1, const char *s2)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; ; i++) {
|
for (i=0; ; i++) {
|
||||||
@@ -299,7 +304,8 @@ int BLI_strcasecmp(const char *s1, const char *s2) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BLI_strncasecmp(const char *s1, const char *s2, size_t len) {
|
int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
|
|||||||
@@ -218,7 +218,8 @@ static void *tslot_thread_start(void *tslot_p)
|
|||||||
return tslot->do_thread(tslot->callerdata);
|
return tslot->do_thread(tslot->callerdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BLI_thread_is_main(void) {
|
int BLI_thread_is_main(void)
|
||||||
|
{
|
||||||
return pthread_equal(pthread_self(), mainid);
|
return pthread_equal(pthread_self(), mainid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,8 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
|
|||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLO_blendhandle_close(BlendHandle *bh) {
|
void BLO_blendhandle_close(BlendHandle *bh)
|
||||||
|
{
|
||||||
FileData *fd= (FileData*) bh;
|
FileData *fd= (FileData*) bh;
|
||||||
|
|
||||||
blo_freefiledata(fd);
|
blo_freefiledata(fd);
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
|
|||||||
|
|
||||||
|
|
||||||
//sets the rna_path and array index to curve
|
//sets the rna_path and array index to curve
|
||||||
void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , char* rna_path , int array_index )
|
void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index )
|
||||||
{
|
{
|
||||||
std::vector<FCurve*>::iterator it;
|
std::vector<FCurve*>::iterator it;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
|
|
||||||
int setAnimType ( const COLLADAFW::Animatable * prop , int type, int addition);
|
int setAnimType ( const COLLADAFW::Animatable * prop , int type, int addition);
|
||||||
|
|
||||||
void modify_fcurve(std::vector<FCurve*>* curves , char* rna_path , int array_index );
|
void modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index );
|
||||||
// prerequisites:
|
// prerequisites:
|
||||||
// animlist_map - map animlist id -> animlist
|
// animlist_map - map animlist id -> animlist
|
||||||
// curve_map - map anim id -> curve(s)
|
// curve_map - map anim id -> curve(s)
|
||||||
|
|||||||
@@ -6537,8 +6537,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
|
|||||||
return nu;
|
return nu;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) {
|
static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
|
||||||
|
{
|
||||||
Object *obedit= CTX_data_edit_object(C);
|
Object *obedit= CTX_data_edit_object(C);
|
||||||
ListBase *editnurb;
|
ListBase *editnurb;
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
@@ -6607,11 +6607,13 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
|
|||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int curve_prim_add(bContext *C, wmOperator *op, int type) {
|
static int curve_prim_add(bContext *C, wmOperator *op, int type)
|
||||||
|
{
|
||||||
return curvesurf_prim_add(C, op, type, 0);
|
return curvesurf_prim_add(C, op, type, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int surf_prim_add(bContext *C, wmOperator *op, int type) {
|
static int surf_prim_add(bContext *C, wmOperator *op, int type)
|
||||||
|
{
|
||||||
return curvesurf_prim_add(C, op, type, 1);
|
return curvesurf_prim_add(C, op, type, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2804,7 +2804,8 @@ uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x1, i
|
|||||||
* otherwise return -1.
|
* otherwise return -1.
|
||||||
* (1<<findBitIndex(x))==x for powers of two.
|
* (1<<findBitIndex(x))==x for powers of two.
|
||||||
*/
|
*/
|
||||||
static int findBitIndex(unsigned int x) {
|
static int findBitIndex(unsigned int x)
|
||||||
|
{
|
||||||
if (!x || (x&(x-1))!=0) { /* x&(x-1) strips lowest bit */
|
if (!x || (x&(x-1))!=0) { /* x&(x-1) strips lowest bit */
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -883,7 +883,8 @@ static void multiresbake_start(MultiresBakeRender *bkr)
|
|||||||
finish_images(bkr);
|
finish_images(bkr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int multiresbake_check(bContext *C, wmOperator *op) {
|
static int multiresbake_check(bContext *C, wmOperator *op)
|
||||||
|
{
|
||||||
Scene *scene= CTX_data_scene(C);
|
Scene *scene= CTX_data_scene(C);
|
||||||
Object *ob;
|
Object *ob;
|
||||||
Mesh *me;
|
Mesh *me;
|
||||||
|
|||||||
@@ -756,7 +756,8 @@ static void vgroup_normalize(Object *ob)
|
|||||||
It returns the number that it added (0-2)
|
It returns the number that it added (0-2)
|
||||||
It relies on verts having -1 for unassigned indices
|
It relies on verts having -1 for unassigned indices
|
||||||
*/
|
*/
|
||||||
static int tryToAddVerts(int *verts, int length, int a, int b) {
|
static int tryToAddVerts(int *verts, int length, int a, int b)
|
||||||
|
{
|
||||||
char containsA = FALSE;
|
char containsA = FALSE;
|
||||||
char containsB = FALSE;
|
char containsB = FALSE;
|
||||||
int added = 0;
|
int added = 0;
|
||||||
@@ -786,7 +787,8 @@ and returns an array of indices of size count
|
|||||||
|
|
||||||
count is an int passed by reference so it can be assigned the value of the length here.
|
count is an int passed by reference so it can be assigned the value of the length here.
|
||||||
*/
|
*/
|
||||||
static int* getSurroundingVerts(Mesh *me, int vert, int *count) {
|
static int* getSurroundingVerts(Mesh *me, int vert, int *count)
|
||||||
|
{
|
||||||
int length = 0;
|
int length = 0;
|
||||||
int *tverts;
|
int *tverts;
|
||||||
int *verts = NULL;
|
int *verts = NULL;
|
||||||
@@ -848,7 +850,8 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count) {
|
|||||||
/* get a single point in space by averaging a point cloud (vectors of size 3)
|
/* get a single point in space by averaging a point cloud (vectors of size 3)
|
||||||
coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
|
coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
|
||||||
*/
|
*/
|
||||||
static void getSingleCoordinate(MVert *points, int count, float coord[3]) {
|
static void getSingleCoordinate(MVert *points, int count, float coord[3])
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
zero_v3(coord);
|
zero_v3(coord);
|
||||||
for(i = 0; i < count; i++) {
|
for(i = 0; i < count; i++) {
|
||||||
@@ -875,7 +878,8 @@ static void getNearestPointOnPlane(const float norm[3], const float coord[3], co
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* distance of two vectors a and b of size length */
|
/* distance of two vectors a and b of size length */
|
||||||
static float distance(float* a, float *b, int length) {
|
static float distance(float* a, float *b, int length)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
for(i = 0; i < length; i++) {
|
for(i = 0; i < length; i++) {
|
||||||
@@ -888,7 +892,8 @@ static float distance(float* a, float *b, int length) {
|
|||||||
compute the amount of vertical distance relative to the plane and store it in dists,
|
compute the amount of vertical distance relative to the plane and store it in dists,
|
||||||
then get the horizontal and vertical change and store them in changes
|
then get the horizontal and vertical change and store them in changes
|
||||||
*/
|
*/
|
||||||
static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, float *end, float (*changes)[2], float *dists, int index) {
|
static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, float *end, float (*changes)[2], float *dists, int index)
|
||||||
|
{
|
||||||
// A=Q-((Q-P).N)N
|
// A=Q-((Q-P).N)N
|
||||||
// D = (a*x0 + b*y0 +c*z0 +d)
|
// D = (a*x0 + b*y0 +c*z0 +d)
|
||||||
float projA[3] = {0}, projB[3] = {0};
|
float projA[3] = {0}, projB[3] = {0};
|
||||||
@@ -906,7 +911,8 @@ static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, f
|
|||||||
}
|
}
|
||||||
|
|
||||||
// I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc)
|
// I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc)
|
||||||
static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
|
static void dm_deform_clear(DerivedMesh *dm, Object *ob)
|
||||||
|
{
|
||||||
if(ob->derivedDeform && (ob->derivedDeform)==dm) {
|
if(ob->derivedDeform && (ob->derivedDeform)==dm) {
|
||||||
ob->derivedDeform->needsFree = 1;
|
ob->derivedDeform->needsFree = 1;
|
||||||
ob->derivedDeform->release(ob->derivedDeform);
|
ob->derivedDeform->release(ob->derivedDeform);
|
||||||
@@ -919,7 +925,8 @@ static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// recalculate the deformation
|
// recalculate the deformation
|
||||||
static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob) {
|
static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob)
|
||||||
|
{
|
||||||
return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
|
return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,7 +938,8 @@ index is the index of the vertex being moved
|
|||||||
norm and d are the plane's properties for the equation: ax + by + cz + d = 0
|
norm and d are the plane's properties for the equation: ax + by + cz + d = 0
|
||||||
coord is a point on the plane
|
coord is a point on the plane
|
||||||
*/
|
*/
|
||||||
static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], float coord[3], float d, float distToBe, float strength, float cp) {
|
static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], float coord[3], float d, float distToBe, float strength, float cp)
|
||||||
|
{
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
MDeformWeight *dw;
|
MDeformWeight *dw;
|
||||||
MVert m;
|
MVert m;
|
||||||
|
|||||||
@@ -364,7 +364,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad)
|
|||||||
set_inverted_drawing(0);
|
set_inverted_drawing(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments) {
|
void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
@@ -378,7 +379,8 @@ void glutil_draw_filled_arc(float start, float angle, float radius, int nsegment
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments) {
|
void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
@@ -797,7 +799,8 @@ void bglBegin(int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bglPointHack(void) {
|
int bglPointHack(void)
|
||||||
|
{
|
||||||
float value[4];
|
float value[4];
|
||||||
int pointhack_px;
|
int pointhack_px;
|
||||||
glGetFloatv(GL_POINT_SIZE_RANGE, value);
|
glGetFloatv(GL_POINT_SIZE_RANGE, value);
|
||||||
|
|||||||
@@ -1857,11 +1857,13 @@ static int IsectPT2Df_limit(float pt[2], float v1[2], float v2[2], float v3[2],
|
|||||||
/* Clip the face by a bucket and set the uv-space bucket_bounds_uv
|
/* Clip the face by a bucket and set the uv-space bucket_bounds_uv
|
||||||
* so we have the clipped UV's to do pixel intersection tests with
|
* so we have the clipped UV's to do pixel intersection tests with
|
||||||
* */
|
* */
|
||||||
static int float_z_sort_flip(const void *p1, const void *p2) {
|
static int float_z_sort_flip(const void *p1, const void *p2)
|
||||||
|
{
|
||||||
return (((float *)p1)[2] < ((float *)p2)[2] ? 1:-1);
|
return (((float *)p1)[2] < ((float *)p2)[2] ? 1:-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int float_z_sort(const void *p1, const void *p2) {
|
static int float_z_sort(const void *p1, const void *p2)
|
||||||
|
{
|
||||||
return (((float *)p1)[2] < ((float *)p2)[2] ?-1:1);
|
return (((float *)p1)[2] < ((float *)p2)[2] ?-1:1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3686,7 +3688,8 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction) {
|
static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction)
|
||||||
|
{
|
||||||
if (ps->is_texbrush) {
|
if (ps->is_texbrush) {
|
||||||
/* rgba already holds a texture result here from higher level function */
|
/* rgba already holds a texture result here from higher level function */
|
||||||
float rgba_br[3];
|
float rgba_br[3];
|
||||||
|
|||||||
@@ -244,7 +244,8 @@ static int compare_size(const void *a1, const void *a2)
|
|||||||
else return BLI_natstrcmp(entry1->relname,entry2->relname);
|
else return BLI_natstrcmp(entry1->relname,entry2->relname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int compare_extension(const void *a1, const void *a2) {
|
static int compare_extension(const void *a1, const void *a2)
|
||||||
|
{
|
||||||
const struct direntry *entry1=a1, *entry2=a2;
|
const struct direntry *entry1=a1, *entry2=a2;
|
||||||
const char *sufix1, *sufix2;
|
const char *sufix1, *sufix2;
|
||||||
const char *nil="";
|
const char *nil="";
|
||||||
|
|||||||
@@ -3266,7 +3266,8 @@ void NODE_OT_delete(wmOperatorType *ot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** Delete with reconnect ******************* */
|
/* ****************** Delete with reconnect ******************* */
|
||||||
static int is_connected_to_input_socket(bNode* node, bNodeLink* link) {
|
static int is_connected_to_input_socket(bNode* node, bNodeLink* link)
|
||||||
|
{
|
||||||
bNodeSocket *sock;
|
bNodeSocket *sock;
|
||||||
if (link->tonode == node) {
|
if (link->tonode == node) {
|
||||||
for(sock= node->inputs.first; sock; sock= sock->next) {
|
for(sock= node->inputs.first; sock; sock= sock->next) {
|
||||||
|
|||||||
@@ -530,7 +530,8 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
|
|||||||
|
|
||||||
|
|
||||||
/* run recursivly to select linked */
|
/* run recursivly to select linked */
|
||||||
static int select_more_less_seq__internal(Scene *scene, int sel, int linked) {
|
static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
|
||||||
|
{
|
||||||
Editing *ed= seq_give_editing(scene, FALSE);
|
Editing *ed= seq_give_editing(scene, FALSE);
|
||||||
Sequence *seq, *neighbor;
|
Sequence *seq, *neighbor;
|
||||||
int change=0;
|
int change=0;
|
||||||
|
|||||||
@@ -1757,7 +1757,8 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, float *co,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) {
|
static void drawSelectedVertices(DerivedMesh *dm, Mesh *me)
|
||||||
|
{
|
||||||
glBegin(GL_POINTS);
|
glBegin(GL_POINTS);
|
||||||
dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert);
|
dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|||||||
@@ -1270,7 +1270,8 @@ void applyTransObjects(TransInfo *t)
|
|||||||
recalcData(t);
|
recalcData(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void restoreElement(TransData *td) {
|
static void restoreElement(TransData *td)
|
||||||
|
{
|
||||||
/* TransData for crease has no loc */
|
/* TransData for crease has no loc */
|
||||||
if (td->loc) {
|
if (td->loc) {
|
||||||
copy_v3_v3(td->loc, td->iloc);
|
copy_v3_v3(td->loc, td->iloc);
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[
|
|||||||
output[1] *= mi->factor;
|
output[1] *= mi->factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
|
static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||||
|
{
|
||||||
float x, pad;
|
float x, pad;
|
||||||
|
|
||||||
pad = t->ar->winx / 10;
|
pad = t->ar->winx / 10;
|
||||||
@@ -135,7 +136,8 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2]
|
|||||||
output[0] = (x - pad) / (t->ar->winx - 2 * pad);
|
output[0] = (x - pad) / (t->ar->winx - 2 * pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
|
static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||||
|
{
|
||||||
float vec[3];
|
float vec[3];
|
||||||
|
|
||||||
InputVector(t, mi, mval, vec);
|
InputVector(t, mi, mval, vec);
|
||||||
@@ -144,7 +146,8 @@ static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval
|
|||||||
output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f;
|
output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
|
static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||||
|
{
|
||||||
float y, pad;
|
float y, pad;
|
||||||
|
|
||||||
pad = t->ar->winy / 10;
|
pad = t->ar->winy / 10;
|
||||||
@@ -160,7 +163,8 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2],
|
|||||||
output[0] = (y - pad) / (t->ar->winy - 2 * pad);
|
output[0] = (y - pad) / (t->ar->winy - 2 * pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
|
static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||||
|
{
|
||||||
float vec[3];
|
float vec[3];
|
||||||
|
|
||||||
InputVector(t, mi, mval, vec);
|
InputVector(t, mi, mval, vec);
|
||||||
|
|||||||
@@ -1584,7 +1584,8 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mval[2], int *dist, float *loc, float *no, SnapMode mode) {
|
static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mval[2], int *dist, float *loc, float *no, SnapMode mode)
|
||||||
|
{
|
||||||
Base *base;
|
Base *base;
|
||||||
float depth = FLT_MAX;
|
float depth = FLT_MAX;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
@@ -1914,7 +1915,8 @@ int peelObjectsContext(bContext *C, ListBase *depth_peels, float mval[2])
|
|||||||
static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action);
|
static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action);
|
||||||
|
|
||||||
|
|
||||||
void snapGridAction(TransInfo *t, float *val, GearsType action) {
|
void snapGridAction(TransInfo *t, float *val, GearsType action)
|
||||||
|
{
|
||||||
float fac[3];
|
float fac[3];
|
||||||
|
|
||||||
fac[NO_GEARS] = t->snap[0];
|
fac[NO_GEARS] = t->snap[0];
|
||||||
@@ -1925,7 +1927,8 @@ void snapGridAction(TransInfo *t, float *val, GearsType action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void snapGrid(TransInfo *t, float *val) {
|
void snapGrid(TransInfo *t, float *val)
|
||||||
|
{
|
||||||
GearsType action;
|
GearsType action;
|
||||||
|
|
||||||
// Only do something if using Snap to Grid
|
// Only do something if using Snap to Grid
|
||||||
|
|||||||
@@ -1058,7 +1058,8 @@ void GPU_uvedge_setup(DerivedMesh *dm)
|
|||||||
GLStates |= GPU_BUFFER_VERTEX_STATE;
|
GLStates |= GPU_BUFFER_VERTEX_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GPU_typesize(int type) {
|
static int GPU_typesize(int type)
|
||||||
|
{
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case GL_FLOAT:
|
case GL_FLOAT:
|
||||||
return sizeof(float);
|
return sizeof(float);
|
||||||
@@ -1075,7 +1076,8 @@ static int GPU_typesize(int type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GPU_attrib_element_size(GPUAttrib data[], int numdata) {
|
int GPU_attrib_element_size(GPUAttrib data[], int numdata)
|
||||||
|
{
|
||||||
int i, elementsize = 0;
|
int i, elementsize = 0;
|
||||||
|
|
||||||
for(i = 0; i < numdata; i++) {
|
for(i = 0; i < numdata; i++) {
|
||||||
@@ -1086,7 +1088,8 @@ int GPU_attrib_element_size(GPUAttrib data[], int numdata) {
|
|||||||
return elementsize;
|
return elementsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numdata) {
|
void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numdata)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
int elementsize;
|
int elementsize;
|
||||||
intptr_t offset = 0;
|
intptr_t offset = 0;
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ static int checkbmp(unsigned char *mem)
|
|||||||
return(ret_val);
|
return(ret_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int imb_is_a_bmp(unsigned char *buf) {
|
int imb_is_a_bmp(unsigned char *buf)
|
||||||
|
{
|
||||||
return checkbmp(buf);
|
return checkbmp(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,8 +200,8 @@ static int putShortLSB(unsigned short us,FILE *ofile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
|
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
|
||||||
int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) {
|
int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
|
||||||
|
{
|
||||||
BMPINFOHEADER infoheader;
|
BMPINFOHEADER infoheader;
|
||||||
int bytesize, extrabytes, x, y, t, ptr;
|
int bytesize, extrabytes, x, y, t, ptr;
|
||||||
uchar *data;
|
uchar *data;
|
||||||
|
|||||||
@@ -111,7 +111,8 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
|
|||||||
*/
|
*/
|
||||||
/* function assumes out to be zero'ed, only does RGBA */
|
/* function assumes out to be zero'ed, only does RGBA */
|
||||||
|
|
||||||
static float P(float k){
|
static float P(float k)
|
||||||
|
{
|
||||||
float p1, p2, p3, p4;
|
float p1, p2, p3, p4;
|
||||||
p1 = MAX2(k+2.0f,0);
|
p1 = MAX2(k+2.0f,0);
|
||||||
p2 = MAX2(k+1.0f,0);
|
p2 = MAX2(k+1.0f,0);
|
||||||
@@ -123,7 +124,8 @@ static float P(float k){
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* older, slower function, works the same as above */
|
/* older, slower function, works the same as above */
|
||||||
static float P(float k){
|
static float P(float k)
|
||||||
|
{
|
||||||
return (float)(1.0f/6.0f)*( pow( MAX2(k+2.0f,0) , 3.0f ) - 4.0f * pow( MAX2(k+1.0f,0) , 3.0f ) + 6.0f * pow( MAX2(k,0) , 3.0f ) - 4.0f * pow( MAX2(k-1.0f,0) , 3.0f));
|
return (float)(1.0f/6.0f)*( pow( MAX2(k+2.0f,0) , 3.0f ) - 4.0f * pow( MAX2(k+1.0f,0) , 3.0f ) + 6.0f * pow( MAX2(k,0) , 3.0f ) - 4.0f * pow( MAX2(k-1.0f,0) , 3.0f));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ static unsigned long bitstream_get_bits(indexer_dv_bitstream * This, int num)
|
|||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_num(indexer_dv_bitstream * b, int numbits) {
|
static int parse_num(indexer_dv_bitstream * b, int numbits)
|
||||||
|
{
|
||||||
return bitstream_get_bits(b, numbits);
|
return bitstream_get_bits(b, numbits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ type 3 is unsupported as of jul 05 2000 Frank.
|
|||||||
static int jpeg_default_quality;
|
static int jpeg_default_quality;
|
||||||
static int ibuf_ftype;
|
static int ibuf_ftype;
|
||||||
|
|
||||||
int imb_is_a_jpeg(unsigned char *mem) {
|
int imb_is_a_jpeg(unsigned char *mem)
|
||||||
|
{
|
||||||
if ((mem[0]== 0xFF) && (mem[1] == 0xD8))return 1;
|
if ((mem[0]== 0xFF) && (mem[1] == 0xD8))return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,7 +338,8 @@ static int checktarga(TARGA *tga, unsigned char *mem)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int imb_is_a_targa(unsigned char *buf) {
|
int imb_is_a_targa(unsigned char *buf)
|
||||||
|
{
|
||||||
TARGA tga;
|
TARGA tga;
|
||||||
|
|
||||||
return checktarga(&tga, buf);
|
return checktarga(&tga, buf);
|
||||||
|
|||||||
@@ -543,7 +543,8 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm){
|
static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
|
||||||
|
{
|
||||||
DerivedMesh *splitdm;
|
DerivedMesh *splitdm;
|
||||||
MFace *mf=NULL,*df1=NULL;
|
MFace *mf=NULL,*df1=NULL;
|
||||||
MFace *mface=dm->getFaceArray(dm);
|
MFace *mface=dm->getFaceArray(dm);
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Adds the given vertex to the specified vertex group, with given weight. */
|
/* Adds the given vertex to the specified vertex group, with given weight. */
|
||||||
static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight) {
|
static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight)
|
||||||
|
{
|
||||||
/* TODO, move into deform.c as a generic function. This assumes the vertex
|
/* TODO, move into deform.c as a generic function. This assumes the vertex
|
||||||
* groups have already been checked, so this has to remain low level. */
|
* groups have already been checked, so this has to remain low level. */
|
||||||
MDeformWeight *newdw;
|
MDeformWeight *newdw;
|
||||||
@@ -244,7 +245,8 @@ static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float we
|
|||||||
/* Removes the given vertex from the vertex group, specified either by its defgrp_idx,
|
/* Removes the given vertex from the vertex group, specified either by its defgrp_idx,
|
||||||
* or directly by its MDeformWeight pointer, if dw is not NULL.
|
* or directly by its MDeformWeight pointer, if dw is not NULL.
|
||||||
* WARNING: This function frees the given MDeformWeight, do not use it afterward! */
|
* WARNING: This function frees the given MDeformWeight, do not use it afterward! */
|
||||||
static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw) {
|
static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw)
|
||||||
|
{
|
||||||
/* TODO, move this into deform.c as a generic function. */
|
/* TODO, move this into deform.c as a generic function. */
|
||||||
MDeformWeight *newdw;
|
MDeformWeight *newdw;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -174,7 +174,8 @@ static void group_move_outputs(bNode *node, bNodeStack **out, bNodeStack *gstack
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free internal buffers */
|
/* Free internal buffers */
|
||||||
static void group_free_internal(bNodeTreeExec *gexec) {
|
static void group_free_internal(bNodeTreeExec *gexec)
|
||||||
|
{
|
||||||
bNodeStack *ns;
|
bNodeStack *ns;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ int PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObje
|
|||||||
|
|
||||||
|
|
||||||
/* for debugging */
|
/* for debugging */
|
||||||
void PyC_ObSpit(const char *name, PyObject *var) {
|
void PyC_ObSpit(const char *name, PyObject *var)
|
||||||
|
{
|
||||||
fprintf(stderr, "<%s> : ", name);
|
fprintf(stderr, "<%s> : ", name);
|
||||||
if (var==NULL) {
|
if (var==NULL) {
|
||||||
fprintf(stderr, "<NIL>");
|
fprintf(stderr, "<NIL>");
|
||||||
@@ -126,7 +127,8 @@ void PyC_ObSpit(const char *name, PyObject *var) {
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PyC_LineSpit(void) {
|
void PyC_LineSpit(void)
|
||||||
|
{
|
||||||
|
|
||||||
const char *filename;
|
const char *filename;
|
||||||
int lineno;
|
int lineno;
|
||||||
|
|||||||
@@ -4140,8 +4140,8 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *
|
|||||||
|
|
||||||
/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
|
/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
|
||||||
* todo - also accept useful args */
|
* todo - also accept useful args */
|
||||||
static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) {
|
static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
|
||||||
|
{
|
||||||
BPy_PropertyRNA *base;
|
BPy_PropertyRNA *base;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O!:bpy_prop.__new__", &pyrna_prop_Type, &base))
|
if (!PyArg_ParseTuple(args, "O!:bpy_prop.__new__", &pyrna_prop_Type, &base))
|
||||||
|
|||||||
@@ -317,8 +317,8 @@ are for */
|
|||||||
#define BEGIN_CURSOR_BLOCK {
|
#define BEGIN_CURSOR_BLOCK {
|
||||||
#define END_CURSOR_BLOCK }
|
#define END_CURSOR_BLOCK }
|
||||||
|
|
||||||
void wm_init_cursor_data(void){
|
void wm_init_cursor_data(void)
|
||||||
|
{
|
||||||
/********************** NW_ARROW Cursor **************************/
|
/********************** NW_ARROW Cursor **************************/
|
||||||
BEGIN_CURSOR_BLOCK
|
BEGIN_CURSOR_BLOCK
|
||||||
static char nw_sbm[]={
|
static char nw_sbm[]={
|
||||||
|
|||||||
@@ -863,7 +863,8 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
|
|||||||
RNA_def_boolean(ot->srna, "relative_path", (U.flag & USER_RELPATHS) ? 1:0, "Relative Path", "Select the file relative to the blend file");
|
RNA_def_boolean(ot->srna, "relative_path", (U.flag & USER_RELPATHS) ? 1:0, "Relative Path", "Select the file relative to the blend file");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WM_operator_properties_select_all(wmOperatorType *ot) {
|
void WM_operator_properties_select_all(wmOperatorType *ot)
|
||||||
|
{
|
||||||
static EnumPropertyItem select_all_actions[] = {
|
static EnumPropertyItem select_all_actions[] = {
|
||||||
{SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"},
|
{SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"},
|
||||||
{SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"},
|
{SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"},
|
||||||
|
|||||||
Reference in New Issue
Block a user