git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
darwin fixes
[swftools.git]
/
lib
/
gfxpoly
/
active.c
diff --git
a/lib/gfxpoly/active.c
b/lib/gfxpoly/active.c
index
340d5bc
..
b723185
100644
(file)
--- a/
lib/gfxpoly/active.c
+++ b/
lib/gfxpoly/active.c
@@
-1,7
+1,9
@@
#include <stdlib.h>
#include <memory.h>
#include <math.h>
#include <stdlib.h>
#include <memory.h>
#include <math.h>
+#include "../../config.h"
#include "../q.h"
#include "../q.h"
+#include "../types.h"
#include "active.h"
actlist_t* actlist_new()
#include "active.h"
actlist_t* actlist_new()
@@
-32,7
+34,7
@@
void actlist_dump(actlist_t*a, int32_t y)
fprintf(stderr, "[%d]", s->nr);
s = s->right;
if(s) fprintf(stderr, " ");
fprintf(stderr, "[%d]", s->nr);
s = s->right;
if(s) fprintf(stderr, " ");
- else fprintf(stderr, "\n");
+ else fprintf(stderr, " y=%d\n", y);
}
}
void actlist_verify(actlist_t*a, int32_t y)
}
}
void actlist_verify(actlist_t*a, int32_t y)
@@
-95,6
+97,7
@@
segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2)
//double d = cmp(t, p1, p2);
double d = single_cmp(t, p1);
if(d>=0 && to_the_left) {
//double d = cmp(t, p1, p2);
double d = single_cmp(t, p1);
if(d>=0 && to_the_left) {
+ actlist_dump(a, p1.y);
segment_t*s = a->list;
while(s) {
fprintf(stderr, "[%d] %f/%f (%d,%d) -> (%d,%d)\n", s->nr,
segment_t*s = a->list;
while(s) {
fprintf(stderr, "[%d] %f/%f (%d,%d) -> (%d,%d)\n", s->nr,
@@
-148,6
+151,7
@@
segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2)
}
#endif
}
#endif
+ /* this can be optimized for (is not needed in) normal mode (as opposed to horizontal postprocess mode) */
segment_t*out = last;
if(d<0 || (d==0 && LINE_EQ(p2,last)<0)) {
last = last->left;
segment_t*out = last;
if(d<0 || (d==0 && LINE_EQ(p2,last)<0)) {
last = last->left;
@@
-373,7
+377,7
@@
static void move_to_root(actlist_t*a, segment_t*s)
}
}
}
}
-static int actlist_splay(actlist_t*a, point_t p1, point_t p2)
+static void actlist_splay(actlist_t*a, point_t p1, point_t p2)
{
if(!a->list) return;
{
if(!a->list) return;
@@
-501,7
+505,11
@@
void actlist_delete(actlist_t*a, segment_t*s)
} else if(!a->root->rightchild) {
a->root = a->root->leftchild;
} else {
} else if(!a->root->rightchild) {
a->root = a->root->leftchild;
} else {
+#ifdef HAVE_LRAND48
if(lrand48()&1) {
if(lrand48()&1) {
+#else
+ if(((ptroff_t)s)&16) {
+#endif
// free up root->left->right
segment_t*t = a->root->leftchild;
while(t->rightchild) {
// free up root->left->right
segment_t*t = a->root->leftchild;
while(t->rightchild) {