forked from bartvdbraak/blender
Code Cleanup: style and redundant casts
This commit is contained in:
parent
bb1a7e4d87
commit
af93ebcb50
@ -52,7 +52,7 @@ static int txttl_cmp(const char *first, const char *second, int len)
|
|||||||
{
|
{
|
||||||
int cmp, i;
|
int cmp, i;
|
||||||
for (cmp = 0, i = 0; i < len; i++) {
|
for (cmp = 0, i = 0; i < len; i++) {
|
||||||
if ( (cmp = toupper(first[i]) - toupper(second[i])) ) {
|
if ((cmp = toupper(first[i]) - toupper(second[i]))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -699,7 +699,7 @@ static unsigned int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int fl
|
|||||||
|
|
||||||
ed3 = sc1->edge_first;
|
ed3 = sc1->edge_first;
|
||||||
while (ed3) {
|
while (ed3) {
|
||||||
if ( (ed3->v1 == v1 && ed3->v2 == v3) || (ed3->v1 == v3 && ed3->v2 == v1) ) {
|
if ((ed3->v1 == v1 && ed3->v2 == v3) || (ed3->v1 == v3 && ed3->v2 == v1)) {
|
||||||
if (twoconnected || ed3->f == SF_EDGE_BOUNDARY) {
|
if (twoconnected || ed3->f == SF_EDGE_BOUNDARY) {
|
||||||
BLI_remlink((ListBase *)&(sc1->edge_first), ed3);
|
BLI_remlink((ListBase *)&(sc1->edge_first), ed3);
|
||||||
BLI_addtail(&sf_ctx->filledgebase, ed3);
|
BLI_addtail(&sf_ctx->filledgebase, ed3);
|
||||||
|
@ -486,7 +486,7 @@ int BLI_exists(const char *name)
|
|||||||
unsigned int old_error_mode;
|
unsigned int old_error_mode;
|
||||||
|
|
||||||
len = wcslen(tmp_16);
|
len = wcslen(tmp_16);
|
||||||
if (len > 3 && (tmp_16[len - 1] == L'\\' || tmp_16[len - 1] == L'/') )
|
if (len > 3 && (tmp_16[len - 1] == L'\\' || tmp_16[len - 1] == L'/'))
|
||||||
tmp_16[len - 1] = '\0';
|
tmp_16[len - 1] = '\0';
|
||||||
|
|
||||||
/* change error mode so user does not get a "no disk in drive" popup
|
/* change error mode so user does not get a "no disk in drive" popup
|
||||||
|
@ -513,17 +513,17 @@ int BLI_natstrcmp(const char *s1, const char *s2)
|
|||||||
c1 = tolower(s1[d1]);
|
c1 = tolower(s1[d1]);
|
||||||
c2 = tolower(s2[d2]);
|
c2 = tolower(s2[d2]);
|
||||||
|
|
||||||
if (isdigit(c1) && isdigit(c2) ) {
|
if (isdigit(c1) && isdigit(c2)) {
|
||||||
int numcompare = left_number_strcmp(s1 + d1, s2 + d2, &tiebreaker);
|
int numcompare = left_number_strcmp(s1 + d1, s2 + d2, &tiebreaker);
|
||||||
|
|
||||||
if (numcompare != 0)
|
if (numcompare != 0)
|
||||||
return numcompare;
|
return numcompare;
|
||||||
|
|
||||||
d1++;
|
d1++;
|
||||||
while (isdigit(s1[d1]) )
|
while (isdigit(s1[d1]))
|
||||||
d1++;
|
d1++;
|
||||||
d2++;
|
d2++;
|
||||||
while (isdigit(s2[d2]) )
|
while (isdigit(s2[d2]))
|
||||||
d2++;
|
d2++;
|
||||||
|
|
||||||
c1 = tolower(s1[d1]);
|
c1 = tolower(s1[d1]);
|
||||||
|
@ -21,12 +21,16 @@
|
|||||||
* Windows-posix compatibility layer for opendir/readdir/closedir
|
* Windows-posix compatibility layer for opendir/readdir/closedir
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file blender/blenlib/intern/winstuff.c
|
/** \file blender/blenlib/intern/winstuff_dir.c
|
||||||
* \ingroup bli
|
* \ingroup bli
|
||||||
|
*
|
||||||
|
* Posix compatibility functions for windows dealing with DIR
|
||||||
|
* (opendir, readdir, closedir)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(FREE_WINDOWS)
|
#if defined(WIN32) && !defined(FREE_WINDOWS)
|
||||||
|
|
||||||
|
/* standalone for inclusion in binaries other then blender */
|
||||||
# ifdef USE_STANDALONE
|
# ifdef USE_STANDALONE
|
||||||
# define MEM_mallocN(size, str) ((void)str, malloc(size))
|
# define MEM_mallocN(size, str) ((void)str, malloc(size))
|
||||||
# define MEM_callocN(size, str) ((void)str, calloc(size, 1))
|
# define MEM_callocN(size, str) ((void)str, calloc(size, 1))
|
||||||
|
@ -362,7 +362,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BM_ITER_MESH (e, &eiter, sys->bm, BM_EDGES_OF_MESH) {
|
BM_ITER_MESH (e, &eiter, sys->bm, BM_EDGES_OF_MESH) {
|
||||||
if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e) ) {
|
if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e)) {
|
||||||
v1 = e->v1->co;
|
v1 = e->v1->co;
|
||||||
v2 = e->v2->co;
|
v2 = e->v2->co;
|
||||||
idv1 = BM_elem_index_get(e->v1);
|
idv1 = BM_elem_index_get(e->v1);
|
||||||
|
@ -2522,7 +2522,7 @@ static bool tri_corner_test(BevelParams *bp, BevVert *bv)
|
|||||||
totang += ang;
|
totang += ang;
|
||||||
}
|
}
|
||||||
angdiff = fabsf(totang - 3.0f * (float)M_PI_2);
|
angdiff = fabsf(totang - 3.0f * (float)M_PI_2);
|
||||||
if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI/16.0f) ||
|
if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI / 16.0f) ||
|
||||||
(angdiff > (float)M_PI_4))
|
(angdiff > (float)M_PI_4))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
//#include <stdio.h>
|
//#include <stdio.h>
|
||||||
#include "COM_defines.h"
|
#include "COM_defines.h"
|
||||||
|
|
||||||
Node::Node(bNode *editorNode, bool create_sockets): NodeBase()
|
Node::Node(bNode *editorNode, bool create_sockets) : NodeBase()
|
||||||
{
|
{
|
||||||
setbNode(editorNode);
|
setbNode(editorNode);
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEdi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Only operate on this BezTriple if it fullfills the criteria of the validation func */
|
/* Only operate on this BezTriple if it fullfills the criteria of the validation func */
|
||||||
if ( (ok = key_ok(ked, bezt)) ) {
|
if ((ok = key_ok(ked, bezt))) {
|
||||||
if (ked) ked->curflags = ok;
|
if (ked) ked->curflags = ok;
|
||||||
|
|
||||||
/* Exit with return-code '1' if function returns positive
|
/* Exit with return-code '1' if function returns positive
|
||||||
|
@ -1984,7 +1984,7 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* try shapekey keyframes (if available, and allowed by filter) */
|
/* try shapekey keyframes (if available, and allowed by filter) */
|
||||||
if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOSKEY) ) {
|
if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOSKEY)) {
|
||||||
Key *key = BKE_key_from_object(ob);
|
Key *key = BKE_key_from_object(ob);
|
||||||
|
|
||||||
/* shapekeys can have keyframes ('Relative Shape Keys')
|
/* shapekeys can have keyframes ('Relative Shape Keys')
|
||||||
@ -2000,7 +2000,7 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* try materials */
|
/* try materials */
|
||||||
if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOMAT) ) {
|
if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOMAT)) {
|
||||||
/* if only active, then we can skip a lot of looping */
|
/* if only active, then we can skip a lot of looping */
|
||||||
if (filter & ANIMFILTER_KEYS_ACTIVE) {
|
if (filter & ANIMFILTER_KEYS_ACTIVE) {
|
||||||
Material *ma = give_current_material(ob, (ob->actcol + 1));
|
Material *ma = give_current_material(ob, (ob->actcol + 1));
|
||||||
|
@ -113,8 +113,9 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *
|
|||||||
|
|
||||||
for (ct = targets.first; ct; ct = ct->next) {
|
for (ct = targets.first; ct; ct = ct->next) {
|
||||||
if (ct->tar == ob) {
|
if (ct->tar == ob) {
|
||||||
if (!strcmp(ct->subtarget, oldname) )
|
if (STREQ(ct->subtarget, oldname)) {
|
||||||
BLI_strncpy(ct->subtarget, newname, MAXBONENAME);
|
BLI_strncpy(ct->subtarget, newname, MAXBONENAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -920,7 +920,7 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData
|
|||||||
pchan = BKE_pose_channel_find_name(pose, agrp->name);
|
pchan = BKE_pose_channel_find_name(pose, agrp->name);
|
||||||
|
|
||||||
if (pchan) {
|
if (pchan) {
|
||||||
if ( (pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) ) {
|
if ((pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED))) {
|
||||||
if (autokey) {
|
if (autokey) {
|
||||||
/* add datasource override for the PoseChannel, to be used later */
|
/* add datasource override for the PoseChannel, to be used later */
|
||||||
ANIM_relative_keyingset_add_source(&dsources, &pld->ob->id, &RNA_PoseBone, pchan);
|
ANIM_relative_keyingset_add_source(&dsources, &pld->ob->id, &RNA_PoseBone, pchan);
|
||||||
|
@ -823,17 +823,17 @@ void UI_view2d_curRect_reset(View2D *v2d)
|
|||||||
/* handle width - posx and negx flags are mutually exclusive, so watch out */
|
/* handle width - posx and negx flags are mutually exclusive, so watch out */
|
||||||
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
|
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
|
||||||
/* width is in negative-x half */
|
/* width is in negative-x half */
|
||||||
v2d->cur.xmin = (float)-width;
|
v2d->cur.xmin = -width;
|
||||||
v2d->cur.xmax = 0.0f;
|
v2d->cur.xmax = 0.0f;
|
||||||
}
|
}
|
||||||
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
|
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
|
||||||
/* width is in positive-x half */
|
/* width is in positive-x half */
|
||||||
v2d->cur.xmin = 0.0f;
|
v2d->cur.xmin = 0.0f;
|
||||||
v2d->cur.xmax = (float)width;
|
v2d->cur.xmax = width;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* width is centered around (x == 0) */
|
/* width is centered around (x == 0) */
|
||||||
const float dx = (float)width / 2.0f;
|
const float dx = width / 2.0f;
|
||||||
|
|
||||||
v2d->cur.xmin = -dx;
|
v2d->cur.xmin = -dx;
|
||||||
v2d->cur.xmax = dx;
|
v2d->cur.xmax = dx;
|
||||||
@ -842,17 +842,17 @@ void UI_view2d_curRect_reset(View2D *v2d)
|
|||||||
/* handle height - posx and negx flags are mutually exclusive, so watch out */
|
/* handle height - posx and negx flags are mutually exclusive, so watch out */
|
||||||
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
|
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
|
||||||
/* height is in negative-y half */
|
/* height is in negative-y half */
|
||||||
v2d->cur.ymin = (float)-height;
|
v2d->cur.ymin = -height;
|
||||||
v2d->cur.ymax = 0.0f;
|
v2d->cur.ymax = 0.0f;
|
||||||
}
|
}
|
||||||
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
|
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
|
||||||
/* height is in positive-y half */
|
/* height is in positive-y half */
|
||||||
v2d->cur.ymin = 0.0f;
|
v2d->cur.ymin = 0.0f;
|
||||||
v2d->cur.ymax = (float)height;
|
v2d->cur.ymax = height;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* height is centered around (y == 0) */
|
/* height is centered around (y == 0) */
|
||||||
const float dy = (float)height / 2.0f;
|
const float dy = height / 2.0f;
|
||||||
|
|
||||||
v2d->cur.ymin = -dy;
|
v2d->cur.ymin = -dy;
|
||||||
v2d->cur.ymax = dy;
|
v2d->cur.ymax = dy;
|
||||||
|
@ -455,7 +455,7 @@ void ED_object_editmode_enter(bContext *C, int flag)
|
|||||||
ob = base->object;
|
ob = base->object;
|
||||||
|
|
||||||
/* this checks actual object->data, for cases when other scenes have it in editmode context */
|
/* this checks actual object->data, for cases when other scenes have it in editmode context */
|
||||||
if ( BKE_object_is_in_editmode(ob) )
|
if (BKE_object_is_in_editmode(ob))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BKE_object_obdata_is_libdata(ob)) {
|
if (BKE_object_obdata_is_libdata(ob)) {
|
||||||
|
@ -165,7 +165,7 @@ int ED_operator_objectmode(bContext *C)
|
|||||||
|
|
||||||
if (scene == NULL || scene->id.lib)
|
if (scene == NULL || scene->id.lib)
|
||||||
return 0;
|
return 0;
|
||||||
if (CTX_data_edit_object(C) )
|
if (CTX_data_edit_object(C))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* add a check for ob->mode too? */
|
/* add a check for ob->mode too? */
|
||||||
|
@ -139,7 +139,7 @@ static void file_panel_system_bookmarks(const bContext *C, Panel *pa)
|
|||||||
{
|
{
|
||||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||||
|
|
||||||
if (sfile && !(U.uiflag & USER_HIDE_SYSTEM_BOOKMARKS) ) {
|
if (sfile && !(U.uiflag & USER_HIDE_SYSTEM_BOOKMARKS)) {
|
||||||
file_panel_category(C, pa, FS_CATEGORY_SYSTEM_BOOKMARKS, &sfile->systemnr, ICON_BOOKMARKS, 0);
|
file_panel_category(C, pa, FS_CATEGORY_SYSTEM_BOOKMARKS, &sfile->systemnr, ICON_BOOKMARKS, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ static void file_panel_recent(const bContext *C, Panel *pa)
|
|||||||
uiLayout *row;
|
uiLayout *row;
|
||||||
|
|
||||||
if (sfile) {
|
if (sfile) {
|
||||||
if (!(U.uiflag & USER_HIDE_RECENT) ) {
|
if (!(U.uiflag & USER_HIDE_RECENT)) {
|
||||||
row = uiLayoutRow(pa->layout, FALSE);
|
row = uiLayoutRow(pa->layout, FALSE);
|
||||||
uiItemO(row, IFACE_("Reset"), ICON_X, "file.reset_recent");
|
uiItemO(row, IFACE_("Reset"), ICON_X, "file.reset_recent");
|
||||||
uiItemL(row, NULL, ICON_NONE);
|
uiItemL(row, NULL, ICON_NONE);
|
||||||
|
@ -304,18 +304,18 @@ static int is_hidden_file(const char *filename, short hide_dot)
|
|||||||
if (filename[0] == '.' && filename[1] != '.' && filename[1] != 0) {
|
if (filename[0] == '.' && filename[1] != '.' && filename[1] != 0) {
|
||||||
is_hidden = 1; /* ignore .file */
|
is_hidden = 1; /* ignore .file */
|
||||||
}
|
}
|
||||||
else if (((filename[0] == '.') && (filename[1] == 0) )) {
|
else if (((filename[0] == '.') && (filename[1] == 0))) {
|
||||||
is_hidden = 1; /* ignore . */
|
is_hidden = 1; /* ignore . */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int len = strlen(filename);
|
int len = strlen(filename);
|
||||||
if ( (len > 0) && (filename[len - 1] == '~') ) {
|
if ((len > 0) && (filename[len - 1] == '~')) {
|
||||||
is_hidden = 1; /* ignore file~ */
|
is_hidden = 1; /* ignore file~ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (((filename[0] == '.') && (filename[1] == 0) )) {
|
if (((filename[0] == '.') && (filename[1] == 0))) {
|
||||||
is_hidden = 1; /* ignore . */
|
is_hidden = 1; /* ignore . */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,7 +370,7 @@ void filelist_filter(FileList *filelist)
|
|||||||
/* How many files are left after filter ? */
|
/* How many files are left after filter ? */
|
||||||
for (i = 0; i < filelist->numfiles; ++i) {
|
for (i = 0; i < filelist->numfiles; ++i) {
|
||||||
struct direntry *file = &filelist->filelist[i];
|
struct direntry *file = &filelist->filelist[i];
|
||||||
if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) {
|
if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot)) {
|
||||||
num_filtered++;
|
num_filtered++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,7 +384,7 @@ void filelist_filter(FileList *filelist)
|
|||||||
|
|
||||||
for (i = 0, j = 0; i < filelist->numfiles; ++i) {
|
for (i = 0, j = 0; i < filelist->numfiles; ++i) {
|
||||||
struct direntry *file = &filelist->filelist[i];
|
struct direntry *file = &filelist->filelist[i];
|
||||||
if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) {
|
if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot)) {
|
||||||
filelist->fidx[j++] = i;
|
filelist->fidx[j++] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -629,7 +629,7 @@ ImBuf *filelist_getimage(struct FileList *filelist, int index)
|
|||||||
|
|
||||||
BLI_assert(G.background == FALSE);
|
BLI_assert(G.background == FALSE);
|
||||||
|
|
||||||
if ( (index < 0) || (index >= filelist->numfiltered) ) {
|
if ((index < 0) || (index >= filelist->numfiltered)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
fidx = filelist->fidx[index];
|
fidx = filelist->fidx[index];
|
||||||
@ -646,7 +646,7 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index)
|
|||||||
|
|
||||||
BLI_assert(G.background == FALSE);
|
BLI_assert(G.background == FALSE);
|
||||||
|
|
||||||
if ( (index < 0) || (index >= filelist->numfiltered) ) {
|
if ((index < 0) || (index >= filelist->numfiltered)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
fidx = filelist->fidx[index];
|
fidx = filelist->fidx[index];
|
||||||
@ -669,7 +669,7 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index)
|
|||||||
if (file->flags & BLENDERFILE) {
|
if (file->flags & BLENDERFILE) {
|
||||||
ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
|
ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
|
||||||
}
|
}
|
||||||
else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) {
|
else if ((file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON)) {
|
||||||
ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
|
ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
|
||||||
}
|
}
|
||||||
else if (file->flags & SOUNDFILE) {
|
else if (file->flags & SOUNDFILE) {
|
||||||
@ -698,7 +698,7 @@ struct direntry *filelist_file(struct FileList *filelist, int index)
|
|||||||
{
|
{
|
||||||
int fidx = 0;
|
int fidx = 0;
|
||||||
|
|
||||||
if ( (index < 0) || (index >= filelist->numfiltered) ) {
|
if ((index < 0) || (index >= filelist->numfiltered)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
fidx = filelist->fidx[index];
|
fidx = filelist->fidx[index];
|
||||||
@ -994,7 +994,7 @@ void filelist_select_file(struct FileList *filelist, int index, FileSelType sele
|
|||||||
void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check)
|
void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check)
|
||||||
{
|
{
|
||||||
/* select all valid files between first and last indicated */
|
/* select all valid files between first and last indicated */
|
||||||
if ( (sel->first >= 0) && (sel->first < filelist->numfiltered) && (sel->last >= 0) && (sel->last < filelist->numfiltered) ) {
|
if ((sel->first >= 0) && (sel->first < filelist->numfiltered) && (sel->last >= 0) && (sel->last < filelist->numfiltered)) {
|
||||||
int current_file;
|
int current_file;
|
||||||
for (current_file = sel->first; current_file <= sel->last; current_file++) {
|
for (current_file = sel->first; current_file <= sel->last; current_file++) {
|
||||||
filelist_select_file(filelist, current_file, select, flag, check);
|
filelist_select_file(filelist, current_file, select, flag, check);
|
||||||
@ -1332,7 +1332,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float
|
|||||||
tj->stop = stop;
|
tj->stop = stop;
|
||||||
tj->do_update = do_update;
|
tj->do_update = do_update;
|
||||||
|
|
||||||
while ( (*stop == 0) && (limg) ) {
|
while ((*stop == 0) && (limg)) {
|
||||||
if (limg->flags & IMAGEFILE) {
|
if (limg->flags & IMAGEFILE) {
|
||||||
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
|
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
|
||||||
}
|
}
|
||||||
@ -1393,7 +1393,7 @@ void thumbnails_start(FileList *filelist, const bContext *C)
|
|||||||
tj->filelist = filelist;
|
tj->filelist = filelist;
|
||||||
for (idx = 0; idx < filelist->numfiles; idx++) {
|
for (idx = 0; idx < filelist->numfiles; idx++) {
|
||||||
if (!filelist->filelist[idx].image) {
|
if (!filelist->filelist[idx].image) {
|
||||||
if ( (filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE | BLENDERFILE_BACKUP)) ) {
|
if ((filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE | BLENDERFILE_BACKUP))) {
|
||||||
FileImage *limg = MEM_callocN(sizeof(FileImage), "loadimage");
|
FileImage *limg = MEM_callocN(sizeof(FileImage), "loadimage");
|
||||||
BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX);
|
BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX);
|
||||||
limg->index = idx;
|
limg->index = idx;
|
||||||
|
@ -237,7 +237,7 @@ static void draw_fcurve_vertices_handles(FCurve *fcu, SpaceIpo *sipo, View2D *v2
|
|||||||
* Also, need to take into account whether the keyframe was selected
|
* Also, need to take into account whether the keyframe was selected
|
||||||
* if a Graph Editor option to only show handles of selected keys is on.
|
* if a Graph Editor option to only show handles of selected keys is on.
|
||||||
*/
|
*/
|
||||||
if (!sel_handle_only || BEZSELECTED(bezt) ) {
|
if (!sel_handle_only || BEZSELECTED(bezt)) {
|
||||||
if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) {
|
if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) {
|
||||||
if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
|
if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
|
||||||
draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize);
|
draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize);
|
||||||
|
@ -1292,7 +1292,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tree_element_type_active(NULL, scene, soops, te, tselem, 0, false) ) active = 2;
|
if (tree_element_type_active(NULL, scene, soops, te, tselem, 0, false)) active = 2;
|
||||||
glColor4ub(220, 220, 255, alpha);
|
glColor4ub(220, 220, 255, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot)
|
|||||||
|
|
||||||
/* Apply Settings ------------------------------- */
|
/* Apply Settings ------------------------------- */
|
||||||
|
|
||||||
static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
|
static int outliner_count_levels(SpaceOops *soops, ListBase *lb, const int curlevel)
|
||||||
{
|
{
|
||||||
TreeElement *te;
|
TreeElement *te;
|
||||||
int level = curlevel, lev;
|
int level = curlevel, lev;
|
||||||
@ -320,7 +320,7 @@ static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, short curlevel)
|
int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, const int curlevel)
|
||||||
{
|
{
|
||||||
TreeElement *te;
|
TreeElement *te;
|
||||||
TreeStoreElem *tselem;
|
TreeStoreElem *tselem;
|
||||||
|
@ -177,7 +177,7 @@ void outliner_do_object_operation(struct bContext *C, struct Scene *scene, struc
|
|||||||
|
|
||||||
int common_restrict_check(struct bContext *C, struct Object *ob);
|
int common_restrict_check(struct bContext *C, struct Object *ob);
|
||||||
|
|
||||||
int outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, short curlevel);
|
bool outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, const int curlevel);
|
||||||
void outliner_set_flag(struct SpaceOops *soops, ListBase *lb, short flag, short set);
|
void outliner_set_flag(struct SpaceOops *soops, ListBase *lb, short flag, short set);
|
||||||
|
|
||||||
void object_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
|
void object_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
|
||||||
|
@ -1278,7 +1278,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
|
|||||||
/* select object that's clicked on and popup context menu */
|
/* select object that's clicked on and popup context menu */
|
||||||
if (!(tselem->flag & TSE_SELECTED)) {
|
if (!(tselem->flag & TSE_SELECTED)) {
|
||||||
|
|
||||||
if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1) )
|
if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1))
|
||||||
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
|
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
|
||||||
|
|
||||||
tselem->flag |= TSE_SELECTED;
|
tselem->flag |= TSE_SELECTED;
|
||||||
|
@ -293,7 +293,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
|
|||||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||||
if ((seq != test) &&
|
if ((seq != test) &&
|
||||||
(test->machine == seq->machine) &&
|
(test->machine == seq->machine) &&
|
||||||
((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0) ))
|
((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0)))
|
||||||
{
|
{
|
||||||
switch (lr) {
|
switch (lr) {
|
||||||
case SEQ_SIDE_LEFT:
|
case SEQ_SIDE_LEFT:
|
||||||
|
@ -1271,7 +1271,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
|
|||||||
|
|
||||||
/* draw clip start, useful for wide cones where its not obvious where the start is */
|
/* draw clip start, useful for wide cones where its not obvious where the start is */
|
||||||
glTranslatef(0.0, 0.0, -x); /* reverse translation above */
|
glTranslatef(0.0, 0.0, -x); /* reverse translation above */
|
||||||
if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
|
if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF)) {
|
||||||
float lvec_clip[3];
|
float lvec_clip[3];
|
||||||
float vvec_clip[3];
|
float vvec_clip[3];
|
||||||
float clipsta_fac = la->clipsta / -x;
|
float clipsta_fac = la->clipsta / -x;
|
||||||
|
@ -1295,7 +1295,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(v3d->flag & V3D_INVALID_BACKBUF) ) return;
|
if (!(v3d->flag & V3D_INVALID_BACKBUF))
|
||||||
|
return;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (test) {
|
if (test) {
|
||||||
@ -3326,8 +3327,9 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
|
|||||||
/* draw selected and editmode */
|
/* draw selected and editmode */
|
||||||
for (base = scene->base.first; base; base = base->next) {
|
for (base = scene->base.first; base; base = base->next) {
|
||||||
if (v3d->lay & base->lay) {
|
if (v3d->lay & base->lay) {
|
||||||
if (base->object == scene->obedit || (base->flag & SELECT) )
|
if (base->object == scene->obedit || (base->flag & SELECT)) {
|
||||||
draw_object(scene, ar, v3d, base, 0);
|
draw_object(scene, ar, v3d, base, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,19 +295,19 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar)
|
|||||||
if (rv3dtest->viewlock) {
|
if (rv3dtest->viewlock) {
|
||||||
rv3dtest->dist = rv3d->dist;
|
rv3dtest->dist = rv3d->dist;
|
||||||
|
|
||||||
if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ) {
|
if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) {
|
||||||
if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
|
if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
|
||||||
rv3dtest->ofs[0] = rv3d->ofs[0];
|
rv3dtest->ofs[0] = rv3d->ofs[0];
|
||||||
else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
|
else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
|
||||||
rv3dtest->ofs[1] = rv3d->ofs[1];
|
rv3dtest->ofs[1] = rv3d->ofs[1];
|
||||||
}
|
}
|
||||||
else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK) ) {
|
else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK)) {
|
||||||
if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
|
if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
|
||||||
rv3dtest->ofs[0] = rv3d->ofs[0];
|
rv3dtest->ofs[0] = rv3d->ofs[0];
|
||||||
else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
|
else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
|
||||||
rv3dtest->ofs[2] = rv3d->ofs[2];
|
rv3dtest->ofs[2] = rv3d->ofs[2];
|
||||||
}
|
}
|
||||||
else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ) {
|
else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT)) {
|
||||||
if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
|
if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
|
||||||
rv3dtest->ofs[1] = rv3d->ofs[1];
|
rv3dtest->ofs[1] = rv3d->ofs[1];
|
||||||
if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
|
if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
|
||||||
|
@ -925,7 +925,7 @@ void postSelectConstraint(TransInfo *t)
|
|||||||
static void setNearestAxis2d(TransInfo *t)
|
static void setNearestAxis2d(TransInfo *t)
|
||||||
{
|
{
|
||||||
/* no correction needed... just use whichever one is lower */
|
/* no correction needed... just use whichever one is lower */
|
||||||
if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1]) ) {
|
if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1])) {
|
||||||
t->con.mode |= CON_AXIS1;
|
t->con.mode |= CON_AXIS1;
|
||||||
BLI_strncpy(t->con.text, IFACE_(" along Y axis"), sizeof(t->con.text));
|
BLI_strncpy(t->con.text, IFACE_(" along Y axis"), sizeof(t->con.text));
|
||||||
}
|
}
|
||||||
|
@ -497,7 +497,7 @@ static void recalcData_nla(TransInfo *t)
|
|||||||
pExceeded = ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end));
|
pExceeded = ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end));
|
||||||
nExceeded = ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start));
|
nExceeded = ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start));
|
||||||
|
|
||||||
if ((pExceeded && nExceeded) || (iter == 4) ) {
|
if ((pExceeded && nExceeded) || (iter == 4)) {
|
||||||
/* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise)
|
/* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise)
|
||||||
* - simply crop strip to fit within the bounds of the strips bounding it
|
* - simply crop strip to fit within the bounds of the strips bounding it
|
||||||
* - if there were no neighbors, clear the transforms (make it default to the strip's current values)
|
* - if there were no neighbors, clear the transforms (make it default to the strip's current values)
|
||||||
|
@ -2856,7 +2856,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op)
|
|||||||
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
|
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
|
||||||
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
|
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
|
||||||
|
|
||||||
if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
|
if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION)) {
|
||||||
|
|
||||||
/* UV_SYNC_SELECTION - can't do pinned selection */
|
/* UV_SYNC_SELECTION - can't do pinned selection */
|
||||||
if (BLI_rctf_isect_pt_v(&rectf, luv->uv)) {
|
if (BLI_rctf_isect_pt_v(&rectf, luv->uv)) {
|
||||||
|
@ -2469,7 +2469,7 @@ static void rna_def_object(BlenderRNA *brna)
|
|||||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||||
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
|
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
|
||||||
RNA_def_property_ui_text(prop, "Image User",
|
RNA_def_property_ui_text(prop, "Image User",
|
||||||
"Parameters defining which layer, pass and frame of the image is displayed");
|
"Parameters defining which layer, pass and frame of the image is displayed");
|
||||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
|
||||||
|
|
||||||
/* render */
|
/* render */
|
||||||
|
@ -291,7 +291,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
|
|||||||
|
|
||||||
seq->machine = value;
|
seq->machine = value;
|
||||||
|
|
||||||
if (BKE_sequence_test_overlap(seqbase, seq) ) {
|
if (BKE_sequence_test_overlap(seqbase, seq)) {
|
||||||
BKE_sequence_base_shuffle(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
|
BKE_sequence_base_shuffle(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
|
||||||
}
|
}
|
||||||
BKE_sequencer_sort(scene);
|
BKE_sequencer_sort(scene);
|
||||||
|
@ -140,7 +140,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
* - must have verts and therefore verts assigned to vgroups to do anything useful
|
* - must have verts and therefore verts assigned to vgroups to do anything useful
|
||||||
*/
|
*/
|
||||||
if (!(ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP)) ||
|
if (!(ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP)) ||
|
||||||
(maxVerts == 0) || (ob->defbase.first == NULL) )
|
(maxVerts == 0) || (ob->defbase.first == NULL))
|
||||||
{
|
{
|
||||||
return dm;
|
return dm;
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
/* vertices */
|
/* vertices */
|
||||||
for (hashIter = BLI_ghashIterator_new(vertHash);
|
for (hashIter = BLI_ghashIterator_new(vertHash);
|
||||||
BLI_ghashIterator_done(hashIter) == false;
|
BLI_ghashIterator_done(hashIter) == false;
|
||||||
BLI_ghashIterator_step(hashIter) )
|
BLI_ghashIterator_step(hashIter))
|
||||||
{
|
{
|
||||||
MVert source;
|
MVert source;
|
||||||
MVert *dest;
|
MVert *dest;
|
||||||
@ -336,7 +336,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
/* faces */
|
/* faces */
|
||||||
for (hashIter = BLI_ghashIterator_new(polyHash);
|
for (hashIter = BLI_ghashIterator_new(polyHash);
|
||||||
BLI_ghashIterator_done(hashIter) == false;
|
BLI_ghashIterator_done(hashIter) == false;
|
||||||
BLI_ghashIterator_step(hashIter) )
|
BLI_ghashIterator_step(hashIter))
|
||||||
{
|
{
|
||||||
int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
|
int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
|
||||||
int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
|
int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
|
||||||
|
@ -377,7 +377,7 @@ int ntreeCompositTagAnimated(bNodeTree *ntree)
|
|||||||
}
|
}
|
||||||
/* here was tag render layer, but this is called after a render, so re-composites fail */
|
/* here was tag render layer, but this is called after a render, so re-composites fail */
|
||||||
else if (node->type == NODE_GROUP) {
|
else if (node->type == NODE_GROUP) {
|
||||||
if (ntreeCompositTagAnimated((bNodeTree *)node->id) ) {
|
if (ntreeCompositTagAnimated((bNodeTree *)node->id)) {
|
||||||
nodeUpdate(ntree, node);
|
nodeUpdate(ntree, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ void WM_cursor_set(wmWindow *win, int curs)
|
|||||||
if (curs == SYSCURSOR) { /* System default Cursor */
|
if (curs == SYSCURSOR) { /* System default Cursor */
|
||||||
GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
|
GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
|
||||||
}
|
}
|
||||||
else if ( (U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL) ) {
|
else if ((U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL)) {
|
||||||
window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
|
window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -227,7 +227,7 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
|
|||||||
drag->opname[0] = 0;
|
drag->opname[0] = 0;
|
||||||
|
|
||||||
/* check buttons (XXX todo rna and value) */
|
/* check buttons (XXX todo rna and value) */
|
||||||
if (UI_but_active_drop_name(C) ) {
|
if (UI_but_active_drop_name(C)) {
|
||||||
BLI_strncpy(drag->opname, IFACE_("Paste name"), sizeof(drag->opname));
|
BLI_strncpy(drag->opname, IFACE_("Paste name"), sizeof(drag->opname));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3040,7 +3040,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
|
|||||||
|
|
||||||
/* double click test */
|
/* double click test */
|
||||||
if (wm_event_is_double_click(&event, evt)) {
|
if (wm_event_is_double_click(&event, evt)) {
|
||||||
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
|
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
|
||||||
printf("%s Send double click\n", __func__);
|
printf("%s Send double click\n", __func__);
|
||||||
event.val = KM_DBL_CLICK;
|
event.val = KM_DBL_CLICK;
|
||||||
}
|
}
|
||||||
@ -3147,7 +3147,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
|
|||||||
/* double click test */
|
/* double click test */
|
||||||
/* if previous event was same type, and previous was release, and now it presses... */
|
/* if previous event was same type, and previous was release, and now it presses... */
|
||||||
if (wm_event_is_double_click(&event, evt)) {
|
if (wm_event_is_double_click(&event, evt)) {
|
||||||
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
|
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
|
||||||
printf("%s Send double click\n", __func__);
|
printf("%s Send double click\n", __func__);
|
||||||
evt->val = event.val = KM_DBL_CLICK;
|
evt->val = event.val = KM_DBL_CLICK;
|
||||||
}
|
}
|
||||||
@ -3216,7 +3216,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
|
|||||||
attach_ndof_data(&event, customdata);
|
attach_ndof_data(&event, customdata);
|
||||||
wm_event_add(win, &event);
|
wm_event_add(win, &event);
|
||||||
|
|
||||||
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
|
if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
|
||||||
printf("%s sending NDOF_MOTION, prev = %d %d\n", __func__, event.x, event.y);
|
printf("%s sending NDOF_MOTION, prev = %d %d\n", __func__, event.x, event.y);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2897,8 +2897,9 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* XXX weak; border should be configured for this without reading event types */
|
/* XXX weak; border should be configured for this without reading event types */
|
||||||
if (RNA_struct_find_property(op->ptr, "gesture_mode") )
|
if (RNA_struct_find_property(op->ptr, "gesture_mode")) {
|
||||||
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
|
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
|
||||||
|
}
|
||||||
|
|
||||||
retval = op->type->exec(C, op);
|
retval = op->type->exec(C, op);
|
||||||
OPERATOR_RETVAL_CHECK(retval);
|
OPERATOR_RETVAL_CHECK(retval);
|
||||||
@ -2915,8 +2916,9 @@ static void wm_gesture_end(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
ED_area_tag_redraw(CTX_wm_area(C));
|
ED_area_tag_redraw(CTX_wm_area(C));
|
||||||
|
|
||||||
if (RNA_struct_find_property(op->ptr, "cursor") )
|
if (RNA_struct_find_property(op->ptr, "cursor")) {
|
||||||
WM_cursor_modal_restore(CTX_wm_window(C));
|
WM_cursor_modal_restore(CTX_wm_window(C));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int WM_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
int WM_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
@ -3194,8 +3196,9 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
|
|||||||
if (win->tweak == NULL) {
|
if (win->tweak == NULL) {
|
||||||
if (CTX_wm_region(C)) {
|
if (CTX_wm_region(C)) {
|
||||||
if (event->val == KM_PRESS) {
|
if (event->val == KM_PRESS) {
|
||||||
if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) )
|
if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
|
||||||
win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
|
win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3220,8 +3223,9 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
|
|
||||||
wm_gesture_tag_redraw(C);
|
wm_gesture_tag_redraw(C);
|
||||||
|
|
||||||
if (RNA_struct_find_property(op->ptr, "cursor") )
|
if (RNA_struct_find_property(op->ptr, "cursor")) {
|
||||||
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
||||||
|
}
|
||||||
|
|
||||||
return OPERATOR_RUNNING_MODAL;
|
return OPERATOR_RUNNING_MODAL;
|
||||||
}
|
}
|
||||||
@ -3235,8 +3239,9 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
|
|
||||||
wm_gesture_tag_redraw(C);
|
wm_gesture_tag_redraw(C);
|
||||||
|
|
||||||
if (RNA_struct_find_property(op->ptr, "cursor") )
|
if (RNA_struct_find_property(op->ptr, "cursor")) {
|
||||||
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
||||||
|
}
|
||||||
|
|
||||||
return OPERATOR_RUNNING_MODAL;
|
return OPERATOR_RUNNING_MODAL;
|
||||||
}
|
}
|
||||||
@ -3448,8 +3453,9 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
|||||||
|
|
||||||
wm_gesture_tag_redraw(C);
|
wm_gesture_tag_redraw(C);
|
||||||
|
|
||||||
if (RNA_struct_find_property(op->ptr, "cursor") )
|
if (RNA_struct_find_property(op->ptr, "cursor")) {
|
||||||
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
|
||||||
|
}
|
||||||
|
|
||||||
return OPERATOR_RUNNING_MODAL;
|
return OPERATOR_RUNNING_MODAL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user