diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 14:24:46 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 14:24:46 -0400 |
commit | 440166a027b78eb53d7686937148b755ad51f7f9 (patch) | |
tree | 2149ce9145461b4768af9553a3ba88a6887539f9 /src/Type1/lines.c | |
parent | 9739e750a7ca4b86ddb89674b104e9b9a8b61014 (diff) |
Dead code removal and static markup for Type1.
Diffstat (limited to 'src/Type1/lines.c')
-rw-r--r-- | src/Type1/lines.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/src/Type1/lines.c b/src/Type1/lines.c index 835afc6..72fb79f 100644 --- a/src/Type1/lines.c +++ b/src/Type1/lines.c @@ -70,37 +70,6 @@ None. */ /* -:h2.StepLine() - Produces Run Ends for a Line After Checks - -The main work is done by Bresenham(); here we just perform checks and -get the line so that its Y direction is always increasing: -*/ - -void StepLine(R, x1, y1, x2, y2) - register struct region *R; /* region being built */ - register fractpel x1,y1; /* starting point */ - register fractpel x2,y2; /* ending point */ -{ - register fractpel dy; - - dy = y2 - y1; - -/* -We execute the "GOING_TO" macro to call back the REGIONS module, if -necessary (like if the Y direction of the edge has changed): -*/ - GOING_TO(R, x1, y1, x2, y2, dy); - - if (dy == 0) - return; - - if (dy < 0) - Bresenham(R->edge, x2, y2, x1, y1); - else - Bresenham(R->edge, x1, y1, x2, y2); - return; -} -/* :h3.Bresenham() - Actually Produces Run Ends This routine runs a Bresenham line-stepping @@ -124,10 +93,8 @@ TruncFP() truncates down by 'b' bits: #define TruncFP(xy,b) ((xy)>>(b)) -void Bresenham(edgeP,x1,y1,x2,y2) - register pel *edgeP; /* pointer to top of list (y == 0) */ - register fractpel x1,y1; /* starting point on line */ - register fractpel x2,y2; /* ending point on the line (down) */ +static void +Bresenham(pel *edgeP, fractpel x1, fractpel y1, fractpel x2, fractpel y2) { register long dx,dy; /* change in x and y, in my own precision */ register long x,y; /* integer pel starting point */ @@ -187,3 +154,35 @@ Find the starting x and y integer pel coordinates: } } } + +/* +:h2.StepLine() - Produces Run Ends for a Line After Checks + +The main work is done by Bresenham(); here we just perform checks and +get the line so that its Y direction is always increasing: +*/ + +void StepLine(R, x1, y1, x2, y2) + register struct region *R; /* region being built */ + register fractpel x1,y1; /* starting point */ + register fractpel x2,y2; /* ending point */ +{ + register fractpel dy; + + dy = y2 - y1; + +/* +We execute the "GOING_TO" macro to call back the REGIONS module, if +necessary (like if the Y direction of the edge has changed): +*/ + GOING_TO(R, x1, y1, x2, y2, dy); + + if (dy == 0) + return; + + if (dy < 0) + Bresenham(R->edge, x2, y2, x1, y1); + else + Bresenham(R->edge, x1, y1, x2, y2); + return; +} |