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.

758 lines
14 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/curvesub.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 JumpBuffer;
  36. struct Buffer;
  37. struct Buffer {
  38. struct Buffer *next__6Buffer ;
  39. };
  40. struct Pool;
  41. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  42. struct Pool {
  43. struct Buffer *freelist__4Pool ;
  44. char *blocklist__4Pool [32];
  45. int nextblock__4Pool ;
  46. char *curblock__4Pool ;
  47. int buffersize__4Pool ;
  48. int nextsize__4Pool ;
  49. int nextfree__4Pool ;
  50. int initsize__4Pool ;
  51. char *name__4Pool ;
  52. int magic__4Pool ;
  53. };
  54. void __glgrow__4PoolFv (struct Pool *);
  55. struct PooledObj;
  56. struct PooledObj {
  57. char __W3__9PooledObj ;
  58. };
  59. typedef float REAL ;
  60. typedef void (*Pfvv )(void );
  61. typedef void (*Pfvf )(float *);
  62. typedef int (*cmpfunc )(void *, void *);
  63. typedef REAL Knot ;
  64. typedef REAL *Knot_ptr ;
  65. struct TrimVertex;
  66. struct PwlArc;
  67. struct PwlArc {
  68. char __W3__9PooledObj ;
  69. struct TrimVertex *pts__6PwlArc ;
  70. int npts__6PwlArc ;
  71. long type__6PwlArc ;
  72. };
  73. struct TrimVertex;
  74. struct TrimVertex {
  75. REAL param__10TrimVertex [2];
  76. long nuid__10TrimVertex ;
  77. };
  78. typedef struct TrimVertex *TrimVertex_p ;
  79. struct Bin;
  80. struct Arc;
  81. struct BezierArc;
  82. typedef struct Arc *Arc_ptr ;
  83. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  84. struct Arc;
  85. struct Arc {
  86. char __W3__9PooledObj ;
  87. Arc_ptr prev__3Arc ;
  88. Arc_ptr next__3Arc ;
  89. Arc_ptr link__3Arc ;
  90. struct BezierArc *bezierArc__3Arc ;
  91. struct PwlArc *pwlArc__3Arc ;
  92. long type__3Arc ;
  93. long nuid__3Arc ;
  94. };
  95. extern int __glbezier_tag__3Arc ;
  96. extern int __glarc_tag__3Arc ;
  97. extern int __gltail_tag__3Arc ;
  98. struct Bin;
  99. struct Bin {
  100. struct Arc *head__3Bin ;
  101. struct Arc *current__3Bin ;
  102. };
  103. struct Sorter;
  104. struct Sorter {
  105. int es__6Sorter ;
  106. struct __mptr *__vptr__6Sorter ;
  107. };
  108. struct FlistSorter;
  109. struct FlistSorter {
  110. int es__6Sorter ;
  111. struct __mptr *__vptr__6Sorter ;
  112. };
  113. struct Flist;
  114. struct Flist {
  115. REAL *pts__5Flist ;
  116. int npts__5Flist ;
  117. int start__5Flist ;
  118. int end__5Flist ;
  119. struct FlistSorter sorter__5Flist ;
  120. };
  121. struct Backend;
  122. struct Jarcloc;
  123. struct Jarcloc {
  124. struct Arc *arc__7Jarcloc ;
  125. struct TrimVertex *p__7Jarcloc ;
  126. struct TrimVertex *plast__7Jarcloc ;
  127. };
  128. struct Trimline;
  129. struct Trimline {
  130. struct TrimVertex **pts__8Trimline ;
  131. long numverts__8Trimline ;
  132. long i__8Trimline ;
  133. long size__8Trimline ;
  134. struct Jarcloc jarcl__8Trimline ;
  135. struct TrimVertex t__8Trimline ;
  136. struct TrimVertex b__8Trimline ;
  137. struct TrimVertex *tinterp__8Trimline ;
  138. struct TrimVertex *binterp__8Trimline ;
  139. };
  140. struct Gridline;
  141. struct Gridline {
  142. long v__8Gridline ;
  143. REAL vval__8Gridline ;
  144. long vindex__8Gridline ;
  145. long ustart__8Gridline ;
  146. long uend__8Gridline ;
  147. };
  148. struct Uarray;
  149. struct Uarray {
  150. long size__6Uarray ;
  151. long ulines__6Uarray ;
  152. REAL *uarray__6Uarray ;
  153. };
  154. struct Backend;
  155. struct TrimRegion;
  156. void __gl__dt__8TrimlineFv (struct Trimline *, int );
  157. void __gl__dt__6UarrayFv (struct Uarray *, int );
  158. struct TrimRegion {
  159. struct Trimline left__10TrimRegion ;
  160. struct Trimline right__10TrimRegion ;
  161. struct Gridline top__10TrimRegion ;
  162. struct Gridline bot__10TrimRegion ;
  163. struct Uarray uarray__10TrimRegion ;
  164. REAL oneOverDu__10TrimRegion ;
  165. };
  166. struct GridTrimVertex;
  167. struct __Q2_4Hull4Side;
  168. struct __Q2_4Hull4Side {
  169. struct Trimline *left__Q2_4Hull4Side ;
  170. struct Gridline *line__Q2_4Hull4Side ;
  171. struct Trimline *right__Q2_4Hull4Side ;
  172. long index__Q2_4Hull4Side ;
  173. };
  174. struct Hull;
  175. struct Hull {
  176. struct __Q2_4Hull4Side lower__4Hull ;
  177. struct __Q2_4Hull4Side upper__4Hull ;
  178. struct Trimline fakeleft__4Hull ;
  179. struct Trimline fakeright__4Hull ;
  180. struct TrimRegion *PTrimRegion;
  181. struct TrimRegion OTrimRegion;
  182. };
  183. struct Backend;
  184. struct GridTrimVertex;
  185. struct Mesher;
  186. struct Mesher {
  187. struct __Q2_4Hull4Side lower__4Hull ;
  188. struct __Q2_4Hull4Side upper__4Hull ;
  189. struct Trimline fakeleft__4Hull ;
  190. struct Trimline fakeright__4Hull ;
  191. struct TrimRegion *PTrimRegion;
  192. struct Backend *backend__6Mesher ;
  193. struct Pool p__6Mesher ;
  194. unsigned int stacksize__6Mesher ;
  195. struct GridTrimVertex **vdata__6Mesher ;
  196. struct GridTrimVertex *last__6Mesher [2];
  197. int itop__6Mesher ;
  198. int lastedge__6Mesher ;
  199. struct TrimRegion OTrimRegion;
  200. };
  201. extern float __glZERO__6Mesher ;
  202. struct Backend;
  203. struct GridVertex;
  204. struct GridTrimVertex;
  205. struct CoveAndTiler;
  206. struct CoveAndTiler {
  207. struct Backend *backend__12CoveAndTiler ;
  208. struct TrimRegion *PTrimRegion;
  209. struct TrimRegion OTrimRegion;
  210. };
  211. extern int __glMAXSTRIPSIZE__12CoveAndTil0 ;
  212. struct Backend;
  213. struct Slicer;
  214. struct Slicer {
  215. struct Backend *backend__12CoveAndTiler ;
  216. struct TrimRegion *PTrimRegion;
  217. struct Mesher OMesher;
  218. struct Backend *backend__6Slicer ;
  219. REAL oneOverDu__6Slicer ;
  220. REAL du__6Slicer ;
  221. REAL dv__6Slicer ;
  222. int isolines__6Slicer ;
  223. };
  224. struct BezierArc;
  225. struct TrimVertexPool;
  226. struct ArcTessellator;
  227. struct ArcTessellator {
  228. struct Pool *pwlarcpool__14ArcTessellator ;
  229. struct TrimVertexPool *trimvertexpool__14ArcTessellator ;
  230. };
  231. extern REAL __glgl_Bernstein__14ArcTessell0 [][24][24];
  232. struct TrimVertexPool;
  233. struct TrimVertexPool {
  234. struct Pool pool__14TrimVertexPool ;
  235. struct TrimVertex **vlist__14TrimVertexPool ;
  236. int nextvlistslot__14TrimVertexPool ;
  237. int vlistsize__14TrimVertexPool ;
  238. };
  239. struct Renderhints;
  240. struct Backend;
  241. struct Quilt;
  242. struct Patchlist;
  243. struct Curvelist;
  244. struct JumpBuffer;
  245. struct Subdivider;
  246. enum __Q2_10Subdivider3dir { down__Q2_10Subdivider3dir = 0, same__Q2_10Subdivider3dir = 1, up__Q2_10Subdivider3dir = 2, none__Q2_10Subdivider3dir = 3} ;
  247. struct Subdivider {
  248. struct Slicer slicer__10Subdivider ;
  249. struct ArcTessellator arctessellator__10Subdivider ;
  250. struct Pool arcpool__10Subdivider ;
  251. struct Pool bezierarcpool__10Subdivider ;
  252. struct Pool pwlarcpool__10Subdivider ;
  253. struct TrimVertexPool trimvertexpool__10Subdivider ;
  254. struct JumpBuffer *jumpbuffer__10Subdivider ;
  255. struct Renderhints *renderhints__10Subdivider ;
  256. struct Backend *backend__10Subdivider ;
  257. struct Bin initialbin__10Subdivider ;
  258. struct Arc *pjarc__10Subdivider ;
  259. int s_index__10Subdivider ;
  260. int t_index__10Subdivider ;
  261. struct Quilt *qlist__10Subdivider ;
  262. struct Flist spbrkpts__10Subdivider ;
  263. struct Flist tpbrkpts__10Subdivider ;
  264. struct Flist smbrkpts__10Subdivider ;
  265. struct Flist tmbrkpts__10Subdivider ;
  266. REAL stepsizes__10Subdivider [4];
  267. int showDegenerate__10Subdivider ;
  268. int isArcTypeBezier__10Subdivider ;
  269. };
  270. struct Renderhints;
  271. struct Renderhints {
  272. REAL display_method__11Renderhints ;
  273. REAL errorchecking__11Renderhints ;
  274. REAL subdivisions__11Renderhints ;
  275. REAL tmp1__11Renderhints ;
  276. int displaydomain__11Renderhints ;
  277. int maxsubdivisions__11Renderhints ;
  278. int wiretris__11Renderhints ;
  279. int wirequads__11Renderhints ;
  280. };
  281. struct GridVertex;
  282. struct GridVertex {
  283. long gparam__10GridVertex [2];
  284. };
  285. struct GridTrimVertex;
  286. struct GridTrimVertex {
  287. char __W3__9PooledObj ;
  288. struct TrimVertex dummyt__14GridTrimVertex ;
  289. struct GridVertex dummyg__14GridTrimVertex ;
  290. struct TrimVertex *t__14GridTrimVertex ;
  291. struct GridVertex *g__14GridTrimVertex ;
  292. };
  293. typedef struct GridTrimVertex *GridTrimVertex_p ;
  294. struct BasicCurveEvaluator;
  295. struct BasicSurfaceEvaluator;
  296. struct Backend;
  297. struct Backend {
  298. struct BasicCurveEvaluator *curveEvaluator__7Backend ;
  299. struct BasicSurfaceEvaluator *surfaceEvaluator__7Backend ;
  300. int wireframetris__7Backend ;
  301. int wireframequads__7Backend ;
  302. int npts__7Backend ;
  303. REAL mesh__7Backend [3][4];
  304. int meshindex__7Backend ;
  305. };
  306. struct Mapdesc;
  307. struct Knotvector;
  308. struct Quiltspec;
  309. struct Quiltspec {
  310. int stride__9Quiltspec ;
  311. int width__9Quiltspec ;
  312. int offset__9Quiltspec ;
  313. int order__9Quiltspec ;
  314. int index__9Quiltspec ;
  315. int bdry__9Quiltspec [2];
  316. REAL step_size__9Quiltspec ;
  317. Knot *breakpoints__9Quiltspec ;
  318. };
  319. typedef struct Quiltspec *Quiltspec_ptr ;
  320. struct Quilt;
  321. struct Quilt {
  322. char __W3__9PooledObj ;
  323. struct Mapdesc *mapdesc__5Quilt ;
  324. REAL *cpts__5Quilt ;
  325. struct Quiltspec qspec__5Quilt [2];
  326. Quiltspec_ptr eqspec__5Quilt ;
  327. struct Quilt *next__5Quilt ;
  328. };
  329. typedef struct Quilt *Quilt_ptr ;
  330. struct Mapdesc;
  331. struct Curve;
  332. struct Curvelist;
  333. struct Curvelist {
  334. struct Curve *curve__9Curvelist ;
  335. float range__9Curvelist [3];
  336. int needsSubdivision__9Curvelist ;
  337. float stepsize__9Curvelist ;
  338. };
  339. struct Mapdesc;
  340. struct Curve;
  341. struct Curve {
  342. struct Curve *next__5Curve ;
  343. struct Mapdesc *mapdesc__5Curve ;
  344. int stride__5Curve ;
  345. int order__5Curve ;
  346. int cullval__5Curve ;
  347. int needsSampling__5Curve ;
  348. REAL cpts__5Curve [120];
  349. REAL spts__5Curve [120];
  350. REAL stepsize__5Curve ;
  351. REAL minstepsize__5Curve ;
  352. REAL range__5Curve [3];
  353. };
  354. struct Flist *__gl__ct__5FlistFv (struct Flist *);
  355. void __glgetRange__5QuiltFPfT1R5Fli1 (struct Quilt *, REAL *, REAL *, struct Flist *);
  356. void __glinit__11RenderhintsFv (struct Renderhints *);
  357. void __glbgncurv__7BackendFv (struct Backend *);
  358. void __gldownloadAll__5QuiltFPfT1R70 (struct Quilt *, REAL *, REAL *, struct Backend *);
  359. struct Curvelist *__gl__ct__9CurvelistFP5QuiltfT0 (struct Curvelist *, struct Quilt *, REAL , REAL );
  360. void __glsamplingSplit__10Subdivide0 (struct Subdivider *, struct Curvelist *, int );
  361. void __glendcurv__7BackendFv (struct Backend *);
  362. extern struct __mptr* __ptbl_vec_____core_curvesub_c___drawCurves_[];
  363. void __gl__dt__5FlistFv (struct Flist *, int );
  364. void __gl__dt__9CurvelistFv (struct Curvelist *, int );
  365. void __gldrawCurves__10SubdividerFv (struct Subdivider *__0this )
  366. {
  367. REAL __1from [1];
  368. REAL __1to [1];
  369. struct Flist __1bpts ;
  370. __gl__ct__5FlistFv ( (struct Flist *)(& __1bpts )) ;
  371. __glgetRange__5QuiltFPfT1R5Fli1 ( (struct Quilt *)__0this -> qlist__10Subdivider , (REAL *)__1from , (REAL *)__1to , (struct Flist *)(& __1bpts )) ;
  372. __glinit__11RenderhintsFv ( (struct Renderhints *)__0this -> renderhints__10Subdivider ) ;
  373. __glbgncurv__7BackendFv ( (struct Backend *)__0this -> backend__10Subdivider ) ;
  374. { { int __1i ;
  375. __1i = __1bpts . start__5Flist ;
  376. for(;__1i < (__1bpts . end__5Flist - 1 );__1i ++ ) {
  377. REAL __2pta ;
  378. REAL __2ptb ;
  379. __2pta = (__1bpts . pts__5Flist [__1i ]);
  380. __2ptb = (__1bpts . pts__5Flist [(__1i + 1 )]);
  381. __gldownloadAll__5QuiltFPfT1R70 ( (struct Quilt *)__0this -> qlist__10Subdivider , & __2pta , & __2ptb , __0this -> backend__10Subdivider ) ;
  382. { struct Curvelist __2curvelist ;
  383. __gl__ct__9CurvelistFP5QuiltfT0 ( (struct Curvelist *)(& __2curvelist ), __0this -> qlist__10Subdivider , __2pta , __2ptb ) ;
  384. __glsamplingSplit__10Subdivide0 ( __0this , (struct Curvelist *)(& __2curvelist ), ((*__0this -> renderhints__10Subdivider )). maxsubdivisions__11Renderhints ) ;
  385. __gl__dt__9CurvelistFv ( (struct Curvelist *)(& __2curvelist ), 2) ;
  386. }
  387. }
  388. __glendcurv__7BackendFv ( (struct Backend *)__0this -> backend__10Subdivider ) ;
  389. }
  390. }
  391. __gl__dt__5FlistFv ( (struct Flist *)(& __1bpts ), 2) ;
  392. }
  393. int __glcullCheck__9CurvelistFv (struct Curvelist *);
  394. void __glgetstepsize__9CurvelistFv (struct Curvelist *);
  395. int __glneedsSamplingSubdivision__1 (struct Curvelist *);
  396. struct Curvelist *__gl__ct__9CurvelistFR9Curveli0 (struct Curvelist *, struct Curvelist *, REAL );
  397. void __glcurvgrid__7BackendFfT1l (struct Backend *, REAL , REAL , long );
  398. void __glcurvmesh__7BackendFlT1 (struct Backend *, long , long );
  399. void __glsamplingSplit__10Subdivide0 (struct Subdivider *__0this , struct Curvelist *__1curvelist , int __1subdivisions )
  400. {
  401. if (__glcullCheck__9CurvelistFv ( (struct Curvelist *)__1curvelist ) == 0 )return ;
  402. __glgetstepsize__9CurvelistFv ( (struct Curvelist *)__1curvelist ) ;
  403. if (__glneedsSamplingSubdivision__1 ( (struct Curvelist *)__1curvelist ) && (__1subdivisions > 0 )){
  404. REAL __2mid ;
  405. struct Curvelist __2lowerlist ;
  406. __2mid = (((((*__1curvelist )). range__9Curvelist [0 ])+ (((*__1curvelist )). range__9Curvelist [1 ]))* 0.5 );
  407. __gl__ct__9CurvelistFR9Curveli0 ( (struct Curvelist *)(& __2lowerlist ), __1curvelist , __2mid ) ;
  408. __glsamplingSplit__10Subdivide0 ( __0this , (struct Curvelist *)(& __2lowerlist ), __1subdivisions - 1 ) ;
  409. __glsamplingSplit__10Subdivide0 ( __0this , __1curvelist , __1subdivisions - 1 ) ;
  410. __gl__dt__9CurvelistFv ( (struct Curvelist *)(& __2lowerlist ), 2) ;
  411. }
  412. else
  413. {
  414. long __2nu ;
  415. __2nu = (1 + (((long )((((*__1curvelist )). range__9Curvelist [2 ])/ ((*__1curvelist )). stepsize__9Curvelist ))));
  416. __glcurvgrid__7BackendFfT1l ( (struct Backend *)__0this -> backend__10Subdivider , ((*__1curvelist )). range__9Curvelist [0 ], ((*__1curvelist )). range__9Curvelist [1 ], __2nu ) ;
  417. __glcurvmesh__7BackendFlT1 ( (struct Backend *)__0this -> backend__10Subdivider , (long )0 , __2nu ) ;
  418. }
  419. }
  420. /* the end */