forked from bartvdbraak/blender
style cleanup:
also fix for building ghost test and fix double free in one of the tests
This commit is contained in:
parent
245c94a75e
commit
f5f25b81e8
2
extern/recastnavigation/recast-capi.cpp
vendored
2
extern/recastnavigation/recast-capi.cpp
vendored
@ -278,7 +278,7 @@ static inline void swapfunc(char *, char *, int, int);
|
||||
#define min(a, b) (a) < (b) ? a : b
|
||||
#define swapcode(TYPE, parmi, parmj, n) \
|
||||
{ \
|
||||
long i = (n) / sizeof (TYPE); \
|
||||
long i = (n) / sizeof(TYPE); \
|
||||
TYPE *pi = (TYPE *) (parmi); \
|
||||
TYPE *pj = (TYPE *) (parmj); \
|
||||
do { \
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -665,11 +665,11 @@ int ControlParticles::initFromBinaryFile(string filename) {
|
||||
int ptype=0;
|
||||
float psize=0.0;
|
||||
ntlVec3Gfx ppos,pvel;
|
||||
gzread(gzf, &ptype, sizeof( ptype ));
|
||||
gzread(gzf, &psize, sizeof( float ));
|
||||
gzread(gzf, &ptype, sizeof(ptype));
|
||||
gzread(gzf, &psize, sizeof(float));
|
||||
|
||||
for(int j=0; j<3; j++) { gzread(gzf, &ppos[j], sizeof( float )); }
|
||||
for(int j=0; j<3; j++) { gzread(gzf, &pvel[j], sizeof( float )); }
|
||||
for (int j=0; j<3; j++) { gzread(gzf, &ppos[j], sizeof(float)); }
|
||||
for (int j=0; j<3; j++) { gzread(gzf, &pvel[j], sizeof(float)); }
|
||||
|
||||
ControlParticle p;
|
||||
p.reset();
|
||||
|
@ -639,8 +639,8 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type,
|
||||
GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type, GHOST_IWindow *Iwindow)
|
||||
{
|
||||
GHOST_TInt32 x_screen, y_screen;
|
||||
GHOST_SystemWin32 *system = ((GHOST_SystemWin32 * ) getSystem());
|
||||
GHOST_WindowWin32 *window = ( GHOST_WindowWin32 * ) Iwindow;
|
||||
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *) getSystem();
|
||||
GHOST_WindowWin32 *window = (GHOST_WindowWin32 *) Iwindow;
|
||||
|
||||
system->getCursorPosition(x_screen, y_screen);
|
||||
|
||||
|
@ -526,7 +526,6 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Dispose the system */
|
||||
GHOST_DisposeSystem(shSystem);
|
||||
GHOST_DisposeEventConsumer(consumer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ Application::Application(GHOST_ISystem *system)
|
||||
m_secondaryWindow = system->createWindow(title2, 340, 64, 320, 200, GHOST_kWindowStateNormal,
|
||||
GHOST_kDrawingContextTypeOpenGL, false, false);
|
||||
if (!m_secondaryWindow) {
|
||||
cout << "could not create secondary window\n";
|
||||
std::cout << "could not create secondary window\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -58,12 +58,12 @@ public:
|
||||
MEM_CacheLimiterCClass(MEM_CacheLimiter_Destruct_Func data_destructor_, MEM_CacheLimiter_DataSize_Func data_size)
|
||||
: data_destructor(data_destructor_), cache(data_size) {
|
||||
}
|
||||
~MEM_CacheLimiterCClass();
|
||||
~MEM_CacheLimiterCClass();
|
||||
|
||||
handle_t * insert(void * data);
|
||||
|
||||
void destruct(void * data,
|
||||
list_t::iterator it);
|
||||
list_t::iterator it);
|
||||
|
||||
cache_t * get_cache() {
|
||||
return &cache;
|
||||
@ -79,9 +79,9 @@ private:
|
||||
class MEM_CacheLimiterHandleCClass {
|
||||
public:
|
||||
MEM_CacheLimiterHandleCClass(void * data_,
|
||||
MEM_CacheLimiterCClass * parent_)
|
||||
: data(data_), parent(parent_) { }
|
||||
~MEM_CacheLimiterHandleCClass();
|
||||
MEM_CacheLimiterCClass * parent_)
|
||||
: data(data_), parent(parent_) { }
|
||||
~MEM_CacheLimiterHandleCClass();
|
||||
void set_iter(list_t::iterator it_) {
|
||||
it = it_;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
|
||||
return AVI_ERROR_FORMAT;
|
||||
}
|
||||
|
||||
movie->header = (AviMainHeader *) MEM_mallocN(sizeof (AviMainHeader), "movieheader");
|
||||
movie->header = (AviMainHeader *) MEM_mallocN(sizeof(AviMainHeader), "movieheader");
|
||||
|
||||
if (GET_FCC(movie->fp) != FCC("AVI ") ||
|
||||
GET_FCC(movie->fp) != FCC("LIST") ||
|
||||
@ -769,7 +769,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
|
||||
if (movie->fp == NULL)
|
||||
return AVI_ERROR_OPEN;
|
||||
|
||||
movie->offset_table = (int64_t *) MEM_mallocN((1 + streams * 2) * sizeof (int64_t), "offsettable");
|
||||
movie->offset_table = (int64_t *) MEM_mallocN((1 + streams * 2) * sizeof(int64_t), "offsettable");
|
||||
|
||||
for (i = 0; i < 1 + streams * 2; i++)
|
||||
movie->offset_table[i] = -1L;
|
||||
|
@ -1878,8 +1878,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
|
||||
|
||||
/* r = co * 0.75 + q * 0.25 */
|
||||
VertDataCopy(r, co, ss);
|
||||
VertDataMulN(r, .75f, ss);
|
||||
VertDataMulN(q, .25f, ss);
|
||||
VertDataMulN(r, 0.75f, ss);
|
||||
VertDataMulN(q, 0.25f, ss);
|
||||
VertDataAdd(r, q, ss);
|
||||
|
||||
/* nCo = nCo + (r - nCo) * avgSharpness */
|
||||
|
@ -1007,7 +1007,7 @@ int cloth_add_spring(ClothModifierData *clmd, unsigned int indexA, unsigned int
|
||||
if (cloth) {
|
||||
// TODO: look if this spring is already there
|
||||
|
||||
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
|
||||
if (!spring)
|
||||
return 0;
|
||||
@ -1079,7 +1079,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
cloth->springs = NULL;
|
||||
|
||||
edgelist = MEM_callocN ( sizeof ( LinkNode * ) * numverts, "cloth_edgelist_alloc" );
|
||||
edgelist = MEM_callocN ( sizeof (LinkNode *) * numverts, "cloth_edgelist_alloc" );
|
||||
|
||||
if (!edgelist)
|
||||
return 0;
|
||||
@ -1096,7 +1096,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
// structural springs
|
||||
for ( i = 0; i < numedges; i++ ) {
|
||||
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
|
||||
if ( spring ) {
|
||||
spring->ij = MIN2(medge[i].v1, medge[i].v2);
|
||||
@ -1154,7 +1154,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
|
||||
// if ( mface[i].v4 ) --> Quad face
|
||||
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
|
||||
if (!spring) {
|
||||
cloth_free_errorsprings(cloth, edgehash, edgelist);
|
||||
@ -1192,7 +1192,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
if (!BLI_edgehash_haskey(edgehash, MIN2(tspring2->ij, index2), MAX2(tspring2->ij, index2)) &&
|
||||
(index2 != tspring2->ij))
|
||||
{
|
||||
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
|
||||
if (!spring) {
|
||||
cloth_free_errorsprings(cloth, edgehash, edgelist);
|
||||
@ -1229,7 +1229,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
tspring2 = search2->link;
|
||||
|
||||
if (tspring->ij == tspring2->kl) {
|
||||
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
|
||||
|
||||
if (!spring) {
|
||||
cloth_free_errorsprings(cloth, edgehash, edgelist);
|
||||
|
@ -643,12 +643,12 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
|
||||
{
|
||||
int i;
|
||||
|
||||
*collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * numresult * 64, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
|
||||
*collisions = (CollPair *) MEM_mallocN(sizeof(CollPair) * numresult * 64, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
|
||||
*collisions_index = *collisions;
|
||||
|
||||
for ( i = 0; i < numresult; i++ ) {
|
||||
*collisions_index = cloth_collision ( (ModifierData *)clmd, (ModifierData *)collmd,
|
||||
overlap+i, *collisions_index, dt );
|
||||
overlap+i, *collisions_index, dt );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1713,7 +1713,7 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, float *si
|
||||
|
||||
t02 = x1 * x2 + y1 * y2;
|
||||
if (fabs(t02) >= 1.0)
|
||||
t02 = .5 * M_PI;
|
||||
t02 = 0.5 * M_PI;
|
||||
else
|
||||
t02 = (saacos(t02)) / 2.0f;
|
||||
|
||||
|
@ -186,7 +186,7 @@ DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts)
|
||||
DO_INLINE lfVector *create_lfvector(unsigned int verts)
|
||||
{
|
||||
// TODO: check if memory allocation was successfull */
|
||||
return (lfVector *)MEM_callocN (verts * sizeof(lfVector), "cloth_implicit_alloc_vector");
|
||||
return (lfVector *)MEM_callocN(verts * sizeof(lfVector), "cloth_implicit_alloc_vector");
|
||||
// return (lfVector *)cloth_aligned_malloc(&MEMORY_BASE, verts * sizeof(lfVector));
|
||||
}
|
||||
/* delete long vector */
|
||||
@ -514,7 +514,7 @@ static void print_bfmatrix(fmatrix3x3 *m3)
|
||||
DO_INLINE fmatrix3x3 *create_bfmatrix(unsigned int verts, unsigned int springs)
|
||||
{
|
||||
// TODO: check if memory allocation was successfull */
|
||||
fmatrix3x3 *temp = (fmatrix3x3 *)MEM_callocN (sizeof (fmatrix3x3) * (verts + springs), "cloth_implicit_alloc_matrix");
|
||||
fmatrix3x3 *temp = (fmatrix3x3 *)MEM_callocN(sizeof(fmatrix3x3) * (verts + springs), "cloth_implicit_alloc_matrix");
|
||||
temp[0].vcount = verts;
|
||||
temp[0].scount = springs;
|
||||
return temp;
|
||||
@ -720,7 +720,7 @@ int implicit_init(Object *UNUSED(ob), ClothModifierData *clmd)
|
||||
verts = cloth->verts;
|
||||
|
||||
// create implicit base
|
||||
id = (Implicit_Data *)MEM_callocN (sizeof(Implicit_Data), "implicit vecmat");
|
||||
id = (Implicit_Data *)MEM_callocN(sizeof(Implicit_Data), "implicit vecmat");
|
||||
cloth->implicit = id;
|
||||
|
||||
/* process diagonal elements */
|
||||
|
@ -212,7 +212,7 @@ Lattice *BKE_lattice_copy(Lattice *lt)
|
||||
|
||||
if (lt->dvert) {
|
||||
int tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
ltn->dvert = MEM_mallocN(sizeof (MDeformVert) * tot, "Lattice MDeformVert");
|
||||
ltn->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert");
|
||||
copy_dverts(ltn->dvert, lt->dvert, tot);
|
||||
}
|
||||
|
||||
|
@ -444,7 +444,7 @@ void copy_dverts(MDeformVert *dst, MDeformVert *src, int copycount)
|
||||
for (i = 0; i < copycount; i++) {
|
||||
if (src[i].dw) {
|
||||
dst[i].dw = MEM_callocN(sizeof(MDeformWeight) * src[i].totweight, "copy_deformWeight");
|
||||
memcpy(dst[i].dw, src[i].dw, sizeof (MDeformWeight) * src[i].totweight);
|
||||
memcpy(dst[i].dw, src[i].dw, sizeof(MDeformWeight) * src[i].totweight);
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,7 +957,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
|
||||
}
|
||||
final++;
|
||||
|
||||
(*alledge) = medge = MEM_callocN(sizeof (MEdge) * final, "BKE_mesh_make_edges mdge");
|
||||
(*alledge) = medge = MEM_callocN(sizeof(MEdge) * final, "BKE_mesh_make_edges mdge");
|
||||
(*_totedge) = final;
|
||||
|
||||
for (a = totedge, ed = edsort; a > 1; a--, ed++) {
|
||||
|
@ -4114,7 +4114,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
|
||||
if (ptype&readMask) {
|
||||
activeParts++;
|
||||
|
||||
gzread(gzf, &(pa->size), sizeof( float ));
|
||||
gzread(gzf, &(pa->size), sizeof(float));
|
||||
|
||||
pa->size /= 10.0f;
|
||||
|
||||
|
@ -1856,7 +1856,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
|
||||
BKE_ptcache_write(&pid, framenr);
|
||||
|
||||
tend();
|
||||
// printf ( "Frame: %d, Time: %f\n\n", (int)smd->time, ( float ) tval() );
|
||||
// printf ( "Frame: %d, Time: %f\n\n", (int)smd->time, (float) tval() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t max
|
||||
{
|
||||
size_t len = 0;
|
||||
while (*src && len < maxcpy) { /* XXX can still run over the buffer because utf8 size isn't known :| */
|
||||
len += BLI_str_utf8_from_unicode(*src++, dst+len);
|
||||
len += BLI_str_utf8_from_unicode(*src++, dst + len);
|
||||
}
|
||||
|
||||
dst[len]= '\0';
|
||||
|
@ -576,7 +576,7 @@ void *BLI_thread_queue_pop(ThreadQueue *queue)
|
||||
if (!BLI_gsqueue_is_empty(queue->queue)) {
|
||||
BLI_gsqueue_pop(queue->queue, &work);
|
||||
|
||||
if(BLI_gsqueue_is_empty(queue->queue))
|
||||
if (BLI_gsqueue_is_empty(queue->queue))
|
||||
pthread_cond_broadcast(&queue->finish_cond);
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@ void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms)
|
||||
if (!BLI_gsqueue_is_empty(queue->queue)) {
|
||||
BLI_gsqueue_pop(queue->queue, &work);
|
||||
|
||||
if(BLI_gsqueue_is_empty(queue->queue))
|
||||
if (BLI_gsqueue_is_empty(queue->queue))
|
||||
pthread_cond_broadcast(&queue->finish_cond);
|
||||
}
|
||||
|
||||
@ -678,7 +678,7 @@ void BLI_thread_queue_wait_finish(ThreadQueue *queue)
|
||||
/* wait for finish condition */
|
||||
pthread_mutex_lock(&queue->mutex);
|
||||
|
||||
while(!BLI_gsqueue_is_empty(queue->queue))
|
||||
while (!BLI_gsqueue_is_empty(queue->queue))
|
||||
pthread_cond_wait(&queue->finish_cond, &queue->mutex);
|
||||
|
||||
pthread_mutex_unlock(&queue->mutex);
|
||||
|
@ -49,10 +49,10 @@ enum {
|
||||
typedef struct VoronoiEvent {
|
||||
struct VoronoiEvent *next, *prev;
|
||||
|
||||
int type; /* type of event (site or circle) */
|
||||
float site[2]; /* site for which event was generated */
|
||||
int type; /* type of event (site or circle) */
|
||||
float site[2]; /* site for which event was generated */
|
||||
|
||||
struct VoronoiParabola *parabola; /* parabola for which event was generated */
|
||||
struct VoronoiParabola *parabola; /* parabola for which event was generated */
|
||||
} VoronoiEvent;
|
||||
|
||||
typedef struct VoronoiParabola {
|
||||
@ -254,9 +254,9 @@ static float voronoi_getXOfEdge(VoronoiProcess *process, VoronoiParabola *par, f
|
||||
b = b1 - b2;
|
||||
c = c1 - c2;
|
||||
|
||||
disc = b*b - 4 * a * c;
|
||||
x1 = (-b + sqrtf(disc)) / (2*a);
|
||||
x2 = (-b - sqrtf(disc)) / (2*a);
|
||||
disc = b * b - 4 * a * c;
|
||||
x1 = (-b + sqrtf(disc)) / (2 * a);
|
||||
x2 = (-b - sqrtf(disc)) / (2 * a);
|
||||
|
||||
if (p[1] < r[1])
|
||||
ry = MAX2(x1, x2);
|
||||
@ -268,7 +268,7 @@ static float voronoi_getXOfEdge(VoronoiProcess *process, VoronoiParabola *par, f
|
||||
|
||||
static VoronoiParabola *voronoi_getParabolaByX(VoronoiProcess *process, float xx)
|
||||
{
|
||||
VoronoiParabola * par = process->root;
|
||||
VoronoiParabola *par = process->root;
|
||||
float x = 0.0f;
|
||||
float ly = process->current_y;
|
||||
|
||||
@ -371,7 +371,7 @@ static void voronoi_addParabola(VoronoiProcess *process, float site[2])
|
||||
s[0] = (site[0] + fp[0]) / 2.0f;
|
||||
s[1] = process->height;
|
||||
|
||||
if(site[0] > fp[0])
|
||||
if (site[0] > fp[0])
|
||||
root->edge = voronoiEdge_new(s, fp, site);
|
||||
else
|
||||
root->edge = voronoiEdge_new(s, site, fp);
|
||||
@ -506,12 +506,12 @@ void voronoi_finishEdge(VoronoiProcess *process, VoronoiParabola *parabola)
|
||||
void voronoi_clampEdgeVertex(int width, int height, float *coord, float *other_coord)
|
||||
{
|
||||
const float corners[4][2] = {{0.0f, 0.0f},
|
||||
{width - 1, 0.0f},
|
||||
{width - 1, height - 1},
|
||||
{0.0f, height - 1}};
|
||||
{width - 1, 0.0f},
|
||||
{width - 1, height - 1},
|
||||
{0.0f, height - 1}};
|
||||
int i;
|
||||
|
||||
if (IN_RANGE_INCL(coord[0], 0, width-1) && IN_RANGE_INCL(coord[1], 0, height-1)) {
|
||||
if (IN_RANGE_INCL(coord[0], 0, width - 1) && IN_RANGE_INCL(coord[1], 0, height - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -609,9 +609,9 @@ static int voronoi_getNextSideCoord(ListBase *edges, float coord[2], int dim, in
|
||||
static void voronoi_createBoundaryEdges(ListBase *edges, int width, int height)
|
||||
{
|
||||
const float corners[4][2] = {{width - 1, 0.0f},
|
||||
{width - 1, height - 1},
|
||||
{0.0f, height - 1},
|
||||
{0.0f, 0.0f}};
|
||||
{width - 1, height - 1},
|
||||
{0.0f, height - 1},
|
||||
{0.0f, 0.0f}};
|
||||
int i, dim = 0, dir = 1;
|
||||
|
||||
float coord[2] = {0.0f, 0.0f};
|
||||
@ -756,7 +756,7 @@ static void voronoi_addTriangle(int v1, int v2, int v3, int (**triangles)[3], in
|
||||
*triangles = MEM_callocN(sizeof(int[3]), "trianglulation triangles");
|
||||
}
|
||||
|
||||
triangle = (int*)&(*triangles)[(*triangles_total)];
|
||||
triangle = (int *)&(*triangles)[(*triangles_total)];
|
||||
|
||||
triangle[0] = v1;
|
||||
triangle[1] = v2;
|
||||
|
@ -1114,7 +1114,7 @@ bool AnimationExporter::hasAnimations(Scene *sce)
|
||||
{
|
||||
LinkNode *node;
|
||||
|
||||
for(node=this->export_settings->export_set; node; node=node->next) {
|
||||
for (node=this->export_settings->export_set; node; node=node->next) {
|
||||
Object *ob = (Object *)node->link;
|
||||
|
||||
FCurve *fcu = 0;
|
||||
|
@ -49,7 +49,7 @@ void MaterialsExporter::exportMaterials(Scene *sce)
|
||||
bool MaterialsExporter::hasMaterials(Scene *sce)
|
||||
{
|
||||
LinkNode *node;
|
||||
for(node=this->export_settings->export_set; node; node = node->next) {
|
||||
for (node=this->export_settings->export_set; node; node = node->next) {
|
||||
Object *ob = (Object *)node->link;
|
||||
int a;
|
||||
for (a = 0; a < ob->totcol; a++) {
|
||||
|
@ -231,7 +231,7 @@ void WorkScheduler::initialize()
|
||||
cl_platform_id platform = platforms[indexPlatform];
|
||||
cl_uint numberOfDevices;
|
||||
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, 0, &numberOfDevices);
|
||||
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices + numberOfDevicesReceived * sizeof (cl_device_id), 0);
|
||||
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices + numberOfDevicesReceived * sizeof(cl_device_id), 0);
|
||||
numberOfDevicesReceived += numberOfDevices;
|
||||
}
|
||||
if (totalNumberOfDevices > 0) {
|
||||
|
@ -1216,7 +1216,7 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float
|
||||
gsz = rsize[2]; // by the do_*EdgeDetection() function.
|
||||
|
||||
fsz = gsz + isz + osz; // calculate size of pixel index buffer needed
|
||||
gbuf = (unsigned short *)MEM_callocN(sizeof (unsigned short) * fsz * 2, "DEM"); // allocate edge/gradient pixel index buffer
|
||||
gbuf = (unsigned short *)MEM_callocN(sizeof(unsigned short) * fsz * 2, "DEM"); // allocate edge/gradient pixel index buffer
|
||||
|
||||
do_createEdgeLocationBuffer(t, rw, lres, res, gbuf, &innerEdgeOffset, &outerEdgeOffset, isz, gsz);
|
||||
do_fillGradientBuffer(rw, res, gbuf, isz, osz, gsz, innerEdgeOffset, outerEdgeOffset);
|
||||
|
@ -156,7 +156,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
|
||||
|
||||
memcpy(newbezt, fcu->bezt, sizeof(BezTriple) * (i + 1));
|
||||
memcpy(newbezt + i + 1, fcu->bezt + i, sizeof(BezTriple));
|
||||
memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof (BezTriple) * (fcu->totvert - (i + 1)));
|
||||
memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof(BezTriple) * (fcu->totvert - (i + 1)));
|
||||
fcu->totvert++;
|
||||
|
||||
/* reassign pointers... (free old, and add new) */
|
||||
|
@ -878,7 +878,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
|
||||
glPopMatrix();
|
||||
|
||||
/* min max */
|
||||
glColor3f(.5f, .5f, .5f);
|
||||
glColor3f(0.5f, 0.5f, 0.5f);
|
||||
min = yofs + scopes->minmax[0][0] * h;
|
||||
max = yofs + scopes->minmax[0][1] * h;
|
||||
CLAMP(min, rect.ymin, rect.ymax);
|
||||
@ -1012,7 +1012,9 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco
|
||||
int i, j;
|
||||
float w, h, centerx, centery, diam;
|
||||
float alpha;
|
||||
const float colors[6][3] = {{.75, 0, 0}, {.75, .75, 0}, {0, .75, 0}, {0, .75, .75}, {0, 0, .75}, {.75, 0, .75}};
|
||||
const float colors[6][3] = {
|
||||
{0.75, 0.0, 0.0}, {0.75, 0.75, 0.0}, {0.0, 0.75, 0.0},
|
||||
{0.0, 0.75, 0.75}, {0.0, 0.0, 0.75}, {0.75, 0.0, 0.75}};
|
||||
GLint scissor[4];
|
||||
|
||||
rect.xmin = (float)recti->xmin + 1;
|
||||
@ -1375,7 +1377,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
|
||||
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
|
||||
}
|
||||
|
||||
/* grid, every .25 step */
|
||||
/* grid, every 0.25 step */
|
||||
gl_shaded_color((unsigned char *)wcol->inner, -16);
|
||||
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f);
|
||||
/* grid, every 1.0 step */
|
||||
|
@ -347,7 +347,7 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float UNUSED(a
|
||||
glColor4f(0.0f, 0.0f, 0.0f, 1);
|
||||
viconutil_draw_lineloop_smooth(pts, 3);
|
||||
|
||||
glColor3f(.9f, .9f, .9f);
|
||||
glColor3f(0.9f, 0.9f, 0.9f);
|
||||
viconutil_draw_points(pts, 3, 1);
|
||||
}
|
||||
|
||||
|
@ -737,7 +737,8 @@ void ui_theme_init_default(void)
|
||||
rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
|
||||
|
||||
rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
|
||||
rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw
|
||||
/* alpha 80 is not meant editable, used for wire+action draw */
|
||||
rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80);
|
||||
|
||||
rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
|
||||
rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
|
||||
|
@ -102,7 +102,7 @@ void make_editLatt(Object *obedit)
|
||||
|
||||
if (lt->dvert) {
|
||||
int tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
lt->editlatt->latt->dvert = MEM_mallocN(sizeof (MDeformVert) * tot, "Lattice MDeformVert");
|
||||
lt->editlatt->latt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert");
|
||||
copy_dverts(lt->editlatt->latt->dvert, lt->dvert, tot);
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ void load_editLatt(Object *obedit)
|
||||
if (editlt->dvert) {
|
||||
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
|
||||
lt->dvert = MEM_mallocN(sizeof (MDeformVert) * tot, "Lattice MDeformVert");
|
||||
lt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert");
|
||||
copy_dverts(lt->dvert, editlt->dvert, tot);
|
||||
}
|
||||
}
|
||||
|
@ -1175,7 +1175,7 @@ static int area_split_menu_init(bContext *C, wmOperator *op)
|
||||
sAreaSplitData *sd;
|
||||
|
||||
/* custom data */
|
||||
sd = (sAreaSplitData *)MEM_callocN(sizeof (sAreaSplitData), "op_area_split");
|
||||
sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split");
|
||||
op->customdata = sd;
|
||||
|
||||
sd->sarea = CTX_wm_area(C);
|
||||
@ -1210,7 +1210,7 @@ static int area_split_init(bContext *C, wmOperator *op)
|
||||
if (dir == 'h' && sa->winy < 2 * areaminy) return 0;
|
||||
|
||||
/* custom data */
|
||||
sd = (sAreaSplitData *)MEM_callocN(sizeof (sAreaSplitData), "op_area_split");
|
||||
sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split");
|
||||
op->customdata = sd;
|
||||
|
||||
sd->sarea = sa;
|
||||
@ -2180,7 +2180,7 @@ static int area_join_init(bContext *C, wmOperator *op)
|
||||
return 0;
|
||||
}
|
||||
|
||||
jd = (sAreaJoinData *)MEM_callocN(sizeof (sAreaJoinData), "op_area_join");
|
||||
jd = (sAreaJoinData *)MEM_callocN(sizeof(sAreaJoinData), "op_area_join");
|
||||
|
||||
jd->sa1 = sa1;
|
||||
jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM;
|
||||
|
@ -5096,8 +5096,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
/* This can be removed once fixed properly in
|
||||
* BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
|
||||
* at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available */
|
||||
if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_size_pressure(scene, pop->s.brush)))
|
||||
* at zero pressure we should do nothing 1/2^12 is 0.0002 which is the sensitivity of the most sensitive pen tablet available */
|
||||
if (tablet && (pressure < 0.0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_size_pressure(scene, pop->s.brush)))
|
||||
return;
|
||||
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
|
||||
|
||||
/* fast switch to render slots */
|
||||
for (i = 0; i < MAX2(IMA_MAX_RENDER_SLOT, 9); i++) {
|
||||
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY+i, KM_PRESS, 0, 0);
|
||||
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY + i, KM_PRESS, 0, 0);
|
||||
RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot");
|
||||
RNA_int_set(kmi->ptr, "value", i);
|
||||
}
|
||||
|
@ -1002,7 +1002,7 @@ static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
/* outline active and selected emphasis */
|
||||
if (node->flag & (NODE_ACTIVE | SELECT) ) {
|
||||
if (node->flag & (NODE_ACTIVE | SELECT)) {
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
|
||||
@ -1105,7 +1105,7 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
|
||||
/* XXX only kept for debugging
|
||||
* selection state is indicated by socket outline below!
|
||||
*/
|
||||
#if 0
|
||||
#if 0
|
||||
/* body */
|
||||
uiSetRoundBox(15);
|
||||
UI_ThemeColor4(TH_NODE);
|
||||
@ -1116,18 +1116,18 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
|
||||
/* outline active and selected emphasis */
|
||||
if (node->flag & (NODE_ACTIVE | SELECT)) {
|
||||
glEnable(GL_BLEND);
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
/* using different shades of TH_TEXT_HI for the empasis, like triangle */
|
||||
if( node->flag & NODE_ACTIVE )
|
||||
if (node->flag & NODE_ACTIVE)
|
||||
UI_ThemeColorShadeAlpha(TH_TEXT_HI, 0, -40);
|
||||
else
|
||||
UI_ThemeColorShadeAlpha(TH_TEXT_HI, -20, -120);
|
||||
uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size);
|
||||
|
||||
glDisable( GL_LINE_SMOOTH );
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* only draw input socket. as they all are placed on the same position.
|
||||
* highlight also if node itself is selected, since we don't display the node body separately!
|
||||
@ -1194,7 +1194,7 @@ static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *imap
|
||||
uiLayout *col;
|
||||
int source;
|
||||
|
||||
if(!imaptr->data)
|
||||
if (!imaptr->data)
|
||||
return;
|
||||
|
||||
col = uiLayoutColumn(layout, 0);
|
||||
@ -2429,7 +2429,7 @@ static void node_composit_buts_viewer_but(uiLayout *layout, bContext *UNUSED(C),
|
||||
static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL);
|
||||
uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE);
|
||||
uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE);
|
||||
|
||||
}
|
||||
|
||||
|
@ -825,7 +825,7 @@ typedef struct DrawCache {
|
||||
|
||||
static void text_drawcache_init(SpaceText *st)
|
||||
{
|
||||
DrawCache *drawcache = MEM_callocN(sizeof (DrawCache), "text draw cache");
|
||||
DrawCache *drawcache = MEM_callocN(sizeof(DrawCache), "text draw cache");
|
||||
|
||||
drawcache->winx = -1;
|
||||
drawcache->nlines = BLI_countlist(&st->text->lines);
|
||||
|
@ -431,7 +431,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r
|
||||
}
|
||||
|
||||
tend();
|
||||
// printf ( "Draw Time: %f\n",( float ) tval() );
|
||||
// printf ( "Draw Time: %f\n",(float) tval() );
|
||||
|
||||
if (tex_shadow)
|
||||
GPU_texture_unbind(tex_shadow);
|
||||
|
@ -1669,7 +1669,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
|
||||
if (rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom = RV3D_CAMZOOM_MAX;
|
||||
}
|
||||
else if (rv3d->dist > 0.001f * v3d->grid) {
|
||||
view_zoom_mouseloc(ar, .83333f, mx, my);
|
||||
view_zoom_mouseloc(ar, 0.83333f, mx, my);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1921,7 +1921,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op)
|
||||
view_dolly_mouseloc(ar, rv3d->ofs, mousevec, 1.2f);
|
||||
}
|
||||
else {
|
||||
view_dolly_mouseloc(ar, rv3d->ofs, mousevec, .83333f);
|
||||
view_dolly_mouseloc(ar, rv3d->ofs, mousevec, 0.83333f);
|
||||
}
|
||||
|
||||
if (rv3d->viewlock & RV3D_BOXVIEW)
|
||||
|
@ -221,7 +221,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
|
||||
setlinestyle(0);
|
||||
cpack(0x0);
|
||||
fdrawline(-0.020 / w, 0, -0.1 / w, 0);
|
||||
fdrawline(0.1 / w, 0, .020 / w, 0);
|
||||
fdrawline(0.1 / w, 0, 0.020 / w, 0);
|
||||
fdrawline(0, -0.020 / h, 0, -0.1 / h);
|
||||
fdrawline(0, 0.1 / h, 0, 0.020 / h);
|
||||
|
||||
|
@ -246,7 +246,7 @@ void GPU_set_gpu_mipmapping(int gpu_mipmap){
|
||||
/* only actually enable if it's supported */
|
||||
GTS.gpu_mipmap = gpu_mipmap && GLEW_EXT_framebuffer_object;
|
||||
|
||||
if(old_value != GTS.gpu_mipmap) {
|
||||
if (old_value != GTS.gpu_mipmap) {
|
||||
GPU_free_images();
|
||||
}
|
||||
}
|
||||
@ -644,7 +644,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
|
||||
}
|
||||
else {
|
||||
if(GTS.gpu_mipmap) {
|
||||
if (GTS.gpu_mipmap) {
|
||||
if (use_high_bit_depth)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
|
||||
else
|
||||
|
@ -161,11 +161,11 @@ DefNode( CompositorNode, CMP_NODE_MOVIECLIP, def_cmp_movieclip, "MOVIE
|
||||
DefNode( CompositorNode, CMP_NODE_TRANSFORM, dev_cmd_transform, "TRANSFORM", Transform, "Transform", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_STABILIZE2D, def_cmp_stabilize2d, "STABILIZE2D", Stabilize, "Stabilize 2D", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MOVIEDISTORTION,def_cmp_moviedistortion,"MOVIEDISTORTION",MovieDistortion, "Movie Distortion", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MASK_BOX, def_cmp_boxmask, "BOXMASK" ,BoxMask, "Box mask", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MASK_ELLIPSE, def_cmp_ellipsemask, "ELLIPSEMASK" ,EllipseMask, "Ellipse mask", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_BOKEHIMAGE, def_cmp_bokehimage, "BOKEHIMAGE" ,BokehImage, "Bokeh image", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_BOKEHBLUR, def_cmp_bokehblur, "BOKEHBLUR" ,BokehBlur, "Bokeh Blur", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_SWITCH, def_cmp_switch, "SWITCH" ,Switch, "Switch", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MASK_BOX, def_cmp_boxmask, "BOXMASK", BoxMask, "Box mask", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MASK_ELLIPSE, def_cmp_ellipsemask, "ELLIPSEMASK", EllipseMask, "Ellipse mask", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_BOKEHIMAGE, def_cmp_bokehimage, "BOKEHIMAGE", BokehImage, "Bokeh image", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_BOKEHBLUR, def_cmp_bokehblur, "BOKEHBLUR", BokehBlur, "Bokeh Blur", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_SWITCH, def_cmp_switch, "SWITCH", Switch, "Switch", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_COLORCORRECTION,def_cmp_colorcorrection,"COLORCORRECTION",ColorCorrection, "ColorCorrection", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_MASK, def_cmp_mask, "MASK", Mask, "Mask", "" )
|
||||
DefNode( CompositorNode, CMP_NODE_KEYINGSCREEN, def_cmp_keyingscreen, "KEYINGSCREEN", KeyingScreen, "KeyingScreen", "" )
|
||||
|
@ -117,18 +117,18 @@ static int rna_SmokeModifier_density_get_length(PointerRNA *ptr, int length[RNA_
|
||||
{
|
||||
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
|
||||
|
||||
if (settings->fluid)
|
||||
{
|
||||
if (settings->fluid) {
|
||||
float *density = smoke_get_density(settings->fluid);
|
||||
unsigned int size = settings->res[0] * settings->res[1] * settings->res[2];
|
||||
|
||||
if(density)
|
||||
if (density)
|
||||
length[0] = size;
|
||||
else
|
||||
length[0] = 0;
|
||||
}
|
||||
else
|
||||
length[0] = 0; // No smoke domain created yet
|
||||
else {
|
||||
length[0] = 0; /* No smoke domain created yet */
|
||||
}
|
||||
|
||||
return length[0];
|
||||
}
|
||||
|
@ -780,21 +780,21 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "k1");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
|
||||
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
||||
RNA_def_property_ui_text(prop, "K1", "First coefficient of third order polynomial radial distortion");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
||||
|
||||
prop = RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "k2");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
|
||||
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
||||
RNA_def_property_ui_text(prop, "K2", "Second coefficient of third order polynomial radial distortion");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
||||
|
||||
prop = RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "k3");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
|
||||
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
||||
RNA_def_property_ui_text(prop, "K3", "Third coefficient of third order polynomial radial distortion");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
||||
|
||||
|
@ -72,7 +72,7 @@ static void exec(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **
|
||||
|
||||
BKE_mask_rasterize(mask, sx, sy, res, TRUE, node->custom1);
|
||||
|
||||
if(node->custom1){
|
||||
if (node->custom1) {
|
||||
PLX_antialias_buffer(res,sx,sy);
|
||||
}
|
||||
/* pass on output and free */
|
||||
|
@ -36,13 +36,13 @@ static bNodeSocketTemplate outputs[] = {
|
||||
/* node type definition */
|
||||
void register_node_type_sh_particle_info(bNodeTreeType *ttype)
|
||||
{
|
||||
static bNodeType ntype;
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(ttype, &ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0);
|
||||
node_type_compatibility(&ntype, NODE_NEW_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, outputs);
|
||||
node_type_size(&ntype, 150, 60, 200);
|
||||
node_type_base(ttype, &ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0);
|
||||
node_type_compatibility(&ntype, NODE_NEW_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, outputs);
|
||||
node_type_size(&ntype, 150, 60, 200);
|
||||
|
||||
nodeRegisterType(ttype, &ntype);
|
||||
nodeRegisterType(ttype, &ntype);
|
||||
}
|
||||
|
||||
|
@ -88,9 +88,9 @@ void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
|
||||
}
|
||||
|
||||
if (in->hasoutput && in->sockettype == SOCK_VECTOR) {
|
||||
out[0] = out[0] * .5f + .5f;
|
||||
out[1] = out[1] * .5f + .5f;
|
||||
out[2] = out[2] * .5f + .5f;
|
||||
out[0] = out[0] * 0.5f + 0.5f;
|
||||
out[1] = out[1] * 0.5f + 0.5f;
|
||||
out[2] = out[2] * 0.5f + 0.5f;
|
||||
out[3] = 1;
|
||||
}
|
||||
}
|
||||
|
@ -40,9 +40,7 @@ static bNodeSocketTemplate outputs[]= {
|
||||
|
||||
static void vectorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **UNUSED(in), short UNUSED(thread))
|
||||
{
|
||||
out[0] = p->co[0];
|
||||
out[1] = p->co[1];
|
||||
out[2] = p->co[2];
|
||||
copy_v3_v3(out, p->co);
|
||||
}
|
||||
|
||||
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
@ -80,7 +80,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
|
||||
float col[4];
|
||||
tex_input_rgba(col, in[4], p, thread);
|
||||
|
||||
hue += 0.5f; /* [-.5, .5] -> [0, 1] */
|
||||
hue += 0.5f; /* [-0.5, 0.5] -> [0, 1] */
|
||||
|
||||
do_hue_sat_fac(node, out, hue, sat, val, col, fac);
|
||||
|
||||
|
@ -65,7 +65,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
|
||||
|
||||
if (node->custom2 || node->need_exec==0) {
|
||||
/* this node refers to its own texture tree! */
|
||||
copy_v4_v4(out, (fabs(co[0] - co[1]) < .01) ? white : red);
|
||||
copy_v4_v4(out, (fabs(co[0] - co[1]) < 0.01) ? white : red);
|
||||
}
|
||||
else if (nodetex) {
|
||||
TexResult texres;
|
||||
|
@ -1874,7 +1874,7 @@ static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
|
||||
{
|
||||
VectorObject *vecA = NULL, *vecB = NULL;
|
||||
int result = 0;
|
||||
double epsilon = .000001f;
|
||||
double epsilon = 0.000001f;
|
||||
double lenA, lenB;
|
||||
|
||||
if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)) {
|
||||
|
@ -376,7 +376,7 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
|
||||
return normalize * 1.f;
|
||||
}
|
||||
else { /* schlick */
|
||||
const float k = 1.55f * g - .55f * g * g * g;
|
||||
const float k = 1.55f * g - 0.55f * g * g * g;
|
||||
const float kcostheta = k * dot_v3v3(w, wp);
|
||||
return normalize * (1.f - k * k) / ((1.f - kcostheta) * (1.f - kcostheta));
|
||||
}
|
||||
@ -394,7 +394,7 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
|
||||
return normalize * (1.f - g * g) / powf(1.f + g * g - 2.f * g * costheta, 1.5f);
|
||||
case MA_VOL_PH_SCHLICK:
|
||||
{
|
||||
const float k = 1.55f * g - .55f * g * g * g;
|
||||
const float k = 1.55f * g - 0.55f * g * g * g;
|
||||
const float kcostheta = k * costheta;
|
||||
return normalize * (1.f - k * k) / ((1.f - kcostheta) * (1.f - kcostheta));
|
||||
}
|
||||
|
@ -2858,7 +2858,7 @@ static void quad_bezier_2d(float *result, float *v1, float *v2, float *ipodata)
|
||||
p1[0]= v1[0];
|
||||
p1[1]= v1[1];
|
||||
|
||||
/* official formula 2*p2 - .5*p1 - .5*p3 */
|
||||
/* official formula 2*p2 - 0.5*p1 - 0.5*p3 */
|
||||
p2[0]= -0.5f*p1[0] - 0.5f*p3[0];
|
||||
p2[1]= -0.5f*p1[1] - 0.5f*p3[1];
|
||||
|
||||
|
@ -2295,8 +2295,8 @@ static void WM_OT_collada_export(wmOperatorType *ot)
|
||||
RNA_def_int(ot->srna, "export_mesh_type", 0, INT_MIN, INT_MAX,
|
||||
"Resolution", "Modifier resolution for export", INT_MIN, INT_MAX);
|
||||
|
||||
RNA_def_enum(ot->srna, "export_mesh_type_selection", prop_bc_export_mesh_type,
|
||||
0, "Resolution", "Modifier resolution for export");
|
||||
RNA_def_enum(ot->srna, "export_mesh_type_selection", prop_bc_export_mesh_type, 0,
|
||||
"Resolution", "Modifier resolution for export");
|
||||
|
||||
RNA_def_boolean(ot->srna, "selected", 0, "Selection Only",
|
||||
"Export only selected elements");
|
||||
|
@ -369,7 +369,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
|
||||
win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
|
||||
|
||||
/* until screens get drawn, make it nice grey */
|
||||
glClearColor(.55, .55, .55, 0.0);
|
||||
glClearColor(0.55, 0.55, 0.55, 0.0);
|
||||
/* Crash on OSS ATI: bugs.launchpad.net/ubuntu/+source/mesa/+bug/656100 */
|
||||
if (!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
@ -987,7 +987,7 @@ void wm_window_testbreak(void)
|
||||
/* only check for breaks every 50 milliseconds
|
||||
* if we get called more often.
|
||||
*/
|
||||
if ((curtime - ltime) > .05) {
|
||||
if ((curtime - ltime) > 0.05) {
|
||||
int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
|
||||
|
||||
if (hasevent)
|
||||
|
@ -446,8 +446,8 @@ static void GetRGB(short type,
|
||||
c2 = KX_Mcol2uint_new(mmcol[2]);
|
||||
if (mface->v4)
|
||||
c3 = KX_Mcol2uint_new(mmcol[3]);
|
||||
}else // backup white
|
||||
{
|
||||
}
|
||||
else { // backup white
|
||||
c0 = KX_rgbaint2uint_new(color);
|
||||
c1 = KX_rgbaint2uint_new(color);
|
||||
c2 = KX_rgbaint2uint_new(color);
|
||||
|
@ -860,7 +860,7 @@ void BL_ConvertActuators(const char* maggiename,
|
||||
float paraArg1 = 0.0;
|
||||
float paraArg2 = 0.0;
|
||||
|
||||
switch (randAct->distribution) {
|
||||
switch (randAct->distribution) {
|
||||
case ACT_RANDOM_BOOL_CONST:
|
||||
modeArg = SCA_RandomActuator::KX_RANDOMACT_BOOL_CONST;
|
||||
paraArg1 = (float) randAct->int_arg_1;
|
||||
|
@ -588,7 +588,7 @@ public:
|
||||
|
||||
/* These static functions are referenced by ALL PyObjectPlus_Proxy types
|
||||
* they take the C++ reference from the PyObjectPlus_Proxy and call
|
||||
* its own virtual py_repr, py_base_dealloc ,etc. functions.
|
||||
* its own virtual py_repr, py_base_dealloc, etc. functions.
|
||||
*/
|
||||
|
||||
static PyObject* py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds); /* allows subclassing */
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
void InsertActiveQList(SG_QList& head)
|
||||
{
|
||||
SG_QList::iterator<SCA_ILogicBrick> it(head);
|
||||
for(it.begin(); !it.end() && m_Execute_Priority > (*it)->m_Execute_Priority; ++it);
|
||||
for (it.begin(); !it.end() && m_Execute_Priority > (*it)->m_Execute_Priority; ++it);
|
||||
it.add_back(this);
|
||||
}
|
||||
|
||||
@ -119,9 +119,8 @@ public:
|
||||
// this element comes before the first
|
||||
*current = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(++it; !it.end() && (*it)->m_gameobj == m_gameobj && m_Execute_Priority > (*it)->m_Execute_Priority; ++it);
|
||||
else {
|
||||
for (++it; !it.end() && (*it)->m_gameobj == m_gameobj && m_Execute_Priority > (*it)->m_Execute_Priority; ++it);
|
||||
}
|
||||
it.add_back(this);
|
||||
}
|
||||
|
@ -191,7 +191,8 @@ bool SCA_JoystickSensor::Evaluate()
|
||||
if (( m_bAllEvents && js->aAnyButtonPressIsPositive()) || (!m_bAllEvents && js->aButtonPressIsPositive(m_button))) {
|
||||
m_istrig = 1;
|
||||
result = true;
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
if (m_istrig) {
|
||||
m_istrig = 0;
|
||||
result = true;
|
||||
|
@ -835,12 +835,12 @@ KX_PYMETHODDEF_DOC( BL_Shader, isValid, "isValid()" )
|
||||
return PyLong_FromSsize_t( ( mShader !=0 && mOk ) );
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, getVertexProg ,"getVertexProg( )" )
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, getVertexProg, "getVertexProg( )" )
|
||||
{
|
||||
return PyUnicode_FromString(vertProg?vertProg:"");
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" )
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg, "getFragmentProg( )" )
|
||||
{
|
||||
return PyUnicode_FromString(fragProg?fragProg:"");
|
||||
}
|
||||
@ -941,7 +941,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
||||
}
|
||||
|
||||
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f, "setUniform2f(name, fx, fy)")
|
||||
{
|
||||
if (mError) {
|
||||
Py_RETURN_NONE;
|
||||
@ -1038,7 +1038,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
|
||||
}
|
||||
|
||||
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i, "setUniform2i(name, ix, iy)")
|
||||
{
|
||||
if (mError) {
|
||||
Py_RETURN_NONE;
|
||||
@ -1109,7 +1109,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) "
|
||||
return NULL;
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )")
|
||||
KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv, "setUniformfv( float (list2 or list3 or list4) )")
|
||||
{
|
||||
if (mError) {
|
||||
Py_RETURN_NONE;
|
||||
|
@ -899,8 +899,8 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
|
||||
mMaterial->SetSharedMaterial(true);
|
||||
mScene->GetBucketManager()->ReleaseDisplayLists(this);
|
||||
return mShader->GetProxy();
|
||||
}else
|
||||
{
|
||||
}
|
||||
else {
|
||||
// decref all references to the object
|
||||
// then delete it!
|
||||
// We will then go back to fixed functionality
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "CcdPhysicsController.h"
|
||||
#endif
|
||||
|
||||
class KX_BulletPhysicsController : public KX_IPhysicsController ,public CcdPhysicsController
|
||||
class KX_BulletPhysicsController : public KX_IPhysicsController, public CcdPhysicsController
|
||||
{
|
||||
private:
|
||||
int m_savedCollisionFlags;
|
||||
|
@ -105,7 +105,8 @@ KX_Dome::KX_Dome (
|
||||
|
||||
CreateMeshDome180();
|
||||
m_numfaces = 4;
|
||||
}else if (m_angle > 180) {
|
||||
}
|
||||
else if (m_angle > 180) {
|
||||
cubetop.resize(2);
|
||||
cubebottom.resize(2);
|
||||
cubeleft.resize(2);
|
||||
@ -140,7 +141,8 @@ KX_Dome::KX_Dome (
|
||||
|
||||
CreateMeshDome180();
|
||||
m_numfaces = 4;
|
||||
}else if (m_angle > 180) {
|
||||
}
|
||||
else if (m_angle > 180) {
|
||||
cubetop.resize(2);
|
||||
cubebottom.resize(2);
|
||||
cubeleft.resize(2);
|
||||
@ -595,7 +597,7 @@ void KX_Dome::CreateMeshDome180(void)
|
||||
/* Left face - two triangles */
|
||||
|
||||
cubeleft[0].verts[0][0] = -M_SQRT2 / 2.0;
|
||||
cubeleft[0].verts[0][1] = .0;
|
||||
cubeleft[0].verts[0][1] = 0.0;
|
||||
cubeleft[0].verts[0][2] = -0.5;
|
||||
cubeleft[0].u[0] = 0.0;
|
||||
cubeleft[0].v[0] = 0.0;
|
||||
@ -1547,7 +1549,7 @@ void KX_Dome::CalculateCameraOrientation()
|
||||
|
||||
m_locRot[1] = MT_Matrix3x3( // Bottom
|
||||
c, s, 0.0,
|
||||
0.0 ,0.0, 1.0,
|
||||
0.0, 0.0, 1.0,
|
||||
s, -c, 0.0);
|
||||
|
||||
m_locRot[2] = MT_Matrix3x3( // 45deg - Left
|
||||
|
@ -1472,18 +1472,18 @@ void KX_KetsjiEngine::RenderDebugProperties()
|
||||
for (int j = tc_first; j < tc_numCategories; j++)
|
||||
{
|
||||
debugtxt.Format(m_profileLabels[j]);
|
||||
m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
|
||||
debugtxt.Ptr(),
|
||||
xcoord,ycoord,
|
||||
m_canvas->GetWidth(),
|
||||
m_canvas->GetHeight());
|
||||
m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
|
||||
debugtxt.Ptr(),
|
||||
xcoord,ycoord,
|
||||
m_canvas->GetWidth(),
|
||||
m_canvas->GetHeight());
|
||||
double time = m_logger->GetAverage((KX_TimeCategory)j);
|
||||
debugtxt.Format("%.3fms (%2.2f %%)", time*1000.f, time/tottime * 100.f);
|
||||
m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
|
||||
debugtxt.Ptr(),
|
||||
xcoord + 60 ,ycoord,
|
||||
m_canvas->GetWidth(),
|
||||
m_canvas->GetHeight());
|
||||
m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
|
||||
debugtxt.Ptr(),
|
||||
xcoord + 60, ycoord,
|
||||
m_canvas->GetWidth(),
|
||||
m_canvas->GetHeight());
|
||||
ycoord += 14;
|
||||
}
|
||||
}
|
||||
|
@ -104,19 +104,20 @@ bool PyMatTo(PyObject* pymat, T& mat)
|
||||
if (!PyErr_Occurred() && PySequence_Check(pyrow))
|
||||
{
|
||||
unsigned int cols = PySequence_Size(pyrow);
|
||||
if (cols != Size(mat))
|
||||
if (cols != Size(mat)) {
|
||||
noerror = false;
|
||||
else
|
||||
{
|
||||
for(unsigned int col = 0; col < cols; col++)
|
||||
{
|
||||
}
|
||||
else {
|
||||
for (unsigned int col = 0; col < cols; col++) {
|
||||
PyObject *item = PySequence_GetItem(pyrow, col); /* new ref */
|
||||
mat[row][col] = PyFloat_AsDouble(item);
|
||||
Py_DECREF(item);
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else {
|
||||
noerror = false;
|
||||
}
|
||||
Py_DECREF(pyrow);
|
||||
}
|
||||
} else
|
||||
|
@ -104,42 +104,42 @@ void KX_RadarSensor::SynchronizeTransform()
|
||||
{
|
||||
MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90));
|
||||
trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
case SENS_RADAR_Y_AXIS: // +Y Axis
|
||||
{
|
||||
MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
|
||||
trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
case SENS_RADAR_Z_AXIS: // +Z Axis
|
||||
{
|
||||
MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-90));
|
||||
trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
case SENS_RADAR_NEG_X_AXIS: // -X Axis
|
||||
{
|
||||
MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(-90));
|
||||
trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
case SENS_RADAR_NEG_Y_AXIS: // -Y Axis
|
||||
{
|
||||
//MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
|
||||
//trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
case SENS_RADAR_NEG_Z_AXIS: // -Z Axis
|
||||
{
|
||||
MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(90));
|
||||
trans.rotate(rotquatje);
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
|
||||
trans.translate(MT_Vector3 (0, -m_coneheight/2.0, 0));
|
||||
break;
|
||||
};
|
||||
default:
|
||||
@ -154,7 +154,7 @@ void KX_RadarSensor::SynchronizeTransform()
|
||||
m_cone_origin[1] = temp[1];
|
||||
m_cone_origin[2] = temp[2];
|
||||
|
||||
temp = trans(MT_Point3(0, -m_coneheight/2.0 ,0));
|
||||
temp = trans(MT_Point3(0, -m_coneheight/2.0, 0));
|
||||
m_cone_target[0] = temp[0];
|
||||
m_cone_target[1] = temp[1];
|
||||
m_cone_target[2] = temp[2];
|
||||
|
@ -258,7 +258,7 @@ void KX_SCA_AddObjectActuator::InstantAddObject()
|
||||
// Now it needs to be added to the current scene.
|
||||
SCA_IObject* replica = m_scene->AddReplicaObject(m_OriginalObject,GetParent(),m_timeProp );
|
||||
KX_GameObject * game_obj = static_cast<KX_GameObject *>(replica);
|
||||
game_obj->setLinearVelocity(m_linear_velocity ,m_localLinvFlag);
|
||||
game_obj->setLinearVelocity(m_linear_velocity, m_localLinvFlag);
|
||||
game_obj->setAngularVelocity(m_angular_velocity,m_localAngvFlag);
|
||||
game_obj->ResolveCombinedVelocities(m_linear_velocity, m_angular_velocity, m_localLinvFlag, m_localAngvFlag);
|
||||
|
||||
|
@ -1811,8 +1811,8 @@ bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* user
|
||||
// occlusion culling, the direction of the view is taken from the first plan which MUST be the near plane
|
||||
btDbvt::collideOCL(m_cullingTree->m_sets[1].m_root,planes_n,planes_o,planes_n[0],nplanes,dispatcher);
|
||||
btDbvt::collideOCL(m_cullingTree->m_sets[0].m_root,planes_n,planes_o,planes_n[0],nplanes,dispatcher);
|
||||
}else
|
||||
{
|
||||
}
|
||||
else {
|
||||
btDbvt::collideKDOP(m_cullingTree->m_sets[1].m_root,planes_n,planes_o,nplanes,dispatcher);
|
||||
btDbvt::collideKDOP(m_cullingTree->m_sets[0].m_root,planes_n,planes_o,nplanes,dispatcher);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user