29 #include "config_auto.h"
34 #define PBLOCK_LABEL_SIZE 150
35 #define INTERSECTING MAX_INT16
37 int lessthan(
const void *first,
const void *second);
40 ICOORDELT_IT v = &vertices;
44 v.add_list_before(points);
52 ICOORDELT_IT v = &vertices;
73 ICOORDELT_IT pts = &vertices;
75 botleft = *pts.data ();
79 if (pos.
x () < botleft.
x ())
81 botleft =
ICOORD (pos.
x (), botleft.
y ());
82 if (pos.
y () < botleft.
y ())
83 botleft =
ICOORD (botleft.
x (), pos.
y ());
84 if (pos.
x () > topright.
x ())
85 topright =
ICOORD (pos.
x (), topright.
y ());
86 if (pos.
y () > topright.
y ())
87 topright =
ICOORD (topright.
x (), pos.
y ());
90 while (!pts.at_first ());
91 ibl =
ICOORD (botleft.
x (), botleft.
y ());
92 itr =
ICOORD (topright.
x (), topright.
y ());
93 box =
TBOX (ibl, itr);
110 ICOORDELT_IT it = &vertices;
116 vvec = *it.data_relative (1) - pt;
118 if (vec.
y () <= 0 && vec.
y () + vvec.
y () > 0) {
125 else if (vec.
y () > 0 && vec.
y () + vvec.
y () <= 0) {
132 else if (vec.
y () == 0 && vec.
x () == 0)
136 while (!it.at_first ());
144 ICOORDELT_IT it = &vertices;
153 vertex = *it.data ();
161 while (!it.at_first ());
166 it.set_to_list (other->
points ());
168 vertex = *it.data ();
176 while (!it.at_first ());
191 ICOORDELT_IT pts = &vertices;
202 while (!pts.at_first ());
214 ICOORDELT_IT pts = &vertices;
221 while (!pts.at_first());
235 ICOORDELT_IT pts = &vertices;
242 while (!pts.at_first ());
247 #ifndef GRAPHICS_DISABLED
249 ICOORDELT_IT v = &vertices;
261 ltoa (num, temp_buff, 10);
263 window->
Text(v.data ()->x (), v.data ()->y (), temp_buff);
266 window->
SetCursor(v.data ()->x (), v.data ()->y ());
267 for (v.mark_cycle_pt (); !v.cycled_list (); v.forward ()) {
268 window->
DrawTo(v.data ()->x (), v.data ()->y ());
271 window->
DrawTo(v.data ()->x (), v.data ()->y ());
279 ICOORDELT_LIST *segments;
288 if (!segments->empty ()) {
289 s_it.set_to_list (segments);
290 for (s_it.mark_cycle_pt (); !s_it.cycled_list (); s_it.forward ()) {
294 width = s_it.data ()->y ();
295 window->
SetCursor(s_it.data ()->x (), y);
296 window->
DrawTo(s_it.data ()->x () + (float) width, y);
307 ICOORDELT_IT it = &vertices;
316 vertex = *it.data ();
324 while (!it.at_first ());
329 it.set_to_list (other->
points ());
339 while (!it.at_first ());
346 ICOORDELT_LIST *result;
350 fy = (float) (y + 0.5);
351 result =
new ICOORDELT_LIST ();
352 r.set_to_list (result);
353 v.set_to_list (block->
points ());
355 for (v.mark_cycle_pt (); !v.cycled_list (); v.forward ()) {
356 if (((v.data_relative (-1)->y () > y) && (v.data ()->y () <= y))
357 || ((v.data_relative (-1)->y () <= y) && (v.data ()->y () > y))) {
358 previous = v.data_relative (-1);
360 fx = (float) (0.5 + previous->
x () +
361 (current->
x () - previous->
x ()) * (fy -
363 (current->
y () - previous->
y ()));
371 for (r.mark_cycle_pt (); !r.cycled_list (); r.forward ())
373 for (r.mark_cycle_pt (); !r.cycled_list (); r.forward ()) {
374 r.data ()->
set_y (r.data_relative (1)->x () - r.data ()->x ());
376 delete (r.extract ());
384 int lessthan(
const void *first,
const void *second) {
388 if (p1->
x () < p2->
x ())
390 else if (p1->
x () > p2->
x ())
396 #ifndef GRAPHICS_DISABLED
418 return kPBColors[type];
422 #endif // GRAPHICS_DISABLED