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.

429 lines
12 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/patchlist.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 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 Backend;
  66. struct Mapdesc;
  67. struct Flist;
  68. struct Knotvector;
  69. struct Quiltspec;
  70. struct Quiltspec {
  71. int stride__9Quiltspec ;
  72. int width__9Quiltspec ;
  73. int offset__9Quiltspec ;
  74. int order__9Quiltspec ;
  75. int index__9Quiltspec ;
  76. int bdry__9Quiltspec [2];
  77. REAL step_size__9Quiltspec ;
  78. Knot *breakpoints__9Quiltspec ;
  79. };
  80. typedef struct Quiltspec *Quiltspec_ptr ;
  81. struct Quilt;
  82. struct Quilt {
  83. char __W3__9PooledObj ;
  84. struct Mapdesc *mapdesc__5Quilt ;
  85. REAL *cpts__5Quilt ;
  86. struct Quiltspec qspec__5Quilt [2];
  87. Quiltspec_ptr eqspec__5Quilt ;
  88. struct Quilt *next__5Quilt ;
  89. };
  90. typedef struct Quilt *Quilt_ptr ;
  91. struct Mapdesc;
  92. struct Pspec;
  93. struct Pspec {
  94. REAL range__5Pspec [3];
  95. REAL sidestep__5Pspec [2];
  96. REAL stepsize__5Pspec ;
  97. REAL minstepsize__5Pspec ;
  98. int needsSubdivision__5Pspec ;
  99. };
  100. struct Patchspec;
  101. struct Patchspec {
  102. REAL range__5Pspec [3];
  103. REAL sidestep__5Pspec [2];
  104. REAL stepsize__5Pspec ;
  105. REAL minstepsize__5Pspec ;
  106. int needsSubdivision__5Pspec ;
  107. int order__9Patchspec ;
  108. int stride__9Patchspec ;
  109. };
  110. struct Patch;
  111. struct Patch {
  112. struct Mapdesc *mapdesc__5Patch ;
  113. struct Patch *next__5Patch ;
  114. int cullval__5Patch ;
  115. int notInBbox__5Patch ;
  116. int needsSampling__5Patch ;
  117. REAL cpts__5Patch [2880];
  118. REAL spts__5Patch [2880];
  119. REAL bpts__5Patch [2880];
  120. struct Patchspec pspec__5Patch [2];
  121. REAL bb__5Patch [2][5];
  122. };
  123. struct Patchlist;
  124. struct Patchlist {
  125. struct Patch *patch__9Patchlist ;
  126. int notInBbox__9Patchlist ;
  127. int needsSampling__9Patchlist ;
  128. struct Pspec pspec__9Patchlist [2];
  129. };
  130. struct Patch *__gl__ct__5PatchFP5QuiltPfT2P50 (struct Patch *, struct Quilt *, REAL *, REAL *, struct Patch *);
  131. extern struct __mptr* __ptbl_vec_____core_patchlist_c_____ct_[];
  132. struct Patchlist *__gl__ct__9PatchlistFP5QuiltPf0 (struct Patchlist *__0this , struct Quilt *__1quilts , REAL *__1pta , REAL *__1ptb )
  133. {
  134. void *__1__Xp00uzigaiaa ;
  135. if (__0this || (__0this = (struct Patchlist *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Patchlist))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) )){
  136. __0this -> patch__9Patchlist = 0 ;
  137. { { struct Quilt *__1q ;
  138. struct Patch *__0__X5 ;
  139. __1q = __1quilts ;
  140. for(;__1q ;__1q = __1q -> next__5Quilt )
  141. __0this -> patch__9Patchlist = __gl__ct__5PatchFP5QuiltPfT2P50 ( (struct Patch *)0 , __1q , __1pta , __1ptb , __0this -> patch__9Patchlist ) ;
  142. ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [0 ])= (__1pta [0 ]);
  143. ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [1 ])= (__1ptb [0 ]);
  144. ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [2 ])= ((__1ptb [0 ])- (__1pta [0 ]));
  145. ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [0 ])= (__1pta [1 ]);
  146. ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [1 ])= (__1ptb [1 ]);
  147. ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [2 ])= ((__1ptb [1 ])- (__1pta [1 ]));
  148. }
  149. }
  150. } return __0this ;
  151. }
  152. struct Patch *__gl__ct__5PatchFR5PatchifP5Pa0 (struct Patch *, struct Patch *, int , REAL , struct Patch *);
  153. struct Patchlist *__gl__ct__9PatchlistFR9Patchli0 (struct Patchlist *__0this , struct Patchlist *__1upper , int __1param , REAL __1value )
  154. {
  155. struct Patchlist *__1lower ;
  156. void *__1__Xp00uzigaiaa ;
  157. if (__0this || (__0this = (struct Patchlist *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Patchlist))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) )){
  158. __1lower = (struct Patchlist *)__0this ;
  159. __0this -> patch__9Patchlist = 0 ;
  160. { { struct Patch *__1p ;
  161. struct Patch *__0__X6 ;
  162. __1p = ((*__1upper )). patch__9Patchlist ;
  163. for(;__1p ;__1p = __1p -> next__5Patch )
  164. __0this -> patch__9Patchlist = __gl__ct__5PatchFR5PatchifP5Pa0 ( (struct Patch *)0 , (struct Patch *)__1p , __1param , __1value , __0this -> patch__9Patchlist )
  165. ;
  166. if (__1param == 0 ){
  167. ((((*__1lower )). pspec__9Patchlist [0 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__9Patchlist [0 ]). range__5Pspec [0 ]);
  168. ((((*__1lower )). pspec__9Patchlist [0 ]). range__5Pspec [1 ])= __1value ;
  169. ((((*__1lower )). pspec__9Patchlist [0 ]). range__5Pspec [2 ])= (__1value - ((((*__1upper )). pspec__9Patchlist [0 ]). range__5Pspec [0 ]));
  170. ((((*__1upper )). pspec__9Patchlist [0 ]). range__5Pspec [0 ])= __1value ;
  171. ((((*__1upper )). pspec__9Patchlist [0 ]). range__5Pspec [2 ])= (((((*__1upper )). pspec__9Patchlist [0 ]). range__5Pspec [1 ])- __1value );
  172. (((*__1lower )). pspec__9Patchlist [1 ])= ((*__1upper )). pspec__9Patchlist [1 ];
  173. }
  174. else
  175. {
  176. (((*__1lower )). pspec__9Patchlist [0 ])= ((*__1upper )). pspec__9Patchlist [0 ];
  177. ((((*__1lower )). pspec__9Patchlist [1 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__9Patchlist [1 ]). range__5Pspec [0 ]);
  178. ((((*__1lower )). pspec__9Patchlist [1 ]). range__5Pspec [1 ])= __1value ;
  179. ((((*__1lower )). pspec__9Patchlist [1 ]). range__5Pspec [2 ])= (__1value - ((((*__1upper )). pspec__9Patchlist [1 ]). range__5Pspec [0 ]));
  180. ((((*__1upper )). pspec__9Patchlist [1 ]). range__5Pspec [0 ])= __1value ;
  181. ((((*__1upper )). pspec__9Patchlist [1 ]). range__5Pspec [2 ])= (((((*__1upper )). pspec__9Patchlist [1 ]). range__5Pspec [1 ])- __1value );
  182. }
  183. }
  184. }
  185. } return __0this ;
  186. }
  187. void __gl__dt__9PatchlistFv (struct Patchlist *__0this ,
  188. int __0__free )
  189. { if (__0this ){
  190. while (__0this -> patch__9Patchlist ){
  191. struct Patch *__2p ;
  192. __2p = __0this -> patch__9Patchlist ;
  193. __0this -> patch__9Patchlist = __0this -> patch__9Patchlist -> next__5Patch ;
  194. ( (((void *)__2p )?( free ( ((void *)__2p )) , 0 ) :( 0 ) )) ;
  195. }
  196. if (__0this )if (__0__free & 1)( (((void *)__0this )?( free ( ((void *)__0this )) , 0 ) :( 0 ) ))
  197. ;
  198. }
  199. }
  200. int __glcullCheck__5PatchFv (struct Patch *);
  201. int __glcullCheck__9PatchlistFv (struct Patchlist *__0this )
  202. {
  203. { { struct Patch *__1p ;
  204. __1p = __0this -> patch__9Patchlist ;
  205. for(;__1p ;__1p = __1p -> next__5Patch )
  206. if (__glcullCheck__5PatchFv ( (struct Patch *)__1p ) == 0 )
  207. return 0 ;
  208. return 2 ;
  209. }
  210. }
  211. }
  212. void __glgetstepsize__5PatchFv (struct Patch *);
  213. void __glclamp__5PatchFv (struct Patch *);
  214. void __glgetstepsize__9PatchlistFv (struct Patchlist *__0this )
  215. {
  216. (__0this -> pspec__9Patchlist [0 ]). stepsize__5Pspec = ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [2 ]);
  217. ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [0 ])= ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [2 ]);
  218. ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [1 ])= ((__0this -> pspec__9Patchlist [0 ]). range__5Pspec [2 ]);
  219. (__0this -> pspec__9Patchlist [1 ]). stepsize__5Pspec = ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [2 ]);
  220. ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [0 ])= ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [2 ]);
  221. ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [1 ])= ((__0this -> pspec__9Patchlist [1 ]). range__5Pspec [2 ]);
  222. { { struct Patch *__1p ;
  223. __1p = __0this -> patch__9Patchlist ;
  224. for(;__1p ;__1p = __1p -> next__5Patch ) {
  225. __glgetstepsize__5PatchFv ( (struct Patch *)__1p ) ;
  226. __glclamp__5PatchFv ( (struct Patch *)__1p ) ;
  227. (__0this -> pspec__9Patchlist [0 ]). stepsize__5Pspec = (((__1p -> pspec__5Patch [0 ]). stepsize__5Pspec < (__0this -> pspec__9Patchlist [0 ]). stepsize__5Pspec )?(__1p -> pspec__5Patch [0 ]). stepsize__5Pspec :(__0this -> pspec__9Patchlist [0 ]). stepsize__5Pspec );
  228. ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [0 ])= ((((__1p -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])< ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [0 ]))?((__1p -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ]):((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [0 ]));
  229. ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [1 ])= ((((__1p -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])< ((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [1 ]))?((__1p -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ]):((__0this -> pspec__9Patchlist [0 ]). sidestep__5Pspec [1 ]));
  230. (__0this -> pspec__9Patchlist [1 ]). stepsize__5Pspec = (((__1p -> pspec__5Patch [1 ]). stepsize__5Pspec < (__0this -> pspec__9Patchlist [1 ]). stepsize__5Pspec )?(__1p -> pspec__5Patch [1 ]). stepsize__5Pspec :(__0this -> pspec__9Patchlist [1 ]). stepsize__5Pspec );
  231. ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [0 ])= ((((__1p -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])< ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [0 ]))?((__1p -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ]):((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [0 ]));
  232. ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [1 ])= ((((__1p -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])< ((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [1 ]))?((__1p -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ]):((__0this -> pspec__9Patchlist [1 ]). sidestep__5Pspec [1 ]));
  233. }
  234. }
  235. }
  236. }
  237. void __glbbox__5PatchFv (struct Patch *);
  238. void __glbbox__9PatchlistFv (struct Patchlist *__0this )
  239. {
  240. { { struct Patch *__1p ;
  241. __1p = __0this -> patch__9Patchlist ;
  242. for(;__1p ;__1p = __1p -> next__5Patch )
  243. __glbbox__5PatchFv ( (struct Patch *)__1p ) ;
  244. }
  245. }
  246. }
  247. int __glneedsNonSamplingSubdivisio0 (struct Patch *);
  248. int __glneedsNonSamplingSubdivisio1 (struct Patchlist *__0this )
  249. {
  250. __0this -> notInBbox__9Patchlist = 0 ;
  251. { { struct Patch *__1p ;
  252. __1p = __0this -> patch__9Patchlist ;
  253. for(;__1p ;__1p = __1p -> next__5Patch )
  254. __0this -> notInBbox__9Patchlist |= __glneedsNonSamplingSubdivisio0 ( (struct Patch *)__1p ) ;
  255. return __0this -> notInBbox__9Patchlist ;
  256. }
  257. }
  258. }
  259. int __glneedsSamplingSubdivision__3 (struct Patchlist *__0this )
  260. {
  261. (__0this -> pspec__9Patchlist [0 ]). needsSubdivision__5Pspec = 0 ;
  262. (__0this -> pspec__9Patchlist [1 ]). needsSubdivision__5Pspec = 0 ;
  263. { { struct Patch *__1p ;
  264. __1p = __0this -> patch__9Patchlist ;
  265. for(;__1p ;__1p = __1p -> next__5Patch ) {
  266. (__0this -> pspec__9Patchlist [0 ]). needsSubdivision__5Pspec |= (__1p -> pspec__5Patch [0 ]). needsSubdivision__5Pspec ;
  267. (__0this -> pspec__9Patchlist [1 ]). needsSubdivision__5Pspec |= (__1p -> pspec__5Patch [0 ]). needsSubdivision__5Pspec ;
  268. }
  269. return (((__0this -> pspec__9Patchlist [0 ]). needsSubdivision__5Pspec || (__0this -> pspec__9Patchlist [1 ]). needsSubdivision__5Pspec )?1 :0 );
  270. }
  271. }
  272. }
  273. int __glneedsSubdivision__9Patchli0 (struct Patchlist *__0this , int __1param )
  274. {
  275. return (__0this -> pspec__9Patchlist [__1param ]). needsSubdivision__5Pspec ;
  276. }
  277. /* the end */