[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48795] branches/soc-2011-tomato: Merging r48755 through r48793 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Tue Jul 10 12:11:54 CEST 2012
Revision: 48795
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48795
Author: nazgul
Date: 2012-07-10 10:11:54 +0000 (Tue, 10 Jul 2012)
Log Message:
-----------
Merging r48755 through r48793 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48755
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48793
Modified Paths:
--------------
branches/soc-2011-tomato/intern/raskter/CMakeLists.txt
branches/soc-2011-tomato/intern/raskter/raskter.c
branches/soc-2011-tomato/intern/raskter/raskter.h
branches/soc-2011-tomato/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_userpref.py
branches/soc-2011-tomato/source/blender/blenfont/BLF_translation.h
branches/soc-2011-tomato/source/blender/blenfont/intern/blf_lang.c
branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/fcurve.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/node.c
branches/soc-2011-tomato/source/blender/blenlib/BLI_string.h
branches/soc-2011-tomato/source/blender/blenlib/BLI_threads.h
branches/soc-2011-tomato/source/blender/blenlib/intern/string.c
branches/soc-2011-tomato/source/blender/collada/ImageExporter.cpp
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.h
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_DefocusNode.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
branches/soc-2011-tomato/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
branches/soc-2011-tomato/source/blender/compositor/operations/COM_MaskOperation.h
branches/soc-2011-tomato/source/blender/compositor/operations/COM_OpenCLKernels.cl
branches/soc-2011-tomato/source/blender/compositor/operations/COM_OpenCLKernels.cl.h
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
branches/soc-2011-tomato/source/blender/editors/animation/anim_deps.c
branches/soc-2011-tomato/source/blender/editors/animation/anim_filter.c
branches/soc-2011-tomato/source/blender/editors/animation/anim_ipo_utils.c
branches/soc-2011-tomato/source/blender/editors/armature/poseobject.c
branches/soc-2011-tomato/source/blender/editors/include/UI_interface.h
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/interface/interface_handlers.c
branches/soc-2011-tomato/source/blender/editors/interface/interface_ops.c
branches/soc-2011-tomato/source/blender/editors/interface/interface_regions.c
branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c
branches/soc-2011-tomato/source/blender/editors/space_node/node_draw.c
branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h
branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_ops.c
branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.c
branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.h
branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/soc-2011-tomato/source/blender/makesdna/DNA_meshdata_types.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_space_types.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_userdef_types.h
branches/soc-2011-tomato/source/blender/makesrna/RNA_access.h
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_Scene.cpp
branches/soc-2011-tomato/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
Added Paths:
-----------
branches/soc-2011-tomato/intern/raskter/raskter_kdtree.c
branches/soc-2011-tomato/intern/raskter/raskter_kdtree.h
branches/soc-2011-tomato/intern/raskter/raskter_mt.c
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/
branches/soc-2011-tomato/source/tools/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48754
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48793
Modified: branches/soc-2011-tomato/intern/raskter/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/raskter/CMakeLists.txt 2012-07-10 09:31:08 UTC (rev 48794)
+++ branches/soc-2011-tomato/intern/raskter/CMakeLists.txt 2012-07-10 10:11:54 UTC (rev 48795)
@@ -33,8 +33,11 @@
set(SRC
raskter.c
+ raskter_mt.c
+ raskter_kdtree.c
raskter.h
+ raskter_kdtree.h
)
blender_add_lib(bf_intern_raskter "${SRC}" "${INC}" "${INC_SYS}")
Modified: branches/soc-2011-tomato/intern/raskter/raskter.c
===================================================================
--- branches/soc-2011-tomato/intern/raskter/raskter.c 2012-07-10 09:31:08 UTC (rev 48794)
+++ branches/soc-2011-tomato/intern/raskter/raskter.c 2012-07-10 10:11:54 UTC (rev 48795)
@@ -30,37 +30,14 @@
#include <stdlib.h>
#include "raskter.h"
+//#define __PLX__FAKE_AA__
+//#define __PLX_KD_TREE__
+#ifdef __PLX_KD_TREE__
+#include "kdtree.h"
+#endif
-#define __PLX__FAKE_AA__
-/* from BLI_utildefines.h */
-#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
-#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
-#define ABS(a) ( (a) < 0 ? (-(a)) : (a) )
-struct e_status {
- int x;
- int ybeg;
- int xshift;
- int xdir;
- int drift;
- int drift_inc;
- int drift_dec;
- int num;
- struct e_status *e_next;
-};
-
-struct r_buffer_stats {
- float *buf;
- int sizex;
- int sizey;
-};
-
-struct r_fill_context {
- struct e_status *all_edges, *possible_edges;
- struct r_buffer_stats rb;
-};
-
/*
* Sort all the edges of the input polygon by Y, then by X, of the "first" vertex encountered.
* This will ensure we can scan convert the entire poly in one pass.
@@ -69,102 +46,113 @@
* just the poly. Since the DEM code could end up being coupled with this, we'll keep it separate
* for now.
*/
-static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, struct e_status *open_edge)
-{
- int i;
- int xbeg;
- int ybeg;
- int xend;
- int yend;
- int dx;
- int dy;
- int temp_pos;
- int xdist;
- struct e_status *e_new;
- struct e_status *next_edge;
- struct e_status **next_edge_ref;
- struct poly_vert *v;
- /* set up pointers */
- v = verts;
- ctx->all_edges = NULL;
- /* loop all verts */
- for (i = 0; i < num_verts; i++) {
- /* determine beginnings and endings of edges, linking last vertex to first vertex */
- xbeg = v[i].x;
- ybeg = v[i].y;
- if (i) {
- /* we're not at the last vert, so end of the edge is the previous vertex */
- xend = v[i - 1].x;
- yend = v[i - 1].y;
- }
- else {
- /* we're at the first vertex, so the "end" of this edge is the last vertex */
- xend = v[num_verts - 1].x;
- yend = v[num_verts - 1].y;
- }
- /* make sure our edges are facing the correct direction */
- if (ybeg > yend) {
- /* flip the Xs */
- temp_pos = xbeg;
- xbeg = xend;
- xend = temp_pos;
- /* flip the Ys */
- temp_pos = ybeg;
- ybeg = yend;
- yend = temp_pos;
- }
+void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, struct e_status *open_edge) {
+ int i;
+ int xbeg;
+ int ybeg;
+ int xend;
+ int yend;
+ int dx;
+ int dy;
+ int temp_pos;
+ int xdist;
+ struct e_status *e_new;
+ struct e_status *next_edge;
+ struct e_status **next_edge_ref;
+ struct poly_vert *v;
+ /* set up pointers */
+ v = verts;
+ ctx->all_edges = NULL;
+ /* initialize some boundaries */
+ ctx->rb.xmax = v[0].x;
+ ctx->rb.xmin = v[0].x;
+ ctx->rb.ymax = v[0].y;
+ ctx->rb.ymin = v[0].y;
+ /* loop all verts */
+ for(i = 0; i < num_verts; i++) {
+ /* determine beginnings and endings of edges, linking last vertex to first vertex */
+ xbeg = v[i].x;
+ ybeg = v[i].y;
+ /* keep track of our x and y bounds */
+ if(xbeg >= ctx->rb.xmax) {
+ ctx->rb.xmax = xbeg;
+ } else if(xbeg <= ctx->rb.xmin) {
+ ctx->rb.xmin = xbeg;
+ }
+ if(ybeg >= ctx->rb.ymax) {
+ ctx->rb.ymax= ybeg;
+ } else if(ybeg <= ctx->rb.ymin) {
+ ctx->rb.ymin=ybeg;
+ }
+ if(i) {
+ /* we're not at the last vert, so end of the edge is the previous vertex */
+ xend = v[i - 1].x;
+ yend = v[i - 1].y;
+ } else {
+ /* we're at the first vertex, so the "end" of this edge is the last vertex */
+ xend = v[num_verts - 1].x;
+ yend = v[num_verts - 1].y;
+ }
+ /* make sure our edges are facing the correct direction */
+ if(ybeg > yend) {
+ /* flip the Xs */
+ temp_pos = xbeg;
+ xbeg = xend;
+ xend = temp_pos;
+ /* flip the Ys */
+ temp_pos = ybeg;
+ ybeg = yend;
+ yend = temp_pos;
+ }
- /* calculate y delta */
- dy = yend - ybeg;
- /* dont draw horizontal lines directly, they are scanned as part of the edges they connect, so skip em. :) */
- if (dy) {
- /* create the edge and determine it's slope (for incremental line drawing) */
- e_new = open_edge++;
+ /* calculate y delta */
+ dy = yend - ybeg;
+ /* dont draw horizontal lines directly, they are scanned as part of the edges they connect, so skip em. :) */
+ if(dy) {
+ /* create the edge and determine it's slope (for incremental line drawing) */
+ e_new = open_edge++;
- /* calculate x delta */
- dx = xend - xbeg;
- if (dx > 0) {
- e_new->xdir = 1;
- xdist = dx;
- }
- else {
- e_new->xdir = -1;
- xdist = -dx;
- }
+ /* calculate x delta */
+ dx = xend - xbeg;
+ if(dx > 0) {
+ e_new->xdir = 1;
+ xdist = dx;
+ } else {
+ e_new->xdir = -1;
+ xdist = -dx;
+ }
- e_new->x = xbeg;
- e_new->ybeg = ybeg;
- e_new->num = dy;
- e_new->drift_dec = dy;
+ e_new->x = xbeg;
+ e_new->ybeg = ybeg;
+ e_new->num = dy;
+ e_new->drift_dec = dy;
- /* calculate deltas for incremental drawing */
- if (dx >= 0) {
- e_new->drift = 0;
- }
- else {
- e_new->drift = -dy + 1;
- }
- if (dy >= xdist) {
- e_new->drift_inc = xdist;
- e_new->xshift = 0;
- }
- else {
- e_new->drift_inc = xdist % dy;
- e_new->xshift = (xdist / dy) * e_new->xdir;
- }
- next_edge_ref = &ctx->all_edges;
- /* link in all the edges, in sorted order */
- for (;; ) {
- next_edge = *next_edge_ref;
- if (!next_edge || (next_edge->ybeg > ybeg) || ((next_edge->ybeg == ybeg) && (next_edge->x >= xbeg))) {
- e_new->e_next = next_edge;
- *next_edge_ref = e_new;
- break;
- }
- next_edge_ref = &next_edge->e_next;
- }
- }
- }
+ /* calculate deltas for incremental drawing */
+ if(dx >= 0) {
+ e_new->drift = 0;
+ } else {
+ e_new->drift = -dy + 1;
+ }
+ if(dy >= xdist) {
+ e_new->drift_inc = xdist;
+ e_new->xshift = 0;
+ } else {
+ e_new->drift_inc = xdist % dy;
+ e_new->xshift = (xdist / dy) * e_new->xdir;
+ }
+ next_edge_ref = &ctx->all_edges;
+ /* link in all the edges, in sorted order */
+ for(;;) {
+ next_edge = *next_edge_ref;
+ if(!next_edge || (next_edge->ybeg > ybeg) || ((next_edge->ybeg == ybeg) && (next_edge->x >= xbeg))) {
+ e_new->e_next = next_edge;
+ *next_edge_ref = e_new;
+ break;
+ }
+ next_edge_ref = &next_edge->e_next;
+ }
+ }
+ }
}
/*
@@ -172,281 +160,275 @@
* for speed, but waiting on final design choices for curve-data before eliminating data the DEM code will need
* if it ends up being coupled with this function.
*/
-static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, float intensity)
-{
- int x_curr; /* current pixel position in X */
- int y_curr; /* current scan line being drawn */
- int yp; /* y-pixel's position in frame buffer */
- int swixd = 0; /* whether or not edges switched position in X */
- float *cpxl; /* pixel pointers... */
- float *mpxl;
- float *spxl;
- struct e_status *e_curr; /* edge pointers... */
- struct e_status *e_temp;
- struct e_status *edgbuf;
- struct e_status **edgec;
+static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, float intensity) {
+ int x_curr; /* current pixel position in X */
+ int y_curr; /* current scan line being drawn */
+ int yp; /* y-pixel's position in frame buffer */
+ int swixd = 0; /* whether or not edges switched position in X */
+ float *cpxl; /* pixel pointers... */
+ float *mpxl;
+ float *spxl;
+ struct e_status *e_curr; /* edge pointers... */
+ struct e_status *e_temp;
+ struct e_status *edgbuf;
+ struct e_status **edgec;
- /*
- * If the number of verts specified to render as a polygon is less than 3,
- * return immediately. Obviously we cant render a poly with sides < 3. The
- * return for this we set to 1, simply so it can be distinguished from the
- * next place we could return.
- * which is a failure to allocate memory.
- */
- if (num_verts < 3) {
- return(1);
- }
+ /*
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list