[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12384] branches/qdune/blender:

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Oct 24 19:47:30 CEST 2007


Revision: 12384
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12384
Author:   blendix
Date:     2007-10-24 19:47:30 +0200 (Wed, 24 Oct 2007)

Log Message:
-----------

QDune branch
============

Added Makefile building support, patch by GSR, thanks!

Fix for CMake building.

Undo MSVC compatibility fix I committed earlier, the problem
was already fixed.

Modified Paths:
--------------
    branches/qdune/blender/extern/Makefile
    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
    branches/qdune/blender/source/Makefile
    branches/qdune/blender/source/blender/render/CMakeLists.txt
    branches/qdune/blender/source/blender/render/intern/source/Makefile
    branches/qdune/blender/source/nan_definitions.mk

Added Paths:
-----------
    branches/qdune/blender/extern/qdune/Makefile

Modified: branches/qdune/blender/extern/Makefile
===================================================================
--- branches/qdune/blender/extern/Makefile	2007-10-24 17:20:53 UTC (rev 12383)
+++ branches/qdune/blender/extern/Makefile	2007-10-24 17:47:30 UTC (rev 12384)
@@ -33,7 +33,7 @@
 
 SOURCEDIR = extern
 DIR = $(OCGDIR)/extern
-DIRS = qhull/src solid 
+DIRS = qhull/src solid qdune
 
 ifeq ($(WITH_FREETYPE2), true)
     DIRS += bFTGL/src

Added: branches/qdune/blender/extern/qdune/Makefile
===================================================================
--- branches/qdune/blender/extern/qdune/Makefile	                        (rev 0)
+++ branches/qdune/blender/extern/qdune/Makefile	2007-10-24 17:47:30 UTC (rev 12384)
@@ -0,0 +1,82 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2002 by Hans Lambermont
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): gsrb3d (reuse for qdune building)
+#
+# ***** END GPL LICENSE BLOCK *****
+LIBNAME = qdune
+include nan_definitions.mk
+SOURCEDIR = extern/$(LIBNAME)
+DIR = $(OCGDIR)/extern/$(LIBNAME)
+DISTDIR = .
+
+CP = $(NANBLENDERHOME)/intern/tools/cpifdiff.sh
+
+QDUNEDIRS = \
+blender \
+core \
+framebuffer \
+framework \
+hider \
+imgio \
+mpgrid \
+primitives \
+qdtl \
+ribparse \
+svm
+
+CCSRCS = $(wildcard */*.cpp)
+
+CPPFLAGS += -D_LIB -I../../source/blender/makesdna
+CPPFLAGS += -I../../source/blender/render/extern/include
+CPPFLAGS += $(NAN_OPENEXR_INC)
+CPPFLAGS += -I$(NAN_JPEG)/include
+CPPFLAGS += $(addprefix -I, $(QDUNEDIRS))
+
+install:: objdirs all debug
+	@[ -d $(NAN_QDUNE) ] || mkdir -p $(NAN_QDUNE)
+	@[ -d $(NAN_QDUNE)/include ] || mkdir -p $(NAN_QDUNE)/include
+	@for i in $(QDUNEDIRS); do \
+	[ -d $(NAN_QDUNE)/include/$$i ] || mkdir -p $(NAN_QDUNE)/include/$$i; \
+	$(CP) $(DISTDIR)/$$i/*.h $(NAN_QDUNE)/include/$$i; \
+	done
+	@[ -d $(NAN_QDUNE)/lib ] || mkdir -p $(NAN_QDUNE)/lib
+	@$(CP) $(OCGDIR)/extern/qdune/libqdune.a $(NAN_QDUNE)/lib
+ifeq ($(OS),darwin)
+	ranlib $(NAN_QDUNE)/lib/libqdune.a
+endif
+
+include nan_compile.mk
+
+.PHONY: objdirs clean
+
+objdirs::
+	@for i in $(QDUNEDIRS); do \
+		[ -d $(DIR)/$(DEBUG_DIR)$$i ] || mkdir -p $(DIR)/$(DEBUG_DIR)$$i; \
+	done
+
+clean::
+	rm -rf $(DIR)
+	rm -rf $(NAN_QDUNE)/lib/libqdune.a
+	rm -rf $(NAN_QDUNE)/include

Modified: branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp	2007-10-24 17:20:53 UTC (rev 12383)
+++ branches/qdune/blender/extern/qdune/framebuffer/FrameBuffer.cpp	2007-10-24 17:47:30 UTC (rev 12384)
@@ -165,7 +165,7 @@
 void FrameBuffer::operator()(int x, int y, float rgbaz[5])
 {
 	x -= xstart, y -= ystart;
-	if ( ((x < 0) || (y < 0)) || ((x >= (int)width) || (y >= (int)height)) ) { return;}
+	if ((x < 0) or (y < 0) or (x >= (int)width) or (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 17:20:53 UTC (rev 12383)
+++ branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp	2007-10-24 17:47:30 UTC (rev 12384)
@@ -483,7 +483,7 @@
 		cur_bucket->mps = NULL;
 	}
 
-	if (!opaque_only) {
+	if (not 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 (!transp_mps.empty()) {
+		if (not 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) || (p_zmin > opts.farClip)) // completely behind nearclip or farclip
+	if ((p_zmax < opts.nearClip) or (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)) ||
-	    (int((fb->xStart() + fb->Width())*xsamples + X_xt_smp) < p_xmin) ||
-			(p_ymax < (int(fb->yStart()*ysamples) - (int)Y_xt_smp)) ||
+	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
 			(int((fb->yStart() + fb->Height())*ysamples + Y_xt_smp) < p_ymin))
 	{
 		prim_culled++;
 		return NOT_VISIBLE;
 	}
-	if ((p_zmin < (float)RI_EPSILON) && (p_zmax > opts.nearClip))
+	if ((p_zmin < (float)RI_EPSILON) and (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) &&
+				if ((cb->xmax >= bk2->xmin) && (bk2->xmax >= cb->xmin) and
 				    (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 (!pointgrid) {
+			if (not 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 || (opsum >= attr->opacity_threshold)) {
+				if (only_z or (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 || (opsum >= attr->opacity_threshold))
+			if (only_z or (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 17:20:53 UTC (rev 12383)
+++ branches/qdune/blender/extern/qdune/mpgrid/MicroPolygonGrid.cpp	2007-10-24 17:47:30 UTC (rev 12384)
@@ -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 && !Ng_updated)
+			if (attr->displacement_shader->shader->update_Ng and not 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) && (ydim >= 2));
+	assert((xdim >= 2) and (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) && (ydim >= 2));
+	assert((xdim >= 2) and (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) && (ydim >= 2));
+	assert((xdim >= 2) and (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) && (ydim >= 2));
+	assert((xdim >= 2) and (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) && (ydim >= 2));
+	assert((xdim >= 2) and (ydim >= 2));
 
 	unsigned int idx = 0;
 	const unsigned int xp1 = xdim+1, xp2 = 2*xp1;
@@ -565,7 +565,7 @@
 						}
 					}
 				}
-				else if ((slt == SL_POINT) || (slt == SL_COLOR) || (slt == SL_VECTOR) || (slt == SL_NORMAL)) {
+				else if ((slt == SL_POINT) or (slt == SL_COLOR) or (slt == SL_VECTOR) or (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
===================================================================

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list