Merging r47677 through r47683 from trunk into soc-2011-tomato
This commit is contained in:
@@ -840,7 +840,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_ind
|
||||
*ob = copyob;
|
||||
}
|
||||
|
||||
typedef struct vertexDupliData {
|
||||
typedef struct VertexDupliData {
|
||||
ID *id; /* scene or group, for recursive loops */
|
||||
int level;
|
||||
int animated;
|
||||
@@ -851,7 +851,7 @@ typedef struct vertexDupliData {
|
||||
Object *ob, *par;
|
||||
float (*orco)[3];
|
||||
int par_index;
|
||||
} vertexDupliData;
|
||||
} VertexDupliData;
|
||||
|
||||
/* ------------- */
|
||||
|
||||
@@ -859,7 +859,7 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
|
||||
const float no_f[3], const short no_s[3])
|
||||
{
|
||||
DupliObject *dob;
|
||||
vertexDupliData *vdd = userData;
|
||||
VertexDupliData *vdd = userData;
|
||||
float vec[3], q2[4], mat[3][3], tmat[4][4], obmat[4][4];
|
||||
int origlay;
|
||||
|
||||
@@ -910,7 +910,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
|
||||
Mesh *me = par->data;
|
||||
Base *base = NULL;
|
||||
DerivedMesh *dm;
|
||||
vertexDupliData vdd;
|
||||
VertexDupliData vdd;
|
||||
Scene *sce = NULL;
|
||||
Group *group = NULL;
|
||||
GroupObject *go = NULL;
|
||||
|
||||
@@ -2722,15 +2722,17 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
|
||||
|
||||
void BKE_image_user_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
|
||||
{
|
||||
const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr);
|
||||
|
||||
/* allows image users to handle redraws */
|
||||
if (iuser->flag & IMA_ANIM_ALWAYS)
|
||||
if (framenr != iuser->framenr)
|
||||
iuser->flag |= IMA_ANIM_REFRESHED;
|
||||
|
||||
iuser->framenr = framenr;
|
||||
if (iuser->ok == 0) iuser->ok = 1;
|
||||
if (iuser) {
|
||||
const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr);
|
||||
|
||||
/* allows image users to handle redraws */
|
||||
if (iuser->flag & IMA_ANIM_ALWAYS)
|
||||
if (framenr != iuser->framenr)
|
||||
iuser->flag |= IMA_ANIM_REFRESHED;
|
||||
|
||||
iuser->framenr = framenr;
|
||||
if (iuser->ok == 0) iuser->ok = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_image_user_check_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "BLO_sys_types.h" /* for intptr_t */
|
||||
#include "BLO_sys_types.h" /* for intptr_t */
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
@@ -38,21 +38,21 @@
|
||||
|
||||
#include "IMB_moviecache.h"
|
||||
|
||||
typedef struct seqCacheKey {
|
||||
struct Sequence * seq;
|
||||
typedef struct SeqCacheKey {
|
||||
struct Sequence *seq;
|
||||
SeqRenderData context;
|
||||
float cfra;
|
||||
seq_stripelem_ibuf_t type;
|
||||
} seqCacheKey;
|
||||
} SeqCacheKey;
|
||||
|
||||
static struct MovieCache *moviecache = NULL;
|
||||
|
||||
static unsigned int seqcache_hashhash(const void *key_)
|
||||
{
|
||||
const seqCacheKey *key = (seqCacheKey*) key_;
|
||||
const SeqCacheKey *key = (SeqCacheKey *) key_;
|
||||
unsigned int rval = seq_hash_render_data(&key->context);
|
||||
|
||||
rval ^= *(unsigned int*) &key->cfra;
|
||||
rval ^= *(unsigned int *) &key->cfra;
|
||||
rval += key->type;
|
||||
rval ^= ((intptr_t) key->seq) << 6;
|
||||
|
||||
@@ -61,11 +61,11 @@ static unsigned int seqcache_hashhash(const void *key_)
|
||||
|
||||
static int seqcache_hashcmp(const void *a_, const void *b_)
|
||||
{
|
||||
const seqCacheKey * a = (seqCacheKey*) a_;
|
||||
const seqCacheKey * b = (seqCacheKey*) b_;
|
||||
const SeqCacheKey *a = (SeqCacheKey *) a_;
|
||||
const SeqCacheKey *b = (SeqCacheKey *) b_;
|
||||
|
||||
if (a->seq < b->seq) {
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
if (a->seq > b->seq) {
|
||||
return 1;
|
||||
@@ -98,18 +98,18 @@ void seq_stripelem_cache_cleanup(void)
|
||||
{
|
||||
if (moviecache) {
|
||||
IMB_moviecache_free(moviecache);
|
||||
moviecache = IMB_moviecache_create(sizeof(seqCacheKey), seqcache_hashhash,
|
||||
seqcache_hashcmp, NULL);
|
||||
moviecache = IMB_moviecache_create(sizeof(SeqCacheKey), seqcache_hashhash,
|
||||
seqcache_hashcmp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
struct ImBuf * seq_stripelem_cache_get(
|
||||
SeqRenderData context, struct Sequence * seq,
|
||||
float cfra, seq_stripelem_ibuf_t type)
|
||||
struct ImBuf *seq_stripelem_cache_get(
|
||||
SeqRenderData context, struct Sequence *seq,
|
||||
float cfra, seq_stripelem_ibuf_t type)
|
||||
{
|
||||
|
||||
if (moviecache && seq) {
|
||||
seqCacheKey key;
|
||||
SeqCacheKey key;
|
||||
|
||||
key.seq = seq;
|
||||
key.context = context;
|
||||
@@ -123,18 +123,18 @@ struct ImBuf * seq_stripelem_cache_get(
|
||||
}
|
||||
|
||||
void seq_stripelem_cache_put(
|
||||
SeqRenderData context, struct Sequence * seq,
|
||||
float cfra, seq_stripelem_ibuf_t type, struct ImBuf * i)
|
||||
SeqRenderData context, struct Sequence *seq,
|
||||
float cfra, seq_stripelem_ibuf_t type, struct ImBuf *i)
|
||||
{
|
||||
seqCacheKey key;
|
||||
SeqCacheKey key;
|
||||
|
||||
if (!i) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!moviecache) {
|
||||
moviecache = IMB_moviecache_create(sizeof(seqCacheKey), seqcache_hashhash,
|
||||
seqcache_hashcmp, NULL);
|
||||
moviecache = IMB_moviecache_create(sizeof(SeqCacheKey), seqcache_hashhash,
|
||||
seqcache_hashcmp, NULL);
|
||||
}
|
||||
|
||||
key.seq = seq;
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct BoxPack {
|
||||
|
||||
/* Verts this box uses
|
||||
* (BL,TR,TL,BR) / 0,1,2,3 */
|
||||
struct boxVert *v[4];
|
||||
struct BoxVert *v[4];
|
||||
} BoxPack;
|
||||
|
||||
void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
*
|
||||
* The defined Below are for internal use only */
|
||||
|
||||
typedef struct boxVert {
|
||||
typedef struct BoxVert {
|
||||
float x;
|
||||
float y;
|
||||
short free;
|
||||
@@ -48,7 +48,7 @@ typedef struct boxVert {
|
||||
struct BoxPack *isect_cache[4];
|
||||
|
||||
int index;
|
||||
} boxVert;
|
||||
} BoxVert;
|
||||
|
||||
/* free vert flags */
|
||||
#define EPSILON 0.0000001f
|
||||
@@ -121,11 +121,11 @@ static int box_areasort(const void *p1, const void *p2)
|
||||
* */
|
||||
static float box_width;
|
||||
static float box_height;
|
||||
static boxVert *vertarray;
|
||||
static BoxVert *vertarray;
|
||||
|
||||
static int vertex_sort(const void *p1, const void *p2)
|
||||
{
|
||||
boxVert *v1, *v2;
|
||||
BoxVert *v1, *v2;
|
||||
float a1, a2;
|
||||
|
||||
v1 = vertarray + ((int *)p1)[0];
|
||||
@@ -154,7 +154,7 @@ static int vertex_sort(const void *p1, const void *p2)
|
||||
* */
|
||||
void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height)
|
||||
{
|
||||
boxVert *vert; /* the current vert */
|
||||
BoxVert *vert; /* the current vert */
|
||||
int box_index, verts_pack_len, i, j, k, isect;
|
||||
int quad_flags[4] = {BLF, TRF, TLF, BRF}; /* use for looping */
|
||||
BoxPack *box, *box_test; /*current box and another for intersection tests*/
|
||||
@@ -170,38 +170,38 @@ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *
|
||||
qsort(boxarray, len, sizeof(BoxPack), box_areasort);
|
||||
|
||||
/* add verts to the boxes, these are only used internally */
|
||||
vert = vertarray = MEM_mallocN(len * 4 * sizeof(boxVert), "BoxPack Verts");
|
||||
vert = vertarray = MEM_mallocN(len * 4 * sizeof(BoxVert), "BoxPack Verts");
|
||||
vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "BoxPack Indices");
|
||||
|
||||
for (box = boxarray, box_index = 0, i = 0; box_index < len; box_index++, box++) {
|
||||
|
||||
vert->blb = vert->brb = vert->tlb =
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->free = CORNERFLAGS & ~TRF;
|
||||
vert->trb = box;
|
||||
vert->index = i; i++;
|
||||
box->v[BL] = vert; vert++;
|
||||
|
||||
vert->trb = vert->brb = vert->tlb =
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->free = CORNERFLAGS & ~BLF;
|
||||
vert->blb = box;
|
||||
vert->index = i; i++;
|
||||
box->v[TR] = vert; vert++;
|
||||
|
||||
vert->trb = vert->blb = vert->tlb =
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->free = CORNERFLAGS & ~BRF;
|
||||
vert->brb = box;
|
||||
vert->index = i; i++;
|
||||
box->v[TL] = vert; vert++;
|
||||
|
||||
vert->trb = vert->blb = vert->brb =
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->isect_cache[0] = vert->isect_cache[1] =
|
||||
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
|
||||
vert->free = CORNERFLAGS & ~TLF;
|
||||
vert->tlb = box;
|
||||
vert->index = i; i++;
|
||||
|
||||
@@ -385,16 +385,16 @@ int BLI_rename(const char *from, const char *to)
|
||||
|
||||
enum {
|
||||
/* operation succeeded succeeded */
|
||||
recursiveOp_Callback_OK = 0,
|
||||
RecursiveOp_Callback_OK = 0,
|
||||
|
||||
/* operation requested not to perform recursive digging for current path */
|
||||
recursiveOp_Callback_StopRecurs = 1,
|
||||
RecursiveOp_Callback_StopRecurs = 1,
|
||||
|
||||
/* error occured in callback and recursive walking should stop immediately */
|
||||
recursiveOp_Callback_Error = 2
|
||||
RecursiveOp_Callback_Error = 2
|
||||
} recuresiveOp_Callback_Result;
|
||||
|
||||
typedef int (*recursiveOp_Callback)(const char *from, const char *to);
|
||||
typedef int (*RecursiveOp_Callback)(const char *from, const char *to);
|
||||
|
||||
/* appending of filename to dir (ensures for buffer size before appending) */
|
||||
static void join_dirfile_alloc(char **dst, size_t *alloc_len, const char *dir, const char *file)
|
||||
@@ -419,8 +419,8 @@ static char *strip_last_slash(const char *dir)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int recursive_operation(const char *startfrom, const char *startto, recursiveOp_Callback callback_dir_pre,
|
||||
recursiveOp_Callback callback_file, recursiveOp_Callback callback_dir_post)
|
||||
static int recursive_operation(const char *startfrom, const char *startto, RecursiveOp_Callback callback_dir_pre,
|
||||
RecursiveOp_Callback callback_file, RecursiveOp_Callback callback_dir_post)
|
||||
{
|
||||
struct dirent **dirlist;
|
||||
struct stat st;
|
||||
@@ -446,7 +446,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur
|
||||
if (callback_file) {
|
||||
ret = callback_file(from, to);
|
||||
|
||||
if (ret != recursiveOp_Callback_OK)
|
||||
if (ret != RecursiveOp_Callback_OK)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
@@ -472,11 +472,11 @@ static int recursive_operation(const char *startfrom, const char *startto, recur
|
||||
/* call pre-recursive walking directory callback */
|
||||
ret = callback_dir_pre(from, to);
|
||||
|
||||
if (ret != recursiveOp_Callback_OK) {
|
||||
if (ret != RecursiveOp_Callback_OK) {
|
||||
MEM_freeN(from);
|
||||
if (to) free(to);
|
||||
|
||||
if (ret == recursiveOp_Callback_StopRecurs) {
|
||||
if (ret == RecursiveOp_Callback_StopRecurs) {
|
||||
/* callback requested not to perform recursive walking, not an error */
|
||||
return 0;
|
||||
}
|
||||
@@ -505,7 +505,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur
|
||||
else if (callback_file) {
|
||||
/* call file callback for current path */
|
||||
ret = callback_file(from_path, to_path);
|
||||
if (ret != recursiveOp_Callback_OK)
|
||||
if (ret != RecursiveOp_Callback_OK)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur
|
||||
if (callback_dir_post) {
|
||||
/* call post-recursive directory callback */
|
||||
ret = callback_dir_post(from, to);
|
||||
if (ret != recursiveOp_Callback_OK)
|
||||
if (ret != RecursiveOp_Callback_OK)
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
@@ -541,10 +541,10 @@ static int delete_callback_post(const char *from, const char *UNUSED(to))
|
||||
if (rmdir(from)) {
|
||||
perror("rmdir");
|
||||
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
|
||||
static int delete_single_file(const char *from, const char *UNUSED(to))
|
||||
@@ -552,10 +552,10 @@ static int delete_single_file(const char *from, const char *UNUSED(to))
|
||||
if (unlink(from)) {
|
||||
perror("unlink");
|
||||
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
|
||||
FILE *BLI_fopen(const char *filename, const char *mode)
|
||||
@@ -628,27 +628,27 @@ static int copy_callback_pre(const char *from, const char *to)
|
||||
|
||||
if (check_the_same(from, to)) {
|
||||
fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to);
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
if (lstat(from, &st)) {
|
||||
perror("stat");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
/* create a directory */
|
||||
if (mkdir(to, st.st_mode)) {
|
||||
perror("mkdir");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
/* set proper owner and group on new directory */
|
||||
if (chown(to, st.st_uid, st.st_gid)) {
|
||||
perror("chown");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
|
||||
static int copy_single_file(const char *from, const char *to)
|
||||
@@ -660,12 +660,12 @@ static int copy_single_file(const char *from, const char *to)
|
||||
|
||||
if (check_the_same(from, to)) {
|
||||
fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to);
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
if (lstat(from, &st)) {
|
||||
perror("lstat");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
if (S_ISLNK(st.st_mode)) {
|
||||
@@ -690,7 +690,7 @@ static int copy_single_file(const char *from, const char *to)
|
||||
|
||||
if (need_free) MEM_freeN(link_buffer);
|
||||
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
link_buffer[link_len] = 0;
|
||||
@@ -698,13 +698,13 @@ static int copy_single_file(const char *from, const char *to)
|
||||
if (symlink(link_buffer, to)) {
|
||||
perror("symlink");
|
||||
if (need_free) MEM_freeN(link_buffer);
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
if (need_free)
|
||||
MEM_freeN(link_buffer);
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
else if (S_ISCHR(st.st_mode) ||
|
||||
S_ISBLK(st.st_mode) ||
|
||||
@@ -714,30 +714,30 @@ static int copy_single_file(const char *from, const char *to)
|
||||
/* copy special type of file */
|
||||
if (mknod(to, st.st_mode, st.st_rdev)) {
|
||||
perror("mknod");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
if (set_permissions(to, &st))
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
else if (!S_ISREG(st.st_mode)) {
|
||||
fprintf(stderr, "Copying of this kind of files isn't supported yet\n");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
from_stream = fopen(from, "rb");
|
||||
if (!from_stream) {
|
||||
perror("fopen");
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
to_stream = fopen(to, "wb");
|
||||
if (!to_stream) {
|
||||
perror("fopen");
|
||||
fclose(from_stream);
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
}
|
||||
|
||||
while ((len = fread(buf, 1, sizeof(buf), from_stream)) > 0) {
|
||||
@@ -748,9 +748,9 @@ static int copy_single_file(const char *from, const char *to)
|
||||
fclose(from_stream);
|
||||
|
||||
if (set_permissions(to, &st))
|
||||
return recursiveOp_Callback_Error;
|
||||
return RecursiveOp_Callback_Error;
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
|
||||
static int move_callback_pre(const char *from, const char *to)
|
||||
@@ -760,7 +760,7 @@ static int move_callback_pre(const char *from, const char *to)
|
||||
if (ret)
|
||||
return copy_callback_pre(from, to);
|
||||
|
||||
return recursiveOp_Callback_StopRecurs;
|
||||
return RecursiveOp_Callback_StopRecurs;
|
||||
}
|
||||
|
||||
static int move_single_file(const char *from, const char *to)
|
||||
@@ -770,7 +770,7 @@ static int move_single_file(const char *from, const char *to)
|
||||
if (ret)
|
||||
return copy_single_file(from, to);
|
||||
|
||||
return recursiveOp_Callback_OK;
|
||||
return RecursiveOp_Callback_OK;
|
||||
}
|
||||
|
||||
int BLI_move(const char *file, const char *to)
|
||||
|
||||
@@ -374,16 +374,16 @@ void smooth_fcurve(FCurve *fcu)
|
||||
/* ---------------- */
|
||||
|
||||
/* little cache for values... */
|
||||
typedef struct tempFrameValCache {
|
||||
typedef struct TempFrameValCache {
|
||||
float frame, val;
|
||||
} tempFrameValCache;
|
||||
} TempFrameValCache;
|
||||
|
||||
|
||||
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
|
||||
void sample_fcurve(FCurve *fcu)
|
||||
{
|
||||
BezTriple *bezt, *start = NULL, *end = NULL;
|
||||
tempFrameValCache *value_cache, *fp;
|
||||
TempFrameValCache *value_cache, *fp;
|
||||
int sfra, range;
|
||||
int i, n, nIndex;
|
||||
|
||||
@@ -406,7 +406,7 @@ void sample_fcurve(FCurve *fcu)
|
||||
sfra = (int)(floor(start->vec[1][0]) );
|
||||
|
||||
if (range) {
|
||||
value_cache = MEM_callocN(sizeof(tempFrameValCache) * range, "IcuFrameValCache");
|
||||
value_cache = MEM_callocN(sizeof(TempFrameValCache) * range, "IcuFrameValCache");
|
||||
|
||||
/* sample values */
|
||||
for (n = 1, fp = value_cache; n < range && fp; n++, fp++) {
|
||||
|
||||
@@ -195,7 +195,8 @@ typedef struct uiLayout uiLayout;
|
||||
/*#define FUN 192*/ /*UNUSED*/
|
||||
#define BIT 256
|
||||
|
||||
#define BUTPOIN (128 + 64 + 32)
|
||||
/* button reqyires a pointer */
|
||||
#define BUTPOIN (FLO | SHO | CHA)
|
||||
|
||||
#define BUT (1 << 9)
|
||||
#define ROW (2 << 9)
|
||||
|
||||
@@ -3819,22 +3819,21 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
|
||||
Histogram *hist = (Histogram *)but->poin;
|
||||
/* rcti rect; */
|
||||
int changed = 1;
|
||||
float /* dx, */ dy, yfac = 1.f; /* UNUSED */
|
||||
float /* dx, */ dy; /* UNUSED */
|
||||
|
||||
/* rect.xmin = but->x1; rect.xmax = but->x2; */
|
||||
/* rect.ymin = but->y1; rect.ymax = but->y2; */
|
||||
|
||||
/* dx = mx - data->draglastx; */ /* UNUSED */
|
||||
dy = my - data->draglasty;
|
||||
|
||||
|
||||
|
||||
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
|
||||
/* resize histogram widget itself */
|
||||
hist->height = (but->y2 - but->y1) + (data->dragstarty - my);
|
||||
}
|
||||
else {
|
||||
/* scale histogram values */
|
||||
yfac = MIN2(powf(hist->ymax, 2.f), 1.f) * 0.5f;
|
||||
const float yfac = MIN2(powf(hist->ymax, 2.f), 1.f) * 0.5f;
|
||||
hist->ymax += dy * yfac;
|
||||
|
||||
CLAMP(hist->ymax, 1.f, 100.f);
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
/* ringsel operator */
|
||||
|
||||
/* struct for properties used while drawing */
|
||||
typedef struct tringselOpData {
|
||||
typedef struct RingSelOpData {
|
||||
ARegion *ar; /* region that ringsel was activated in */
|
||||
void *draw_handle; /* for drawing preview loop */
|
||||
|
||||
@@ -102,13 +102,13 @@ typedef struct tringselOpData {
|
||||
|
||||
int extend;
|
||||
int do_cut;
|
||||
} tringselOpData;
|
||||
} RingSelOpData;
|
||||
|
||||
/* modal loop selection drawing callback */
|
||||
static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
tringselOpData *lcd = arg;
|
||||
RingSelOpData *lcd = arg;
|
||||
int i;
|
||||
|
||||
if (lcd->totedge > 0) {
|
||||
@@ -176,7 +176,7 @@ static void edgering_find_order(BMEdge *lasteed, BMEdge *eed,
|
||||
}
|
||||
}
|
||||
|
||||
static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
|
||||
static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
|
||||
{
|
||||
BMEditMesh *em = lcd->em;
|
||||
BMEdge *startedge = lcd->eed;
|
||||
@@ -290,7 +290,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
|
||||
lcd->totedge = tot;
|
||||
}
|
||||
|
||||
static void ringsel_find_edge(tringselOpData *lcd, int cuts)
|
||||
static void ringsel_find_edge(RingSelOpData *lcd, int cuts)
|
||||
{
|
||||
if (lcd->eed) {
|
||||
edgering_sel(lcd, cuts, 0);
|
||||
@@ -304,7 +304,7 @@ static void ringsel_find_edge(tringselOpData *lcd, int cuts)
|
||||
|
||||
static void ringsel_finish(bContext *C, wmOperator *op)
|
||||
{
|
||||
tringselOpData *lcd = op->customdata;
|
||||
RingSelOpData *lcd = op->customdata;
|
||||
int cuts = RNA_int_get(op->ptr, "number_cuts");
|
||||
|
||||
if (lcd->eed) {
|
||||
@@ -350,7 +350,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
|
||||
/* called when modal loop selection is done... */
|
||||
static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
|
||||
{
|
||||
tringselOpData *lcd = op->customdata;
|
||||
RingSelOpData *lcd = op->customdata;
|
||||
|
||||
/* deactivate the extra drawing stuff in 3D-View */
|
||||
ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle);
|
||||
@@ -368,10 +368,10 @@ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
|
||||
/* called when modal loop selection gets set up... */
|
||||
static int ringsel_init(bContext *C, wmOperator *op, int do_cut)
|
||||
{
|
||||
tringselOpData *lcd;
|
||||
RingSelOpData *lcd;
|
||||
|
||||
/* alloc new customdata */
|
||||
lcd = op->customdata = MEM_callocN(sizeof(tringselOpData), "ringsel Modal Op Data");
|
||||
lcd = op->customdata = MEM_callocN(sizeof(RingSelOpData), "ringsel Modal Op Data");
|
||||
|
||||
/* assign the drawing handle for drawing preview line... */
|
||||
lcd->ar = CTX_wm_region(C);
|
||||
@@ -402,7 +402,7 @@ static int ringcut_cancel(bContext *C, wmOperator *op)
|
||||
static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
tringselOpData *lcd;
|
||||
RingSelOpData *lcd;
|
||||
BMEdge *edge;
|
||||
int dist = 75;
|
||||
|
||||
@@ -434,7 +434,7 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
int cuts = RNA_int_get(op->ptr, "number_cuts");
|
||||
tringselOpData *lcd = op->customdata;
|
||||
RingSelOpData *lcd = op->customdata;
|
||||
int show_cuts = 0;
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
@@ -3676,14 +3676,14 @@ enum {
|
||||
SRT_REVERSE, /* Reverse current order of selected elements. */
|
||||
};
|
||||
|
||||
typedef struct bmelemsort {
|
||||
typedef struct BMElemSort {
|
||||
float srt; /* Sort factor */
|
||||
int org_idx; /* Original index of this element _in its mempool_ */
|
||||
} bmelemsort;
|
||||
} BMElemSort;
|
||||
|
||||
static int bmelemsort_comp(const void *v1, const void *v2)
|
||||
{
|
||||
const bmelemsort *x1 = v1, *x2 = v2;
|
||||
const BMElemSort *x1 = v1, *x2 = v2;
|
||||
|
||||
return (x1->srt > x2->srt) - (x1->srt < x2->srt);
|
||||
}
|
||||
@@ -3704,7 +3704,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
/* In all five elements below, 0 = vertices, 1 = edges, 2 = faces. */
|
||||
/* Just to mark protected elements. */
|
||||
char *pblock[3] = {NULL, NULL, NULL}, *pb;
|
||||
bmelemsort *sblock[3] = {NULL, NULL, NULL}, *sb;
|
||||
BMElemSort *sblock[3] = {NULL, NULL, NULL}, *sb;
|
||||
int *map[3] = {NULL, NULL, NULL}, *mp;
|
||||
int totelem[3] = {0, 0, 0}, tot;
|
||||
int affected[3] = {0, 0, 0}, aff;
|
||||
@@ -3733,7 +3733,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[0]) {
|
||||
pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(bmelemsort) * totelem[0], "sort_bmelem vert sblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(BMElemSort) * totelem[0], "sort_bmelem vert sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ve, flag)) {
|
||||
@@ -3752,7 +3752,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[1]) {
|
||||
pb = pblock[1] = MEM_callocN(sizeof(char) * totelem[1], "sort_bmelem edge pblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(bmelemsort) * totelem[1], "sort_bmelem edge sblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(BMElemSort) * totelem[1], "sort_bmelem edge sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ed, flag)) {
|
||||
@@ -3772,7 +3772,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[2]) {
|
||||
pb = pblock[2] = MEM_callocN(sizeof(char) * totelem[2], "sort_bmelem face pblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(bmelemsort) * totelem[2], "sort_bmelem face sblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(BMElemSort) * totelem[2], "sort_bmelem face sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(fa, flag)) {
|
||||
@@ -3806,7 +3806,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[0]) {
|
||||
pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(bmelemsort) * totelem[0], "sort_bmelem vert sblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(BMElemSort) * totelem[0], "sort_bmelem vert sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ve, flag)) {
|
||||
@@ -3822,7 +3822,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[1]) {
|
||||
pb = pblock[1] = MEM_callocN(sizeof(char) * totelem[1], "sort_bmelem edge pblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(bmelemsort) * totelem[1], "sort_bmelem edge sblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(BMElemSort) * totelem[1], "sort_bmelem edge sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ed, flag)) {
|
||||
@@ -3841,7 +3841,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[2]) {
|
||||
pb = pblock[2] = MEM_callocN(sizeof(char) * totelem[2], "sort_bmelem face pblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(bmelemsort) * totelem[2], "sort_bmelem face sblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(BMElemSort) * totelem[2], "sort_bmelem face sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(fa, flag)) {
|
||||
@@ -3862,7 +3862,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
/* Faces only! */
|
||||
else if (action == SRT_MATERIAL && totelem[2]) {
|
||||
pb = pblock[2] = MEM_callocN(sizeof(char) * totelem[2], "sort_bmelem face pblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(bmelemsort) * totelem[2], "sort_bmelem face sblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(BMElemSort) * totelem[2], "sort_bmelem face sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(fa, flag)) {
|
||||
@@ -3966,7 +3966,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
* enabling/disabling an element type. */
|
||||
BLI_srandom(seed);
|
||||
pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(bmelemsort) * totelem[0], "sort_bmelem vert sblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(BMElemSort) * totelem[0], "sort_bmelem vert sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ve, flag)) {
|
||||
@@ -3983,7 +3983,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
if (totelem[1]) {
|
||||
BLI_srandom(seed);
|
||||
pb = pblock[1] = MEM_callocN(sizeof(char) * totelem[1], "sort_bmelem edge pblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(bmelemsort) * totelem[1], "sort_bmelem edge sblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(BMElemSort) * totelem[1], "sort_bmelem edge sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ed, flag)) {
|
||||
@@ -4000,7 +4000,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
if (totelem[2]) {
|
||||
BLI_srandom(seed);
|
||||
pb = pblock[2] = MEM_callocN(sizeof(char) * totelem[2], "sort_bmelem face pblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(bmelemsort) * totelem[2], "sort_bmelem face sblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(BMElemSort) * totelem[2], "sort_bmelem face sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(fa, flag)) {
|
||||
@@ -4018,7 +4018,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
else if (action == SRT_REVERSE) {
|
||||
if (totelem[0]) {
|
||||
pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(bmelemsort) * totelem[0], "sort_bmelem vert sblock");
|
||||
sb = sblock[0] = MEM_callocN(sizeof(BMElemSort) * totelem[0], "sort_bmelem vert sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ve, flag)) {
|
||||
@@ -4034,7 +4034,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[1]) {
|
||||
pb = pblock[1] = MEM_callocN(sizeof(char) * totelem[1], "sort_bmelem edge pblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(bmelemsort) * totelem[1], "sort_bmelem edge sblock");
|
||||
sb = sblock[1] = MEM_callocN(sizeof(BMElemSort) * totelem[1], "sort_bmelem edge sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(ed, flag)) {
|
||||
@@ -4050,7 +4050,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
if (totelem[2]) {
|
||||
pb = pblock[2] = MEM_callocN(sizeof(char) * totelem[2], "sort_bmelem face pblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(bmelemsort) * totelem[2], "sort_bmelem face sblock");
|
||||
sb = sblock[2] = MEM_callocN(sizeof(BMElemSort) * totelem[2], "sort_bmelem face sblock");
|
||||
|
||||
BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(fa, flag)) {
|
||||
@@ -4086,11 +4086,11 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
sb = sblock[j];
|
||||
if (pb && sb && !map[j]) {
|
||||
char *p_blk;
|
||||
bmelemsort *s_blk;
|
||||
BMElemSort *s_blk;
|
||||
tot = totelem[j];
|
||||
aff = affected[j];
|
||||
|
||||
qsort(sb, aff, sizeof(bmelemsort), bmelemsort_comp);
|
||||
qsort(sb, aff, sizeof(BMElemSort), bmelemsort_comp);
|
||||
|
||||
mp = map[j] = MEM_mallocN(sizeof(int) * tot, "sort_bmelem map");
|
||||
p_blk = pb + tot - 1;
|
||||
|
||||
@@ -2624,10 +2624,10 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
|
||||
* - revise whether op->customdata should be added in object, in set_vpaint
|
||||
*/
|
||||
|
||||
typedef struct polyfacemap_e {
|
||||
struct polyfacemap_e *next, *prev;
|
||||
typedef struct PolyFaceMap {
|
||||
struct PolyFaceMap *next, *prev;
|
||||
int facenr;
|
||||
} polyfacemap_e;
|
||||
} PolyFaceMap;
|
||||
|
||||
typedef struct VPaintData {
|
||||
ViewContext vc;
|
||||
@@ -2648,7 +2648,7 @@ typedef struct VPaintData {
|
||||
static void vpaint_build_poly_facemap(struct VPaintData *vd, Mesh *me)
|
||||
{
|
||||
MFace *mf;
|
||||
polyfacemap_e *e;
|
||||
PolyFaceMap *e;
|
||||
int *origIndex;
|
||||
int i;
|
||||
|
||||
@@ -2667,7 +2667,7 @@ static void vpaint_build_poly_facemap(struct VPaintData *vd, Mesh *me)
|
||||
if (*origIndex == ORIGINDEX_NONE)
|
||||
continue;
|
||||
|
||||
e = BLI_memarena_alloc(vd->polyfacemap_arena, sizeof(polyfacemap_e));
|
||||
e = BLI_memarena_alloc(vd->polyfacemap_arena, sizeof(PolyFaceMap));
|
||||
e->facenr = i;
|
||||
|
||||
BLI_addtail(&vd->polyfacemap[*origIndex], e);
|
||||
@@ -2784,7 +2784,7 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
|
||||
MCol *mc;
|
||||
MLoop *ml;
|
||||
MLoopCol *mlc;
|
||||
polyfacemap_e *e;
|
||||
PolyFaceMap *e;
|
||||
unsigned int *lcol = ((unsigned int *)me->mloopcol) + mpoly->loopstart;
|
||||
unsigned int *lcolorig = ((unsigned int *)vp->vpaint_prev) + mpoly->loopstart;
|
||||
float alpha;
|
||||
|
||||
@@ -677,7 +677,7 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test);
|
||||
const struct ListBase *RNA_struct_type_properties(StructRNA *srna);
|
||||
PropertyRNA *RNA_struct_type_find_property(StructRNA *srna, const char *identifier);
|
||||
|
||||
FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier);
|
||||
FunctionRNA *RNA_struct_find_function(StructRNA *srna, const char *identifier);
|
||||
const struct ListBase *RNA_struct_type_functions(StructRNA *srna);
|
||||
|
||||
char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len);
|
||||
|
||||
@@ -664,12 +664,12 @@ PropertyRNA *RNA_struct_type_find_property(StructRNA *srna, const char *identifi
|
||||
return BLI_findstring_ptr(&srna->cont.properties, identifier, offsetof(PropertyRNA, identifier));
|
||||
}
|
||||
|
||||
FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
|
||||
FunctionRNA *RNA_struct_find_function(StructRNA *srna, const char *identifier)
|
||||
{
|
||||
#if 1
|
||||
FunctionRNA *func;
|
||||
StructRNA *type;
|
||||
for (type = ptr->type; type; type = type->base) {
|
||||
for (type = srna; type; type = type->base) {
|
||||
func = (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
|
||||
if (func) {
|
||||
return func;
|
||||
@@ -683,7 +683,7 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
|
||||
PropertyRNA *iterprop;
|
||||
FunctionRNA *func;
|
||||
|
||||
RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr);
|
||||
RNA_pointer_create(NULL, &RNA_Struct, srna, &tptr);
|
||||
iterprop = RNA_struct_find_property(&tptr, "functions");
|
||||
|
||||
func = NULL;
|
||||
@@ -5132,7 +5132,7 @@ int RNA_function_call_lookup(bContext *C, ReportList *reports, PointerRNA *ptr,
|
||||
{
|
||||
FunctionRNA *func;
|
||||
|
||||
func = RNA_struct_find_function(ptr, identifier);
|
||||
func = RNA_struct_find_function(ptr->type, identifier);
|
||||
|
||||
if (func)
|
||||
return RNA_function_call(C, reports, ptr, func, parms);
|
||||
@@ -5160,7 +5160,7 @@ int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA
|
||||
{
|
||||
FunctionRNA *func;
|
||||
|
||||
func = RNA_struct_find_function(ptr, identifier);
|
||||
func = RNA_struct_find_function(ptr->type, identifier);
|
||||
|
||||
if (func) {
|
||||
va_list args;
|
||||
@@ -5535,7 +5535,7 @@ int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, Pointer
|
||||
{
|
||||
FunctionRNA *func;
|
||||
|
||||
func = RNA_struct_find_function(ptr, identifier);
|
||||
func = RNA_struct_find_function(ptr->type, identifier);
|
||||
|
||||
if (func)
|
||||
return RNA_function_call_direct_va(C, reports, ptr, func, format, args);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -38,6 +39,7 @@
|
||||
#include "DNA_sdna_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_ghash.h"
|
||||
|
||||
#include "RNA_define.h"
|
||||
@@ -2631,6 +2633,11 @@ FunctionRNA *RNA_def_function(StructRNA *srna, const char *identifier, const cha
|
||||
FunctionRNA *func;
|
||||
FunctionDefRNA *dfunc;
|
||||
|
||||
if (BLI_findstring_ptr(&srna->functions, identifier, offsetof(FunctionRNA, identifier))) {
|
||||
fprintf(stderr, "%s: %s.%s already defined.\n", __func__, srna->identifier, identifier);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
func = rna_def_function(srna, identifier);
|
||||
|
||||
if (!DefRNA.preprocess) {
|
||||
|
||||
@@ -3467,7 +3467,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
|
||||
ret = pyrna_prop_to_py(&self->ptr, prop);
|
||||
}
|
||||
/* RNA function only if callback is declared (no optional functions) */
|
||||
else if ((func = RNA_struct_find_function(&self->ptr, name)) && RNA_function_defined(func)) {
|
||||
else if ((func = RNA_struct_find_function(self->ptr.type, name)) && RNA_function_defined(func)) {
|
||||
ret = pyrna_func_to_py(&self->ptr, func);
|
||||
}
|
||||
else if (self->ptr.type == &RNA_Context) {
|
||||
@@ -3780,7 +3780,7 @@ static PyObject *pyrna_prop_collection_getattro(BPy_PropertyRNA *self, PyObject
|
||||
|
||||
return ret;
|
||||
}
|
||||
else if ((func = RNA_struct_find_function(&r_ptr, name))) {
|
||||
else if ((func = RNA_struct_find_function(r_ptr.type, name))) {
|
||||
PyObject *self_collection = pyrna_struct_CreatePyObject(&r_ptr);
|
||||
ret = pyrna_func_to_py(&((BPy_DummyPointerRNA *)self_collection)->ptr, func);
|
||||
Py_DECREF(self_collection);
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
virtual void ReParent(SCA_IObject* parent);
|
||||
virtual bool NewHandleCollision(void* obj1,void* obj2,
|
||||
const PHY_CollData * coll_data);
|
||||
const PHY_CollData * coll_data);
|
||||
virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2);
|
||||
virtual bool BroadPhaseSensorFilterCollision(void* obj1,void* obj2) { return false; }
|
||||
virtual sensortype GetSensorType() { return ST_NEAR; }
|
||||
|
||||
@@ -93,8 +93,10 @@ public:
|
||||
virtual void UnregisterSumo(KX_TouchEventManager* touchman);
|
||||
virtual void UnregisterToManager();
|
||||
|
||||
// virtual DT_Bool HandleCollision(void* obj1,void* obj2,
|
||||
// const DT_CollData * coll_data);
|
||||
#if 0
|
||||
virtual DT_Bool HandleCollision(void* obj1,void* obj2,
|
||||
const DT_CollData * coll_data);
|
||||
#endif
|
||||
|
||||
virtual bool NewHandleCollision(void*obj1,void*obj2,const PHY_CollData* colldata);
|
||||
|
||||
|
||||
@@ -444,9 +444,9 @@ PyObject * Image_getImage (PyImage * self, char * mode)
|
||||
// get an empty buffer
|
||||
buffer = BGL_MakeBuffer( GL_BYTE, 1, &dimensions, NULL);
|
||||
// and fill it
|
||||
for (i=0, d=(unsigned char*)buffer->buf.asbyte, s=(unsigned char*)image;
|
||||
i<pixels;
|
||||
++i, d+=ncolor, s+=4)
|
||||
for (i = 0, d = (unsigned char *)buffer->buf.asbyte, s = (unsigned char *)image;
|
||||
i < pixels;
|
||||
i++, d += ncolor, s += 4)
|
||||
{
|
||||
for (c=0; c<ncolor; c++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user