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.

447 lines
11 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 <stdlib.h>
  19. #include <setjmp.h>
  20. struct JumpBuffer {
  21. jmp_buf buf;
  22. };
  23. #define mysetjmp(x) setjmp((x)->buf)
  24. #define mylongjmp(x,y) longjmp((x)->buf, y)
  25. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  26. /* < ../core/trimregion.c++ > */
  27. void *__vec_new (void *, int , int , void *);
  28. void __vec_ct (void *, int , int , void *);
  29. void __vec_dt (void *, int , int , void *);
  30. void __vec_delete (void *, int , int , void *, int , int );
  31. typedef int (*__vptp)(void);
  32. struct __mptr {short d; short i; __vptp f; };
  33. typedef unsigned int size_t ;
  34. // extern void *malloc (size_t );
  35. // extern void free (void *);
  36. struct Arc;
  37. struct Backend;
  38. typedef float REAL ;
  39. typedef void (*Pfvv )(void );
  40. typedef void (*Pfvf )(float *);
  41. typedef int (*cmpfunc )(void *, void *);
  42. typedef REAL Knot ;
  43. typedef REAL *Knot_ptr ;
  44. struct TrimVertex;
  45. struct TrimVertex {
  46. REAL param__10TrimVertex [2];
  47. long nuid__10TrimVertex ;
  48. };
  49. typedef struct TrimVertex *TrimVertex_p ;
  50. struct Buffer;
  51. struct Buffer {
  52. struct Buffer *next__6Buffer ;
  53. };
  54. struct Pool;
  55. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  56. struct Pool {
  57. struct Buffer *freelist__4Pool ;
  58. char *blocklist__4Pool [32];
  59. int nextblock__4Pool ;
  60. char *curblock__4Pool ;
  61. int buffersize__4Pool ;
  62. int nextsize__4Pool ;
  63. int nextfree__4Pool ;
  64. int initsize__4Pool ;
  65. char *name__4Pool ;
  66. int magic__4Pool ;
  67. };
  68. void __glgrow__4PoolFv (struct Pool *);
  69. struct PooledObj;
  70. struct PooledObj {
  71. char __W3__9PooledObj ;
  72. };
  73. struct PwlArc;
  74. struct PwlArc {
  75. char __W3__9PooledObj ;
  76. struct TrimVertex *pts__6PwlArc ;
  77. int npts__6PwlArc ;
  78. long type__6PwlArc ;
  79. };
  80. struct Bin;
  81. struct Arc;
  82. struct BezierArc;
  83. typedef struct Arc *Arc_ptr ;
  84. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  85. struct Arc;
  86. struct Arc {
  87. char __W3__9PooledObj ;
  88. Arc_ptr prev__3Arc ;
  89. Arc_ptr next__3Arc ;
  90. Arc_ptr link__3Arc ;
  91. struct BezierArc *bezierArc__3Arc ;
  92. struct PwlArc *pwlArc__3Arc ;
  93. long type__3Arc ;
  94. long nuid__3Arc ;
  95. };
  96. extern int __glbezier_tag__3Arc ;
  97. extern int __glarc_tag__3Arc ;
  98. extern int __gltail_tag__3Arc ;
  99. struct Jarcloc;
  100. struct Jarcloc {
  101. struct Arc *arc__7Jarcloc ;
  102. struct TrimVertex *p__7Jarcloc ;
  103. struct TrimVertex *plast__7Jarcloc ;
  104. };
  105. struct Trimline;
  106. struct Trimline {
  107. struct TrimVertex **pts__8Trimline ;
  108. long numverts__8Trimline ;
  109. long i__8Trimline ;
  110. long size__8Trimline ;
  111. struct Jarcloc jarcl__8Trimline ;
  112. struct TrimVertex t__8Trimline ;
  113. struct TrimVertex b__8Trimline ;
  114. struct TrimVertex *tinterp__8Trimline ;
  115. struct TrimVertex *binterp__8Trimline ;
  116. };
  117. struct Gridline;
  118. struct Gridline {
  119. long v__8Gridline ;
  120. REAL vval__8Gridline ;
  121. long vindex__8Gridline ;
  122. long ustart__8Gridline ;
  123. long uend__8Gridline ;
  124. };
  125. struct Uarray;
  126. struct Uarray {
  127. long size__6Uarray ;
  128. long ulines__6Uarray ;
  129. REAL *uarray__6Uarray ;
  130. };
  131. struct Backend;
  132. struct TrimRegion;
  133. void __gl__dt__8TrimlineFv (struct Trimline *, int );
  134. void __gl__dt__6UarrayFv (struct Uarray *, int );
  135. struct TrimRegion {
  136. struct Trimline left__10TrimRegion ;
  137. struct Trimline right__10TrimRegion ;
  138. struct Gridline top__10TrimRegion ;
  139. struct Gridline bot__10TrimRegion ;
  140. struct Uarray uarray__10TrimRegion ;
  141. REAL oneOverDu__10TrimRegion ;
  142. };
  143. struct GridVertex;
  144. struct GridVertex {
  145. long gparam__10GridVertex [2];
  146. };
  147. struct GridTrimVertex;
  148. struct GridTrimVertex {
  149. char __W3__9PooledObj ;
  150. struct TrimVertex dummyt__14GridTrimVertex ;
  151. struct GridVertex dummyg__14GridTrimVertex ;
  152. struct TrimVertex *t__14GridTrimVertex ;
  153. struct GridVertex *g__14GridTrimVertex ;
  154. };
  155. typedef struct GridTrimVertex *GridTrimVertex_p ;
  156. struct BasicCurveEvaluator;
  157. struct BasicSurfaceEvaluator;
  158. struct Backend;
  159. struct Backend {
  160. struct BasicCurveEvaluator *curveEvaluator__7Backend ;
  161. struct BasicSurfaceEvaluator *surfaceEvaluator__7Backend ;
  162. int wireframetris__7Backend ;
  163. int wireframequads__7Backend ;
  164. int npts__7Backend ;
  165. REAL mesh__7Backend [3][4];
  166. int meshindex__7Backend ;
  167. };
  168. extern struct __mptr* __ptbl_vec_____core_trimregion_c_____ct_[];
  169. struct Trimline *__gl__ct__8TrimlineFv (struct Trimline *);
  170. struct Uarray *__gl__ct__6UarrayFv (struct Uarray *);
  171. static void *__nw__FUi (size_t );
  172. struct TrimRegion *__gl__ct__10TrimRegionFv (struct TrimRegion *__0this )
  173. { if (__0this || (__0this = (struct TrimRegion *)__nw__FUi ( sizeof (struct TrimRegion)) ))( ( __gl__ct__8TrimlineFv ( (struct
  174. Trimline *)(& __0this -> left__10TrimRegion )) , __gl__ct__8TrimlineFv ( (struct Trimline *)(& __0this -> right__10TrimRegion )) ) , __gl__ct__6UarrayFv ( (struct Uarray *)(&
  175. __0this -> uarray__10TrimRegion )) ) ;
  176. return __0this ;
  177. }
  178. void __glsetDu__10TrimRegionFf (struct TrimRegion *__0this , REAL __1du )
  179. {
  180. __0this -> oneOverDu__10TrimRegion = (1.0 / __1du );
  181. }
  182. void __glinit__8TrimlineFlP3ArcT1 (struct Trimline *, long , struct Arc *, long );
  183. void __glgetNextPt__8TrimlineFv (struct Trimline *);
  184. void __glgetPrevPt__8TrimlineFv (struct Trimline *);
  185. void __glinit__10TrimRegionFlP3Arc (struct TrimRegion *__0this , long __1npts , Arc_ptr __1extrema )
  186. {
  187. __glinit__8TrimlineFlP3ArcT1 ( (struct Trimline *)(& __0this -> left__10TrimRegion ), __1npts , __1extrema , (long
  188. )(__1extrema -> pwlArc__3Arc -> npts__6PwlArc - 1 )) ;
  189. __glgetNextPt__8TrimlineFv ( (struct Trimline *)(& __0this -> left__10TrimRegion )) ;
  190. __glinit__8TrimlineFlP3ArcT1 ( (struct Trimline *)(& __0this -> right__10TrimRegion ), __1npts , __1extrema , (long )0 ) ;
  191. __glgetPrevPt__8TrimlineFv ( (struct Trimline *)(& __0this -> right__10TrimRegion )) ;
  192. }
  193. void __glgetNextPts__8TrimlineFP3Ar0 (struct Trimline *, struct Arc *);
  194. void __glgetPrevPts__8TrimlineFP3Ar0 (struct Trimline *, struct Arc *);
  195. void __glgetPts__10TrimRegionFP3Arc (struct TrimRegion *__0this , Arc_ptr __1extrema )
  196. {
  197. __glgetNextPts__8TrimlineFP3Ar0 ( (struct Trimline *)(& __0this -> left__10TrimRegion ), __1extrema ) ;
  198. __glgetPrevPts__8TrimlineFP3Ar0 ( (struct Trimline *)(& __0this -> right__10TrimRegion ), __1extrema ) ;
  199. }
  200. void __glgetNextPts__8TrimlineFfR7B0 (struct Trimline *, REAL , struct Backend *);
  201. void __glgetPrevPts__8TrimlineFfR7B0 (struct Trimline *, REAL , struct Backend *);
  202. void __glgetPts__10TrimRegionFR7Bac0 (struct TrimRegion *__0this , struct Backend *__1backend )
  203. {
  204. __glgetNextPts__8TrimlineFfR7B0 ( (struct Trimline *)(& __0this -> left__10TrimRegion ), __0this -> bot__10TrimRegion . vval__8Gridline , __1backend )
  205. ;
  206. __glgetPrevPts__8TrimlineFfR7B0 ( (struct Trimline *)(& __0this -> right__10TrimRegion ), __0this -> bot__10TrimRegion . vval__8Gridline , __1backend ) ;
  207. }
  208. void __glgetGridExtent__10TrimRegio1 (struct TrimRegion *, struct TrimVertex *, struct TrimVertex *);
  209. void __glgetGridExtent__10TrimRegio0 (struct TrimRegion *__0this )
  210. {
  211. __glgetGridExtent__10TrimRegio1 ( __0this , ( (((struct Trimline *)(& __0this -> left__10TrimRegion ))-> i__8Trimline = ((struct Trimline *)(& __0this ->
  212. left__10TrimRegion ))-> numverts__8Trimline ), (((struct Trimline *)(& __0this -> left__10TrimRegion ))-> pts__8Trimline [(-- ((struct Trimline *)(& __0this -> left__10TrimRegion ))-> i__8Trimline )])) , (
  213. (((struct Trimline *)(& __0this -> right__10TrimRegion ))-> i__8Trimline = ((struct Trimline *)(& __0this -> right__10TrimRegion ))-> numverts__8Trimline ), (((struct Trimline *)(& __0this -> right__10TrimRegion ))->
  214. pts__8Trimline [(-- ((struct Trimline *)(& __0this -> right__10TrimRegion ))-> i__8Trimline )])) ) ;
  215. }
  216. void __glgetGridExtent__10TrimRegio1 (struct TrimRegion *__0this , struct TrimVertex *__1l , struct TrimVertex *__1r )
  217. {
  218. __0this -> bot__10TrimRegion . ustart__8Gridline = (((long )(((__1l -> param__10TrimVertex [0 ])- (__0this ->
  219. uarray__10TrimRegion . uarray__6Uarray [0 ]))* __0this -> oneOverDu__10TrimRegion )));
  220. if ((__1l -> param__10TrimVertex [0 ])>= (__0this -> uarray__10TrimRegion . uarray__6Uarray [__0this -> bot__10TrimRegion . ustart__8Gridline ]))__0this -> bot__10TrimRegion . ustart__8Gridline ++ ;
  221. ((void )0 );
  222. ((void )0 );
  223. __0this -> bot__10TrimRegion . uend__8Gridline = (((__1r -> param__10TrimVertex [0 ])- (__0this -> uarray__10TrimRegion . uarray__6Uarray [0 ]))* __0this -> oneOverDu__10TrimRegion );
  224. if ((__0this -> uarray__10TrimRegion . uarray__6Uarray [__0this -> bot__10TrimRegion . uend__8Gridline ])>= (__1r -> param__10TrimVertex [0 ]))__0this -> bot__10TrimRegion . uend__8Gridline -- ;
  225. ((void )0 );
  226. ((void )0 );
  227. }
  228. int __glcanTile__10TrimRegionFv (struct TrimRegion *__0this )
  229. {
  230. struct TrimVertex *__1lf ;
  231. struct TrimVertex *__1ll ;
  232. struct TrimVertex *__1l ;
  233. struct TrimVertex *__1rf ;
  234. struct TrimVertex *__1rl ;
  235. struct TrimVertex *__1r ;
  236. __1lf = ( (((struct Trimline *)(& __0this -> left__10TrimRegion ))-> i__8Trimline = 0 ), (((struct Trimline *)(& __0this -> left__10TrimRegion ))-> pts__8Trimline [((struct Trimline *)(&
  237. __0this -> left__10TrimRegion ))-> i__8Trimline ])) ;
  238. __1ll = ( (((struct Trimline *)(& __0this -> left__10TrimRegion ))-> i__8Trimline = ((struct Trimline *)(& __0this -> left__10TrimRegion ))-> numverts__8Trimline ), (((struct Trimline *)(&
  239. __0this -> left__10TrimRegion ))-> pts__8Trimline [(-- ((struct Trimline *)(& __0this -> left__10TrimRegion ))-> i__8Trimline )])) ;
  240. __1l = (((__1ll -> param__10TrimVertex [0 ])> (__1lf -> param__10TrimVertex [0 ]))?__1ll :__1lf );
  241. __1rf = ( (((struct Trimline *)(& __0this -> right__10TrimRegion ))-> i__8Trimline = 0 ), (((struct Trimline *)(& __0this -> right__10TrimRegion ))-> pts__8Trimline [((struct Trimline *)(&
  242. __0this -> right__10TrimRegion ))-> i__8Trimline ])) ;
  243. __1rl = ( (((struct Trimline *)(& __0this -> right__10TrimRegion ))-> i__8Trimline = ((struct Trimline *)(& __0this -> right__10TrimRegion ))-> numverts__8Trimline ), (((struct Trimline *)(&
  244. __0this -> right__10TrimRegion ))-> pts__8Trimline [(-- ((struct Trimline *)(& __0this -> right__10TrimRegion ))-> i__8Trimline )])) ;
  245. __1r = (((__1rl -> param__10TrimVertex [0 ])< (__1rf -> param__10TrimVertex [0 ]))?__1rl :__1rf );
  246. return (((__1l -> param__10TrimVertex [0 ])<= (__1r -> param__10TrimVertex [0 ]))?1 :0 );
  247. }
  248. static void *__nw__FUi (
  249. size_t __1s )
  250. {
  251. void *__1__Xp00uzigaiaa ;
  252. __1__Xp00uzigaiaa = malloc ( __1s ) ;
  253. if (__1__Xp00uzigaiaa ){
  254. return __1__Xp00uzigaiaa ;
  255. }
  256. else
  257. {
  258. return __1__Xp00uzigaiaa ;
  259. }
  260. }
  261. /* the end */