[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12380] branches/qdune/blender/extern/ qdune:
Brecht Van Lommel
brechtvanlommel at pandora.be
Wed Oct 24 18:11:13 CEST 2007
Revision: 12380
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12380
Author: blendix
Date: 2007-10-24 18:11:13 +0200 (Wed, 24 Oct 2007)
Log Message:
-----------
QDune branch
============
Change "and", "or" and "not" to &&, || and !, to compile with MSVC.
Patch by Johnny Matthews, thanks!
Modified Paths:
--------------
branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp
branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp
branches/qdune/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp
branches/qdune/blender/extern/qdune/primitives/CCSubdivision.cpp
branches/qdune/blender/extern/qdune/primitives/Points.cpp
branches/qdune/blender/extern/qdune/ribparse/ribInterface.cpp
Modified: branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp 2007-10-24 15:58:49 UTC (rev 12379)
+++ branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp 2007-10-24 16:11:13 UTC (rev 12380)
@@ -165,7 +165,7 @@
void FrameBuffer::operator()(int x, int y, float rgbaz[5])
{
x -= xstart, y -= ystart;
- if ((x < 0) or (y < 0) or (x >= (int)width) or (y >= (int)height)) return;
+ if ( ((x < 0) || (y < 0)) || ((x >= (int)width) || (y >= (int)height)) ) { return;}
unsigned int ofs = (x + y*width) * dataPerPix;
switch (mode) {
case MD_A:
Modified: branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp 2007-10-24 15:58:49 UTC (rev 12379)
+++ branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp 2007-10-24 16:11:13 UTC (rev 12380)
@@ -483,7 +483,7 @@
cur_bucket->mps = NULL;
}
- if (not opaque_only) {
+ if (!opaque_only) {
// transparent mp's, merge current bucket mp's with forwarded mp's
if (Tmps) {
size_t tmc = transp_mps.size();
@@ -492,7 +492,7 @@
transp_mps[tmc++] = *mi;
}
mp_trans += (unsigned int)transp_mps.size();
- if (not transp_mps.empty()) {
+ if (!transp_mps.empty()) {
// back to front depth sort first
sort(transp_mps.begin(), transp_mps.end(), compZ_mp);
// rasterize all in order
@@ -672,7 +672,7 @@
const float p_zmin = MIN2(b.minmax[0].z, b.minmax[1].z);
const float p_zmax = MAX2(b.minmax[0].z, b.minmax[1].z);
const Options& opts = State::Instance()->topOptions();
- if ((p_zmax < opts.nearClip) or (p_zmin > opts.farClip)) // completely behind nearclip or farclip
+ if ((p_zmax < opts.nearClip) || (p_zmin > opts.farClip)) // completely behind nearclip or farclip
{
prim_culled++;
return NOT_VISIBLE;
@@ -707,15 +707,15 @@
// 2d frustum test, taking cropwindow and extra filter samples into account
const FrameBuffer* fb = State::Instance()->framebuffer;
- if ((p_xmax < (int(fb->xStart()*xsamples) - (int)X_xt_smp)) or
- (int((fb->xStart() + fb->Width())*xsamples + X_xt_smp) < p_xmin) or
- (p_ymax < (int(fb->yStart()*ysamples) - (int)Y_xt_smp)) or
+ if ((p_xmax < (int(fb->xStart()*xsamples) - (int)X_xt_smp)) ||
+ (int((fb->xStart() + fb->Width())*xsamples + X_xt_smp) < p_xmin) ||
+ (p_ymax < (int(fb->yStart()*ysamples) - (int)Y_xt_smp)) ||
(int((fb->yStart() + fb->Height())*ysamples + Y_xt_smp) < p_ymin))
{
prim_culled++;
return NOT_VISIBLE;
}
- if ((p_zmin < (float)RI_EPSILON) and (p_zmax > opts.nearClip))
+ if ((p_zmin < (float)RI_EPSILON) && (p_zmax > opts.nearClip))
{
// crossing eyeplane, the dreaded 'eyesplit'!
prim_culled++;
@@ -768,7 +768,7 @@
prim_culled++;
bool prim_assigned = false;
for (BucketIterator bk2=cur_bucket+1; bk2!=buckets.end(); ++bk2) {
- if ((cb->xmax >= bk2->xmin) && (bk2->xmax >= cb->xmin) and
+ if ((cb->xmax >= bk2->xmin) && (bk2->xmax >= cb->xmin) &&
(cb->ymax >= bk2->ymin) && (bk2->ymax >= cb->ymin))
{
// depth ordered insertion
@@ -1320,7 +1320,7 @@
mp->ymax += xt_dof;
// calculate the CoC radius for each quad vertex if not done yet
if (mp->v0->crad == -1.f) mp->v0->crad = CoC_radius(mp->v0->pp.z);
- if (not pointgrid) {
+ if (!pointgrid) {
if (mp->v1->crad == -1.f) mp->v1->crad = CoC_radius(mp->v1->pp.z);
if (mp->v2->crad == -1.f) mp->v2->crad = CoC_radius(mp->v2->pp.z);
if (mp->v3->crad == -1.f) mp->v3->crad = CoC_radius(mp->v3->pp.z);
@@ -1348,7 +1348,7 @@
// NOTE depth only renders really still should do shading so that opacity info is available,
// then the depth value can also properly take full opacity clipped geometry into account TODO
// for now have to consider depth renders fully opaque
- if (only_z or (opsum >= attr->opacity_threshold)) {
+ if (only_z || (opsum >= attr->opacity_threshold)) {
drawMP(mp); // opaque
imm_draw = true;
// refcount is not incremented so that after this loop it will be deleted below
@@ -1361,7 +1361,7 @@
}
// for other buckets, incr. refcount & add to either the opaque- or transp-list
mp->incRefCount();
- if (only_z or (opsum >= attr->opacity_threshold))
+ if (only_z || (opsum >= attr->opacity_threshold))
bk->mps->push_back(mp); // opaque
else
bk->Tmps->push_back(mp); // transparent
Modified: branches/qdune/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp 2007-10-24 15:58:49 UTC (rev 12379)
+++ branches/qdune/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp 2007-10-24 16:11:13 UTC (rev 12380)
@@ -162,7 +162,7 @@
// if Ng needs to be updated if P was modified,
// and it was not updated indirectly by shader ('calcnormal N P')
// then it must be done here
- if (attr->displacement_shader->shader->update_Ng and not Ng_updated)
+ if (attr->displacement_shader->shader->update_Ng && !Ng_updated)
calculateNormals(Ng_grid, P_grid);
}
else {
@@ -307,7 +307,7 @@
if (gtype != MicroPolygonGrid::G_NORMAL) return;
// exit if grid too small, should never happen, somewhere diceable() function probably not correct...
- assert((xdim >= 2) and (ydim >= 2));
+ assert((xdim >= 2) && (ydim >= 2));
const float idu2 = 0.5f/get_du();
@@ -331,7 +331,7 @@
if (gtype != MicroPolygonGrid::G_NORMAL) return;
// exit if grid too small, should never happen, somewhere diceable() function probably not correct...
- assert((xdim >= 2) and (ydim >= 2));
+ assert((xdim >= 2) && (ydim >= 2));
const float idv2 = 0.5f/get_dv();
@@ -356,7 +356,7 @@
if (gtype != MicroPolygonGrid::G_NORMAL) return;
// exit if grid too small, should never happen, somewhere diceable() function probably not correct...
- assert((xdim >= 2) and (ydim >= 2));
+ assert((xdim >= 2) && (ydim >= 2));
const float idu2 = 0.5f/get_du();
@@ -392,7 +392,7 @@
if (gtype != MicroPolygonGrid::G_NORMAL) return;
// exit if grid too small, should never happen, somewhere diceable() function probably not correct...
- assert((xdim >= 2) and (ydim >= 2));
+ assert((xdim >= 2) && (ydim >= 2));
const float idv2 = 0.5f/get_dv();
@@ -467,7 +467,7 @@
if (gtype != MicroPolygonGrid::G_NORMAL) return;
// exit if grid too small, should never happen, somewhere diceable() function probably not correct...
- assert((xdim >= 2) and (ydim >= 2));
+ assert((xdim >= 2) && (ydim >= 2));
unsigned int idx = 0;
const unsigned int xp1 = xdim+1, xp2 = 2*xp1;
@@ -565,7 +565,7 @@
}
}
}
- else if ((slt == SL_POINT) or (slt == SL_COLOR) or (slt == SL_VECTOR) or (slt == SL_NORMAL)) {
+ else if ((slt == SL_POINT) || (slt == SL_COLOR) || (slt == SL_VECTOR) || (slt == SL_NORMAL)) {
// initialize default grids
RtVector* fg = (RtVector*)addVariable(_sl_access[sa_idx].name, 3);
// initialization can be skipped if available as attached primitive variable, diced later
Modified: branches/qdune/blender/extern/qdune/primitives/CCSubdivision.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/primitives/CCSubdivision.cpp 2007-10-24 15:58:49 UTC (rev 12379)
+++ branches/qdune/blender/extern/qdune/primitives/CCSubdivision.cpp 2007-10-24 16:11:13 UTC (rev 12380)
@@ -316,7 +316,7 @@
// make the subdivision patches. See getSubdivData() for prerender flag purpose
JS_SDPatch::prerender = State::Instance()->rendering();
makePatches(vert_list, edge_list, face_list, this, &f, spb);
- JS_SDPatch::prerender = not JS_SDPatch::prerender;
+ JS_SDPatch::prerender = !JS_SDPatch::prerender;
}
void CCSubdivisionMesh::dice(MicroPolygonGrid &g, bool Pclose)
@@ -932,10 +932,10 @@
// then we already know we *must* dice using explicit subdivision.
const int val = vert_list[patch->eovert].edges.size();
#ifdef SKIP_GLOBAL_SUBDIVISION
- if ((not allquad) or (numeo > 1) or
- (patch->flags & SD_NONMANIFOLD) or (patch->flags & SD_CREASE) or (val < 3) or (val > 50))
+ if ((!allquad) || (numeo > 1) ||
+ (patch->flags & SD_NONMANIFOLD) || (patch->flags & SD_CREASE) || (val < 3) || (val > 50))
#else
- if ((patch->flags & SD_NONMANIFOLD) or (patch->flags & SD_CREASE) or (val < 3) or (val > 50))
+ if ((patch->flags & SD_NONMANIFOLD) || (patch->flags & SD_CREASE) || (val < 3) || (val > 50))
#endif
{
patch->makeExplicitSDPatch(vert_list, edge_list, face_list, parentprim);
@@ -1830,7 +1830,7 @@
{
// do one subdivision step and make four new subpatches
// u/v split flags ignored in this case, since this always is a 4-way split
- if (usplit or vsplit) {
+ if (usplit || vsplit) {
Subdivide(patch_verts, patch_edges, patch_faces, true);
rebuildLists(patch_verts, patch_edges, patch_faces, true);
if (spb) {
@@ -1863,11 +1863,11 @@
}
flags |= SD_ALLQUAD;
}
- if (((flags & SD_NONMANIFOLD) == 0) and ((flags & SD_ONE_EOV) == 0)) {
+ if (((flags & SD_NONMANIFOLD) == 0) && ((flags & SD_ONE_EOV) == 0)) {
int numeo = 0;
for (array_t<int>::const_iterator vi=fv.begin(); vi<fv.end(); ++vi) {
const unsigned int val = patch_verts[*vi].edges.size();
- if ((val != 2) and (val != ((patch_verts[*vi].flags & SD_BOUNDARY) ? 3 : 4))) {
+ if ((val != 2) && (val != ((patch_verts[*vi].flags & SD_BOUNDARY) ? 3 : 4))) {
if (++numeo > 1) {
usplit = vsplit = true;
return false;
@@ -2380,7 +2380,7 @@
// pow(0,0) returns error, don't!
inline double mypow(double x, double y)
{
- if ((x < 0.0) or ((x == 0.0) and (y == 0.0))) return 1.0;
+ if ((x < 0.0) || ((x == 0.0) && (y == 0.0))) return 1.0;
return pow(x, y);
}
Modified: branches/qdune/blender/extern/qdune/primitives/Points.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/primitives/Points.cpp 2007-10-24 15:58:49 UTC (rev 12379)
+++ branches/qdune/blender/extern/qdune/primitives/Points.cpp 2007-10-24 16:11:13 UTC (rev 12380)
@@ -220,7 +220,7 @@
void PointSet::split(const Framework &f, bool usplit, bool vsplit, splitbprims_t* spb)
{
Camera& cam = State::Instance()->projcam;
- if (usplit and vsplit) {
+ if (usplit && vsplit) {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list