Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

476 lines
9.5 KiB

  1. /*
  2. ** Copyright 1992, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. **
  17. */
  18. #include <setjmp.h>
  19. struct JumpBuffer {
  20. jmp_buf buf;
  21. };
  22. #define mysetjmp(x) setjmp((x)->buf)
  23. #define mylongjmp(x,y) longjmp((x)->buf, y)
  24. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  25. /* < ../core/arc.c++ > */
  26. void *__vec_new (void *, int , int , void *);
  27. void __vec_ct (void *, int , int , void *);
  28. void __vec_dt (void *, int , int , void *);
  29. void __vec_delete (void *, int , int , void *, int , int );
  30. typedef int (*__vptp)(void);
  31. struct __mptr {short d; short i; __vptp f; };
  32. typedef unsigned int size_t ;
  33. // extern void *malloc (size_t );
  34. // extern void free (void *);
  35. struct Buffer;
  36. struct Buffer {
  37. struct Buffer *next__6Buffer ;
  38. };
  39. struct Pool;
  40. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  41. struct Pool {
  42. struct Buffer *freelist__4Pool ;
  43. char *blocklist__4Pool [32];
  44. int nextblock__4Pool ;
  45. char *curblock__4Pool ;
  46. int buffersize__4Pool ;
  47. int nextsize__4Pool ;
  48. int nextfree__4Pool ;
  49. int initsize__4Pool ;
  50. char *name__4Pool ;
  51. int magic__4Pool ;
  52. };
  53. void __glgrow__4PoolFv (struct Pool *);
  54. struct PooledObj;
  55. struct PooledObj {
  56. char __W3__9PooledObj ;
  57. };
  58. typedef float REAL ;
  59. typedef void (*Pfvv )(void );
  60. typedef void (*Pfvf )(float *);
  61. typedef int (*cmpfunc )(void *, void *);
  62. typedef REAL Knot ;
  63. typedef REAL *Knot_ptr ;
  64. struct TrimVertex;
  65. struct PwlArc;
  66. struct PwlArc {
  67. char __W3__9PooledObj ;
  68. struct TrimVertex *pts__6PwlArc ;
  69. int npts__6PwlArc ;
  70. long type__6PwlArc ;
  71. };
  72. struct TrimVertex;
  73. struct TrimVertex {
  74. REAL param__10TrimVertex [2];
  75. long nuid__10TrimVertex ;
  76. };
  77. typedef struct TrimVertex *TrimVertex_p ;
  78. struct Bin;
  79. struct Arc;
  80. struct BezierArc;
  81. typedef struct Arc *Arc_ptr ;
  82. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  83. struct Arc;
  84. struct Arc {
  85. char __W3__9PooledObj ;
  86. Arc_ptr prev__3Arc ;
  87. Arc_ptr next__3Arc ;
  88. Arc_ptr link__3Arc ;
  89. struct BezierArc *bezierArc__3Arc ;
  90. struct PwlArc *pwlArc__3Arc ;
  91. long type__3Arc ;
  92. long nuid__3Arc ;
  93. };
  94. extern int __glbezier_tag__3Arc ;
  95. extern int __glarc_tag__3Arc ;
  96. extern int __gltail_tag__3Arc ;
  97. struct Bin;
  98. struct Bin {
  99. struct Arc *head__3Bin ;
  100. struct Arc *current__3Bin ;
  101. };
  102. struct Mapdesc;
  103. struct BezierArc;
  104. struct BezierArc {
  105. char __W3__9PooledObj ;
  106. REAL *cpts__9BezierArc ;
  107. int order__9BezierArc ;
  108. int stride__9BezierArc ;
  109. long type__9BezierArc ;
  110. struct Mapdesc *mapdesc__9BezierArc ;
  111. };
  112. extern int __glbezier_tag__3Arc ;
  113. int __glbezier_tag__3Arc = 8192;
  114. extern int __glarc_tag__3Arc ;
  115. int __glarc_tag__3Arc = 8;
  116. extern int __gltail_tag__3Arc ;
  117. int __gltail_tag__3Arc = 64;
  118. extern struct __mptr* __ptbl_vec_____core_arc_c___makeSide_[];
  119. void __glmakeSide__3ArcFP6PwlArc8ar0 (struct Arc *__0this , struct PwlArc *__1pwl , int __1side )
  120. {
  121. ((void )0 );
  122. ((void )0 );
  123. ((void )0 );
  124. ((void )0 );
  125. __0this -> pwlArc__3Arc = __1pwl ;
  126. ( (__0this -> type__3Arc &= (~ 8192))) ;
  127. ( ( (__0this -> type__3Arc &= -1793)) , (__0this -> type__3Arc |= ((((long )__1side ))<< 8 ))) ;
  128. }
  129. int __glnumpts__3ArcFv (struct Arc *__0this )
  130. {
  131. Arc_ptr __1jarc ;
  132. int __1npts ;
  133. __1jarc = (struct Arc *)__0this ;
  134. __1npts = 0 ;
  135. do {
  136. __1npts += __1jarc -> pwlArc__3Arc -> npts__6PwlArc ;
  137. __1jarc = __1jarc -> next__3Arc ;
  138. }
  139. while (__1jarc != (struct Arc *)__0this );
  140. return __1npts ;
  141. }
  142. void __glmarkverts__3ArcFv (struct Arc *__0this )
  143. {
  144. Arc_ptr __1jarc ;
  145. __1jarc = (struct Arc *)__0this ;
  146. do {
  147. struct TrimVertex *__2p ;
  148. __2p = __1jarc -> pwlArc__3Arc -> pts__6PwlArc ;
  149. { { int __2i ;
  150. __2i = 0 ;
  151. for(;__2i < __1jarc -> pwlArc__3Arc -> npts__6PwlArc ;__2i ++ )
  152. (__2p [__2i ]). nuid__10TrimVertex = __1jarc -> nuid__3Arc ;
  153. __1jarc = __1jarc -> next__3Arc ;
  154. }
  155. }
  156. }
  157. while (__1jarc != (struct Arc *)__0this );
  158. }
  159. void __glgetextrema__3ArcFPP3Arc (struct Arc *__0this , Arc_ptr *__1extrema )
  160. {
  161. REAL __1leftpt ;
  162. REAL __1botpt ;
  163. REAL __1rightpt ;
  164. REAL __1toppt ;
  165. (__1extrema [0 ])= ((__1extrema [1 ])= ((__1extrema [2 ])= ((__1extrema [3 ])= (struct Arc *)__0this )));
  166. __1leftpt = (__1rightpt = (( (((REAL *)(__0this -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ]));
  167. __1botpt = (__1toppt = (( (((REAL *)(__0this -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ]));
  168. { { Arc_ptr __1jarc ;
  169. __1jarc = __0this -> next__3Arc ;
  170. for(;__1jarc != (struct Arc *)__0this ;__1jarc = __1jarc -> next__3Arc ) {
  171. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])<=
  172. __1leftpt ){
  173. __1leftpt = (__1jarc -> pwlArc__3Arc -> pts__6PwlArc -> param__10TrimVertex [0 ]);
  174. (__1extrema [1 ])= __1jarc ;
  175. }
  176. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])>= __1rightpt ){
  177. __1rightpt = (__1jarc -> pwlArc__3Arc -> pts__6PwlArc -> param__10TrimVertex [0 ]);
  178. (__1extrema [3 ])= __1jarc ;
  179. }
  180. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])<= __1botpt ){
  181. __1botpt = (__1jarc -> pwlArc__3Arc -> pts__6PwlArc -> param__10TrimVertex [1 ]);
  182. (__1extrema [2 ])= __1jarc ;
  183. }
  184. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])>= __1toppt ){
  185. __1toppt = (__1jarc -> pwlArc__3Arc -> pts__6PwlArc -> param__10TrimVertex [1 ]);
  186. (__1extrema [0 ])= __1jarc ;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. void __glshow__3ArcFv (struct Arc *__0this )
  193. {
  194. }
  195. void __glprint__3ArcFv (struct Arc *__0this )
  196. {
  197. Arc_ptr __1jarc ;
  198. __1jarc = (struct Arc *)__0this ;
  199. if (! __0this ){
  200. return ;
  201. }
  202. do {
  203. __glshow__3ArcFv ( (struct Arc *)__1jarc ) ;
  204. __1jarc = __1jarc -> next__3Arc ;
  205. }
  206. while (__1jarc != (struct Arc *)__0this );
  207. }
  208. int __glisDisconnected__3ArcFv (struct Arc *__0this )
  209. {
  210. if (__0this -> pwlArc__3Arc == 0 )return 0 ;
  211. if (__0this -> prev__3Arc -> pwlArc__3Arc == 0 )return 0 ;
  212. { REAL *__1p0 ;
  213. REAL *__1p1 ;
  214. struct Arc *__0__X5 ;
  215. __1p0 = ( (((REAL *)(__0this -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) ;
  216. __1p1 = ( (__0__X5 = (struct Arc *)__0this -> prev__3Arc ), ( (((REAL *)(__0__X5 -> pwlArc__3Arc -> pts__6PwlArc [(__0__X5 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]). param__10TrimVertex )))
  217. ) ;
  218. if ((((((__1p0 [0 ])- (__1p1 [0 ]))> 0.000001 )|| (((__1p1 [0 ])- (__1p0 [0 ]))> 0.000001 ))|| (((__1p0 [1 ])- (__1p1 [1 ]))> 0.000001 ))|| (((__1p1 [1 ])- (__1p0 [1 ]))> 0.000001 ))
  219. {
  220. return
  221. 1 ;
  222. }
  223. else
  224. {
  225. (__1p0 [0 ])= ((__1p1 [0 ])= (((__1p1 [0 ])+ (__1p0 [0 ]))* 0.5 ));
  226. (__1p0 [1 ])= ((__1p1 [1 ])= (((__1p1 [1 ])+ (__1p0 [1 ]))* 0.5 ));
  227. return 0 ;
  228. }
  229. }
  230. }
  231. int __glcheck__3ArcFv (struct Arc *__0this )
  232. {
  233. if (__0this == 0 )return 1 ;
  234. { Arc_ptr __1jarc ;
  235. __1jarc = (struct Arc *)__0this ;
  236. do {
  237. ((void )0 );
  238. if ((__1jarc -> prev__3Arc == 0 )|| (__1jarc -> next__3Arc == 0 )){
  239. return 0 ;
  240. }
  241. if (__1jarc -> next__3Arc -> prev__3Arc != __1jarc ){
  242. return 0 ;
  243. }
  244. if (__1jarc -> pwlArc__3Arc ){
  245. if (__1jarc -> prev__3Arc -> pwlArc__3Arc ){
  246. struct Arc *__0__X6 ;
  247. struct Arc *__0__X7 ;
  248. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])!= (( (__0__X6 = (struct Arc *)__1jarc -> prev__3Arc ), (
  249. (((REAL *)(__0__X6 -> pwlArc__3Arc -> pts__6PwlArc [(__0__X6 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]). param__10TrimVertex ))) ) [1 ])){
  250. return 0 ;
  251. }
  252. if ((( (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])!= (( (__0__X7 = (struct Arc *)__1jarc -> prev__3Arc ), (
  253. (((REAL *)(__0__X7 -> pwlArc__3Arc -> pts__6PwlArc [(__0__X7 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]). param__10TrimVertex ))) ) [0 ])){
  254. return 0 ;
  255. }
  256. }
  257. if (__1jarc -> next__3Arc -> pwlArc__3Arc ){
  258. struct Arc *__0__X8 ;
  259. struct Arc *__0__X9 ;
  260. if ((( (__0__X8 = (struct Arc *)__1jarc -> next__3Arc ), ( (((REAL *)(__0__X8 -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) ) [0 ])!= ((
  261. (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [(((struct Arc *)__1jarc )-> pwlArc__3Arc -> npts__6PwlArc - 1 )]). param__10TrimVertex ))) [0 ])){
  262. return 0 ;
  263. }
  264. if ((( (__0__X9 = (struct Arc *)__1jarc -> next__3Arc ), ( (((REAL *)(__0__X9 -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) ) [1 ])!= ((
  265. (((REAL *)(((struct Arc *)__1jarc )-> pwlArc__3Arc -> pts__6PwlArc [(((struct Arc *)__1jarc )-> pwlArc__3Arc -> npts__6PwlArc - 1 )]). param__10TrimVertex ))) [1 ])){
  266. return 0 ;
  267. }
  268. }
  269. if (( (((struct Arc *)__1jarc )-> type__3Arc & 8192)) ){
  270. ((void )0 );
  271. ((void )0 );
  272. }
  273. }
  274. __1jarc = __1jarc -> next__3Arc ;
  275. }
  276. while (__1jarc != (struct Arc *)__0this );
  277. return 1 ;
  278. }
  279. }
  280. Arc_ptr __glappend__3ArcFP3Arc (struct Arc *__0this , Arc_ptr __1jarc )
  281. {
  282. if (__1jarc != 0 ){
  283. __0this -> next__3Arc = __1jarc -> next__3Arc ;
  284. __0this -> prev__3Arc = __1jarc ;
  285. __0this -> next__3Arc -> prev__3Arc = (__0this -> prev__3Arc -> next__3Arc = (struct Arc *)__0this );
  286. }
  287. else
  288. {
  289. __0this -> next__3Arc = (__0this -> prev__3Arc = (struct Arc *)__0this );
  290. }
  291. return (struct Arc *)__0this ;
  292. }
  293. /* the end */