[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47302] branches/soc-2011-tomato/intern/ raskter/raskter.c: small code refactor to remove redundant calculations
Peter Larabell
xgl.asyliax at gmail.com
Thu May 31 23:56:42 CEST 2012
Revision: 47302
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47302
Author: xglasyliax
Date: 2012-05-31 21:56:41 +0000 (Thu, 31 May 2012)
Log Message:
-----------
small code refactor to remove redundant calculations
Modified Paths:
--------------
branches/soc-2011-tomato/intern/raskter/raskter.c
Modified: branches/soc-2011-tomato/intern/raskter/raskter.c
===================================================================
--- branches/soc-2011-tomato/intern/raskter/raskter.c 2012-05-31 21:45:46 UTC (rev 47301)
+++ branches/soc-2011-tomato/intern/raskter/raskter.c 2012-05-31 21:56:41 UTC (rev 47302)
@@ -464,8 +464,8 @@
float idist; // idist = current inner edge distance
float dx; // dx = X-delta (used for distance proportion calculation)
float dy; // dy = Y-delta (used for distance proportion calculation)
- float xpxw;
- float ypxh;
+ float xpxw = (1.0f / (float)(ctx->rb.sizex)); // xpxw = normalized pixel width
+ float ypxh = (1.0f / (float)(ctx->rb.sizey)); // ypxh = normalized pixel height
/*
* If the number of verts specified to render as a polygon is less than 3,
@@ -588,8 +588,6 @@
mpxl = spxl + MIN2(e_curr->x, ctx->rb.sizex) - 1;
if ((y_curr >= 0) && (y_curr < ctx->rb.sizey)) {
- xpxw = (1.0f / (float)(ctx->rb.sizex));
- ypxh = (1.0f / (float)(ctx->rb.sizey));
t = ((float)((cpxl - spxl) % ctx->rb.sizex) + 0.5f) * xpxw;
fsz = ((float)(y_curr) + 0.5f) * ypxh;
/* draw the pixels. */
More information about the Bf-blender-cvs
mailing list