[Bf-blender-cvs] [0634fd0] master: Remove raskter library

Sergey Sharybin noreply at git.blender.org
Fri Jan 8 12:32:31 CET 2016


Commit: 0634fd0e974573d4e9452795ce99b2c8105f9fee
Author: Sergey Sharybin
Date:   Fri Jan 8 16:29:29 2016 +0500
Branches: master
https://developer.blender.org/rB0634fd0e974573d4e9452795ce99b2c8105f9fee

Remove raskter library

it's no longer used by any of the parts of Blender.

===================================================================

M	build_files/cmake/macros.cmake
M	intern/CMakeLists.txt
D	intern/raskter/CMakeLists.txt
D	intern/raskter/raskter.c
D	intern/raskter/raskter.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blenderplayer/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 3672dbf..cacc741 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -623,7 +623,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
 		cycles_kernel
 		cycles_util
 		cycles_subd
-		bf_intern_raskter
 		bf_intern_opencolorio
 		bf_intern_eigen
 		extern_rangetree
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index 71cbf5d..f5f2d1c 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -31,7 +31,6 @@ add_subdirectory(libmv)
 add_subdirectory(memutil)
 add_subdirectory(opencolorio)
 add_subdirectory(mikktspace)
-add_subdirectory(raskter)
 add_subdirectory(glew-mx)
 add_subdirectory(eigen)
 
diff --git a/intern/raskter/CMakeLists.txt b/intern/raskter/CMakeLists.txt
deleted file mode 100644
index 3e1368d..0000000
--- a/intern/raskter/CMakeLists.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2012, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Peter Larabell
-#
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
-	.
-)
-
-set(INC_SYS
-	
-)
-
-set(SRC
-	raskter.c
-
-	raskter.h
-)
-
-blender_add_lib(bf_intern_raskter "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/raskter/raskter.c b/intern/raskter/raskter.c
deleted file mode 100644
index 4f65f87..0000000
--- a/intern/raskter/raskter.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2012 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Peter Larabell.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file raskter.c
- *  \ingroup RASKTER
- */
-
-#include <stdlib.h>
-#include "raskter.h"
-
-/* from BLI_utildefines.h */
-#define MIN2(x, y)               ( (x) < (y) ? (x) : (y) )
-#define MAX2(x, y)               ( (x) > (y) ? (x) : (y) )
-
-struct PolyVert {
-	int x;
-	int y;
-};
-
-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_BufferStats {
-	float *buf;
-	int sizex;
-	int sizey;
-	int ymin;
-	int ymax;
-	int xmin;
-	int xmax;
-};
-
-struct r_FillContext {
-	struct e_Status *all_edges, *possible_edges;
-	struct r_BufferStats 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.
- *
- * Really the poly should be clipped to the frame buffer's dimensions here for speed of drawing
- * 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_FillContext *ctx,
-                                 struct PolyVert *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 PolyVert *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 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;
-
-			/* 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;
-			}
-		}
-	}
-}
-
-/*
- * This function clips drawing to the frame buffer. That clipping will likely be moved into the preprocessor
- * 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_FillContext *ctx, struct PolyVert *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, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter.
-	 * which is a failure to allocate memory.
-	 */
-	if (num_verts < 3) {
-		return(1);
-	}
-
-	/*
-	 * Try to allocate an edge buffer in memory. needs to be the size of the edge tracking data
-	 * multiplied by the number of edges, which is always equal to the number of verts in
-	 * a 2D polygon. Here we return 0 to indicate a memory allocation failure, as opposed to a 1 for
-	 * the preceeding error, which was a rasterization request on a 2D poly with less than
-	 * 3 sides.
-	 */
-	if ((edgbuf = (struct e_Status *)(malloc(sizeof(struct e_Status) * num_verts))) == NULL) {
-		return(0);
-	}
-
-	/*
-	 * Do some preprocessing on all edges. This constructs a table structure in memory of all
-	 * the edge properties and can "flip" some edges so sorting works correctly.
-	 */
-	preprocess_all_edges(ctx, verts, num_verts, edgbuf);
-
-	/* can happen with a zero area mask */
-	if (ctx->all_edges == NULL) {
-		free(edgbuf);
-		return(1);
-	}
-	/*
-	 * Set the pointer for tracking the edges currently in processing to NULL to make sure
-	 * we don't get some crazy value after initialization.
-	 */
-	ctx->possible_edges = NULL;
-
-	/*
-	 * Loop through all scan lines to be drawn. Since we sorted by Y values during
-	 * preprocess_all_edges(), we can already exact values for the lowest and
-	 * highest Y values we could possibly need by induction. The preprocessing sorted
-	 * out edges by Y position, we can cycle the current edge being processed once
-	 * it runs out of Y pixels. When we have no more edges, meaning the current edge
-	 * is NULL after setting the "current" edge to be the previous current edge's
-	 * "next" edge in the Y sorted edge connection chain, we can stop looping Y values,
-	 * since we can't possibly have more scan lines if we ran out of edges. :)
-	 *
-	 * TODO: This clips Y to the frame buffer, which sh

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list