- assorted warning fixes (signedness, float->double)
- added decimate,boolean modifier copydata methods
This commit is contained in:
@@ -35,8 +35,8 @@
|
||||
#include "BKE_constraint.h"
|
||||
|
||||
|
||||
#define DEPSX 5.0
|
||||
#define DEPSY 1.8
|
||||
#define DEPSX 5.0f
|
||||
#define DEPSY 1.8f
|
||||
|
||||
#define DAGQUEUEALLOC 50
|
||||
|
||||
|
||||
@@ -670,7 +670,7 @@ void graph_bfs(void)
|
||||
if((itA->node->color == DAG_WHITE) ) {
|
||||
itA->node->color = DAG_GRAY;
|
||||
itA->node->BFS_dist = node->BFS_dist + 1;
|
||||
itA->node->k = minheight;
|
||||
itA->node->k = (float) minheight;
|
||||
push_queue(nqueue,itA->node);
|
||||
}
|
||||
|
||||
@@ -683,11 +683,11 @@ void graph_bfs(void)
|
||||
}
|
||||
if (pos[node->BFS_dist] > node->k ) {
|
||||
pos[node->BFS_dist] += 1;
|
||||
node->k = pos[node->BFS_dist];
|
||||
node->k = (float) pos[node->BFS_dist];
|
||||
} else {
|
||||
pos[node->BFS_dist] = node->k +1;
|
||||
pos[node->BFS_dist] = (int) node->k +1;
|
||||
}
|
||||
set_node_xy(node, DEPSX*2*node->BFS_dist, pos[node->BFS_dist]*DEPSY*2);
|
||||
set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
|
||||
node->color = DAG_BLACK;
|
||||
/*
|
||||
fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
|
||||
@@ -820,7 +820,7 @@ DagNodeQueue * graph_dfs(void)
|
||||
|
||||
time++;
|
||||
itA->node->DFS_dist = node->DFS_dist + 1;
|
||||
itA->node->k = minheight;
|
||||
itA->node->k = (float) minheight;
|
||||
push_stack(nqueue,itA->node);
|
||||
skip = 1;
|
||||
break;
|
||||
@@ -860,11 +860,11 @@ DagNodeQueue * graph_dfs(void)
|
||||
maxpos = node->DFS_dist;
|
||||
if (pos[node->DFS_dist] > node->k ) {
|
||||
pos[node->DFS_dist] += 1;
|
||||
node->k = pos[node->DFS_dist];
|
||||
node->k = (float) pos[node->DFS_dist];
|
||||
} else {
|
||||
pos[node->DFS_dist] = node->k +1;
|
||||
pos[node->DFS_dist] = (int) node->k +1;
|
||||
}
|
||||
set_node_xy(node, DEPSX*2*node->DFS_dist, pos[node->DFS_dist]*DEPSY*2);
|
||||
set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
|
||||
|
||||
/*
|
||||
fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
|
||||
|
||||
@@ -726,6 +726,14 @@ static void decimateModifier_initData(ModifierData *md)
|
||||
dmd->percent = 1.0;
|
||||
}
|
||||
|
||||
static void decimateModifier_copyData(ModifierData *md, ModifierData *target)
|
||||
{
|
||||
DecimateModifierData *dmd = (DecimateModifierData*) md;
|
||||
DecimateModifierData *tdmd = (DecimateModifierData*) target;
|
||||
|
||||
tdmd->percent = dmd->percent;
|
||||
}
|
||||
|
||||
static void *decimateModifier_applyModifier(ModifierData *md, Object *ob, void *derivedData, float (*vertexCos)[3], int useRenderParams, int isFinalCalc)
|
||||
{
|
||||
DecimateModifierData *dmd = (DecimateModifierData*) md;
|
||||
@@ -1109,6 +1117,14 @@ static void softbodyModifier_deformVerts(ModifierData *md, Object *ob, void *der
|
||||
|
||||
/* Boolean */
|
||||
|
||||
static void booleanModifier_copyData(ModifierData *md, ModifierData *target)
|
||||
{
|
||||
BooleanModifierData *bmd = (BooleanModifierData*) md;
|
||||
BooleanModifierData *tbmd = (BooleanModifierData*) target;
|
||||
|
||||
tbmd->object = bmd->object;
|
||||
}
|
||||
|
||||
static int booleanModifier_isDisabled(ModifierData *md)
|
||||
{
|
||||
BooleanModifierData *bmd = (BooleanModifierData*) md;
|
||||
@@ -1223,6 +1239,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
|
||||
mti->type = eModifierTypeType_Nonconstructive;
|
||||
mti->flags = eModifierTypeFlag_AcceptsMesh;
|
||||
mti->initData = decimateModifier_initData;
|
||||
mti->copyData = decimateModifier_copyData;
|
||||
mti->applyModifier = decimateModifier_applyModifier;
|
||||
|
||||
mti = INIT_TYPE(Wave);
|
||||
@@ -1264,6 +1281,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
|
||||
mti = INIT_TYPE(Boolean);
|
||||
mti->type = eModifierTypeType_Nonconstructive;
|
||||
mti->flags = eModifierTypeFlag_AcceptsMesh;
|
||||
mti->copyData = booleanModifier_copyData;
|
||||
mti->isDisabled = booleanModifier_isDisabled;
|
||||
mti->applyModifier = booleanModifier_applyModifier;
|
||||
mti->foreachObjectLink = booleanModifier_foreachObjectLink;
|
||||
|
||||
@@ -460,7 +460,6 @@ PyObject *newBezTriple( PyObject *args)
|
||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"wrong number of points");
|
||||
{
|
||||
int i;
|
||||
if (length == 9)
|
||||
status = PyArg_ParseTuple( args, "fffffffff",
|
||||
&numbuf[0],
|
||||
|
||||
@@ -152,7 +152,7 @@ static void draw_deps(DagNode *node)
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
v1[0]= x1;
|
||||
v1[1]= (y1+y2)/2 -0.3;
|
||||
v1[1]= (y1+y2)/2 -0.3f;
|
||||
sprintf(str, " %s", ((ID *) node->ob)->name+2);
|
||||
|
||||
calc_oopstext(str, v1);
|
||||
|
||||
@@ -747,7 +747,7 @@ static void calc_text_rcts(SpaceText *st)
|
||||
CLAMP(st->txtbar.ymax, 2, curarea->winy-2);
|
||||
|
||||
st->pix_per_line= (float) ltexth/curarea->winy;
|
||||
if (st->pix_per_line<.1) st->pix_per_line=.1;
|
||||
if (st->pix_per_line<.1) st->pix_per_line=.1f;
|
||||
|
||||
lbarstart= MIN2(txt_get_span(st->text->lines.first, st->text->curl),
|
||||
txt_get_span(st->text->lines.first, st->text->sell));
|
||||
|
||||
@@ -955,7 +955,7 @@ int face_pick(Mesh *me, short x, short y, unsigned int *index)
|
||||
}
|
||||
/* Convert the color back to a face index */
|
||||
*index = framebuffer_to_index(col);
|
||||
if (col==0 || (*index)<=0 || (*index)>me->totface)
|
||||
if (col==0 || (*index)<=0 || (*index)>(unsigned) me->totface)
|
||||
return 0;
|
||||
|
||||
(*index)--;
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
#include "BIF_mywindow.h"
|
||||
#include "BIF_space.h"
|
||||
#include "BIF_glutil.h"
|
||||
#include "BIF_editfont.h"
|
||||
#include "BIF_interface.h"
|
||||
#include "BIF_butspace.h"
|
||||
|
||||
@@ -2698,9 +2699,7 @@ static int ui_do_but_CHARTAB(uiBut *but)
|
||||
float sx, sy, ex, ey;
|
||||
float width, height;
|
||||
float butw, buth;
|
||||
int x, y;
|
||||
unsigned long cs;
|
||||
unsigned long che;
|
||||
int x, y, cs, che;
|
||||
|
||||
/* Check the position */
|
||||
uiGetMouse(mywinget(), mval);
|
||||
|
||||
@@ -1713,8 +1713,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
||||
float sx, sy, ex, ey;
|
||||
float width, height;
|
||||
float butw, buth;
|
||||
int x, y;
|
||||
unsigned long cs;
|
||||
int x, y, cs;
|
||||
wchar_t wstr[2];
|
||||
unsigned char ustr[16];
|
||||
PackedFile *pf;
|
||||
|
||||
@@ -248,8 +248,8 @@ static void renderwin_reset_view(RenderWin *rw)
|
||||
/* crop option makes image smaller */
|
||||
if ((G.scene->r.mode & R_BORDER) && (G.scene->r.mode & R_MOVIECROP)) {
|
||||
if(!(G.scene->r.scemode & R_OGL)) {
|
||||
rectx*= (G.scene->r.border.xmax-G.scene->r.border.xmin);
|
||||
recty*= (G.scene->r.border.ymax-G.scene->r.border.ymin);
|
||||
rectx= (int) (rectx*(G.scene->r.border.xmax-G.scene->r.border.xmin));
|
||||
recty= (int) (recty*(G.scene->r.border.ymax-G.scene->r.border.ymin));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user