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.

854 lines
38 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 <math.h>
  20. #include <setjmp.h>
  21. struct JumpBuffer {
  22. jmp_buf buf;
  23. };
  24. #define mysetjmp(x) setjmp((x)->buf)
  25. #define mylongjmp(x,y) longjmp((x)->buf, y)
  26. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  27. /* < ../core/patch.c++ > */
  28. void *__vec_new (void *, int , int , void *);
  29. void __vec_ct (void *, int , int , void *);
  30. void __vec_dt (void *, int , int , void *);
  31. void __vec_delete (void *, int , int , void *, int , int );
  32. typedef int (*__vptp)(void);
  33. struct __mptr {short d; short i; __vptp f; };
  34. typedef unsigned int size_t ;
  35. // extern void *malloc (size_t );
  36. // extern void free (void *);
  37. typedef float REAL ;
  38. typedef void (*Pfvv )(void );
  39. typedef void (*Pfvf )(float *);
  40. typedef int (*cmpfunc )(void *, void *);
  41. typedef REAL Knot ;
  42. typedef REAL *Knot_ptr ;
  43. struct Quilt;
  44. struct Mapdesc;
  45. struct Pspec;
  46. struct Pspec {
  47. REAL range__5Pspec [3];
  48. REAL sidestep__5Pspec [2];
  49. REAL stepsize__5Pspec ;
  50. REAL minstepsize__5Pspec ;
  51. int needsSubdivision__5Pspec ;
  52. };
  53. struct Patchspec;
  54. struct Patchspec {
  55. REAL range__5Pspec [3];
  56. REAL sidestep__5Pspec [2];
  57. REAL stepsize__5Pspec ;
  58. REAL minstepsize__5Pspec ;
  59. int needsSubdivision__5Pspec ;
  60. int order__9Patchspec ;
  61. int stride__9Patchspec ;
  62. };
  63. struct Patch;
  64. struct Patch {
  65. struct Mapdesc *mapdesc__5Patch ;
  66. struct Patch *next__5Patch ;
  67. int cullval__5Patch ;
  68. int notInBbox__5Patch ;
  69. int needsSampling__5Patch ;
  70. REAL cpts__5Patch [2880];
  71. REAL spts__5Patch [2880];
  72. REAL bpts__5Patch [2880];
  73. struct Patchspec pspec__5Patch [2];
  74. REAL bb__5Patch [2][5];
  75. };
  76. struct Buffer;
  77. struct Buffer {
  78. struct Buffer *next__6Buffer ;
  79. };
  80. struct Pool;
  81. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  82. struct Pool {
  83. struct Buffer *freelist__4Pool ;
  84. char *blocklist__4Pool [32];
  85. int nextblock__4Pool ;
  86. char *curblock__4Pool ;
  87. int buffersize__4Pool ;
  88. int nextsize__4Pool ;
  89. int nextfree__4Pool ;
  90. int initsize__4Pool ;
  91. char *name__4Pool ;
  92. int magic__4Pool ;
  93. };
  94. void __glgrow__4PoolFv (struct Pool *);
  95. struct PooledObj;
  96. struct PooledObj {
  97. char __W3__9PooledObj ;
  98. };
  99. typedef REAL Maxmatrix [5][5];
  100. struct Backend;
  101. struct Mapdesc;
  102. struct Mapdesc {
  103. char __W3__9PooledObj ;
  104. REAL pixel_tolerance__7Mapdesc ;
  105. REAL clampfactor__7Mapdesc ;
  106. REAL minsavings__7Mapdesc ;
  107. REAL maxrate__7Mapdesc ;
  108. REAL maxsrate__7Mapdesc ;
  109. REAL maxtrate__7Mapdesc ;
  110. REAL bboxsize__7Mapdesc [5];
  111. long type__7Mapdesc ;
  112. int isrational__7Mapdesc ;
  113. int ncoords__7Mapdesc ;
  114. int hcoords__7Mapdesc ;
  115. int inhcoords__7Mapdesc ;
  116. int mask__7Mapdesc ;
  117. Maxmatrix bmat__7Mapdesc ;
  118. Maxmatrix cmat__7Mapdesc ;
  119. Maxmatrix smat__7Mapdesc ;
  120. REAL s_steps__7Mapdesc ;
  121. REAL t_steps__7Mapdesc ;
  122. REAL sampling_method__7Mapdesc ;
  123. REAL culling_method__7Mapdesc ;
  124. REAL bbox_subdividing__7Mapdesc ;
  125. struct Mapdesc *next__7Mapdesc ;
  126. struct Backend *backend__7Mapdesc ;
  127. };
  128. void __glcopy__7MapdescSFPA5_flPfN20 (REAL (*)[5], long , float *, long , long );
  129. void __glxformRational__7MapdescFPA0 (struct Mapdesc *, REAL (*)[5], REAL *, REAL *);
  130. void __glxformNonrational__7Mapdesc0 (struct Mapdesc *, REAL (*)[5], REAL *, REAL *);
  131. struct Backend;
  132. struct Flist;
  133. struct Knotvector;
  134. struct Quiltspec;
  135. struct Quiltspec {
  136. int stride__9Quiltspec ;
  137. int width__9Quiltspec ;
  138. int offset__9Quiltspec ;
  139. int order__9Quiltspec ;
  140. int index__9Quiltspec ;
  141. int bdry__9Quiltspec [2];
  142. REAL step_size__9Quiltspec ;
  143. Knot *breakpoints__9Quiltspec ;
  144. };
  145. typedef struct Quiltspec *Quiltspec_ptr ;
  146. struct Quilt;
  147. struct Quilt {
  148. char __W3__9PooledObj ;
  149. struct Mapdesc *mapdesc__5Quilt ;
  150. REAL *cpts__5Quilt ;
  151. struct Quiltspec qspec__5Quilt [2];
  152. Quiltspec_ptr eqspec__5Quilt ;
  153. struct Quilt *next__5Quilt ;
  154. };
  155. typedef struct Quilt *Quilt_ptr ;
  156. void __glselect__5QuiltFPfT1 (struct Quilt *, REAL *, REAL *);
  157. void __glxformSampling__7MapdescFPf1 (struct Mapdesc *, REAL *, int , int , int , int , REAL *, int
  158. , int );
  159. void __glxformCulling__7MapdescFPfi1 (struct Mapdesc *, REAL *, int , int , int , int , REAL *, int
  160. , int );
  161. void __glxformBounding__7MapdescFPf1 (struct Mapdesc *, REAL *, int , int , int , int , REAL *, int
  162. , int );
  163. struct Patch *__gl__ct__5PatchFR5PatchifP5Pa0 (struct Patch *, struct Patch *, int , REAL , struct Patch *);
  164. void __glcheckBboxConstraint__5Patc0 (struct Patch *);
  165. extern struct __mptr* __ptbl_vec_____core_patch_c_____ct_[];
  166. struct Patch *__gl__ct__5PatchFP5QuiltPfT2P50 (struct Patch *__0this , Quilt_ptr __1geo , REAL *__1pta , REAL *__1ptb , struct Patch *__1n )
  167. {
  168. struct Mapdesc *__0__X5 ;
  169. void *__1__Xp00uzigaiaa ;
  170. if (__0this || (__0this = (struct Patch *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Patch))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) )){
  171. __0this -> mapdesc__5Patch = __1geo -> mapdesc__5Quilt ;
  172. __0this -> cullval__5Patch = (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> culling_method__7Mapdesc != 0.0 )?1 :0 )) ?2 :1 );
  173. __0this -> notInBbox__5Patch = (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> bbox_subdividing__7Mapdesc != 0.0 )?1 :0 )) ?1 :0 );
  174. __0this -> needsSampling__5Patch = (( (__0__X5 = (struct Mapdesc *)__0this -> mapdesc__5Patch ), ( ((( ((__0__X5 -> sampling_method__7Mapdesc == 5.0 )?1 :0 )) || (
  175. ((__0__X5 -> sampling_method__7Mapdesc == 6.0 )?1 :0 )) )|| ( ((__0__X5 -> sampling_method__7Mapdesc == 7.0 )?1 :0 )) )) ) ?1 :0 );
  176. (__0this -> pspec__5Patch [0 ]). order__9Patchspec = (__1geo -> qspec__5Quilt [0 ]). order__9Quiltspec ;
  177. (__0this -> pspec__5Patch [1 ]). order__9Patchspec = (__1geo -> qspec__5Quilt [1 ]). order__9Quiltspec ;
  178. (__0this -> pspec__5Patch [0 ]). stride__9Patchspec = ((__0this -> pspec__5Patch [1 ]). order__9Patchspec * 5 );
  179. (__0this -> pspec__5Patch [1 ]). stride__9Patchspec = 5 ;
  180. { REAL *__1ps ;
  181. __1ps = __1geo -> cpts__5Quilt ;
  182. __glselect__5QuiltFPfT1 ( (struct Quilt *)__1geo , __1pta , __1ptb ) ;
  183. __1ps += (__1geo -> qspec__5Quilt [0 ]). offset__9Quiltspec ;
  184. __1ps += (__1geo -> qspec__5Quilt [1 ]). offset__9Quiltspec ;
  185. __1ps += (((__1geo -> qspec__5Quilt [0 ]). index__9Quiltspec * (__1geo -> qspec__5Quilt [0 ]). order__9Quiltspec )* (__1geo -> qspec__5Quilt [0 ]). stride__9Quiltspec );
  186. __1ps += (((__1geo -> qspec__5Quilt [1 ]). index__9Quiltspec * (__1geo -> qspec__5Quilt [1 ]). order__9Quiltspec )* (__1geo -> qspec__5Quilt [1 ]). stride__9Quiltspec );
  187. if (__0this -> needsSampling__5Patch ){
  188. __glxformSampling__7MapdescFPf1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , __1ps , (__1geo -> qspec__5Quilt [0 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [0 ]). stride__9Quiltspec ,
  189. (__1geo -> qspec__5Quilt [1 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [1 ]). stride__9Quiltspec , (float *)__0this -> spts__5Patch , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]).
  190. stride__9Patchspec ) ;
  191. }
  192. if (__0this -> cullval__5Patch == 2 ){
  193. __glxformCulling__7MapdescFPfi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , __1ps , (__1geo -> qspec__5Quilt [0 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [0 ]).
  194. stride__9Quiltspec , (__1geo -> qspec__5Quilt [1 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [1 ]). stride__9Quiltspec , (float *)__0this -> cpts__5Patch , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this ->
  195. pspec__5Patch [1 ]). stride__9Patchspec ) ;
  196. }
  197. if (__0this -> notInBbox__5Patch ){
  198. __glxformBounding__7MapdescFPf1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , __1ps , (__1geo -> qspec__5Quilt [0 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [0 ]). stride__9Quiltspec ,
  199. (__1geo -> qspec__5Quilt [1 ]). order__9Quiltspec , (__1geo -> qspec__5Quilt [1 ]). stride__9Quiltspec , (float *)__0this -> bpts__5Patch , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]).
  200. stride__9Patchspec ) ;
  201. }
  202. ((__0this -> pspec__5Patch [0 ]). range__5Pspec [0 ])= ((__1geo -> qspec__5Quilt [0 ]). breakpoints__9Quiltspec [(__1geo -> qspec__5Quilt [0 ]). index__9Quiltspec ]);
  203. ((__0this -> pspec__5Patch [0 ]). range__5Pspec [1 ])= ((__1geo -> qspec__5Quilt [0 ]). breakpoints__9Quiltspec [((__1geo -> qspec__5Quilt [0 ]). index__9Quiltspec + 1 )]);
  204. ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])= (((__0this -> pspec__5Patch [0 ]). range__5Pspec [1 ])- ((__0this -> pspec__5Patch [0 ]). range__5Pspec [0 ]));
  205. ((__0this -> pspec__5Patch [1 ]). range__5Pspec [0 ])= ((__1geo -> qspec__5Quilt [1 ]). breakpoints__9Quiltspec [(__1geo -> qspec__5Quilt [1 ]). index__9Quiltspec ]);
  206. ((__0this -> pspec__5Patch [1 ]). range__5Pspec [1 ])= ((__1geo -> qspec__5Quilt [1 ]). breakpoints__9Quiltspec [((__1geo -> qspec__5Quilt [1 ]). index__9Quiltspec + 1 )]);
  207. ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])= (((__0this -> pspec__5Patch [1 ]). range__5Pspec [1 ])- ((__0this -> pspec__5Patch [1 ]). range__5Pspec [0 ]));
  208. if (((__0this -> pspec__5Patch [0 ]). range__5Pspec [0 ])!= (__1pta [0 ])){
  209. ((void )0 );
  210. { struct Patch __2lower ;
  211. __gl__ct__5PatchFR5PatchifP5Pa0 ( (struct Patch *)(& __2lower ), (struct Patch *)__0this , 0 , __1pta [0 ], (struct Patch *)0 ) ;
  212. ((*__0this ))= __2lower ;
  213. }
  214. }
  215. if (((__0this -> pspec__5Patch [0 ]). range__5Pspec [1 ])!= (__1ptb [0 ])){
  216. ((void )0 );
  217. { struct Patch __2upper ;
  218. __gl__ct__5PatchFR5PatchifP5Pa0 ( (struct Patch *)(& __2upper ), (struct Patch *)__0this , 0 , __1ptb [0 ], (struct Patch *)0 ) ;
  219. }
  220. }
  221. if (((__0this -> pspec__5Patch [1 ]). range__5Pspec [0 ])!= (__1pta [1 ])){
  222. ((void )0 );
  223. { struct Patch __2lower ;
  224. __gl__ct__5PatchFR5PatchifP5Pa0 ( (struct Patch *)(& __2lower ), (struct Patch *)__0this , 1 , __1pta [1 ], (struct Patch *)0 ) ;
  225. ((*__0this ))= __2lower ;
  226. }
  227. }
  228. if (((__0this -> pspec__5Patch [1 ]). range__5Pspec [1 ])!= (__1ptb [1 ])){
  229. ((void )0 );
  230. { struct Patch __2upper ;
  231. __gl__ct__5PatchFR5PatchifP5Pa0 ( (struct Patch *)(& __2upper ), (struct Patch *)__0this , 1 , __1ptb [1 ], (struct Patch *)0 ) ;
  232. }
  233. }
  234. __glcheckBboxConstraint__5Patc0 ( __0this ) ;
  235. __0this -> next__5Patch = __1n ;
  236. }
  237. } return __0this ;
  238. }
  239. void __glsubdivide__7MapdescFPfT1fi1 (struct Mapdesc *, REAL *, REAL *, REAL , int , int , int , int );
  240. // extern void *memcpy (void *, void *, size_t );
  241. struct Patch *__gl__ct__5PatchFR5PatchifP5Pa0 (struct Patch *__0this , struct Patch *__1upper , int __1param , REAL __1value , struct Patch *__1n )
  242. {
  243. struct Patch *__1lower ;
  244. void *__1__Xp00uzigaiaa ;
  245. if (__0this || (__0this = (struct Patch *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Patch))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) )){
  246. __1lower = (struct Patch *)__0this ;
  247. ((*__1lower )). cullval__5Patch = ((*__1upper )). cullval__5Patch ;
  248. ((*__1lower )). mapdesc__5Patch = ((*__1upper )). mapdesc__5Patch ;
  249. ((*__1lower )). notInBbox__5Patch = ((*__1upper )). notInBbox__5Patch ;
  250. ((*__1lower )). needsSampling__5Patch = ((*__1upper )). needsSampling__5Patch ;
  251. (((*__1lower )). pspec__5Patch [0 ]). order__9Patchspec = (((*__1upper )). pspec__5Patch [0 ]). order__9Patchspec ;
  252. (((*__1lower )). pspec__5Patch [1 ]). order__9Patchspec = (((*__1upper )). pspec__5Patch [1 ]). order__9Patchspec ;
  253. (((*__1lower )). pspec__5Patch [0 ]). stride__9Patchspec = (((*__1upper )). pspec__5Patch [0 ]). stride__9Patchspec ;
  254. (((*__1lower )). pspec__5Patch [1 ]). stride__9Patchspec = (((*__1upper )). pspec__5Patch [1 ]). stride__9Patchspec ;
  255. ((*__1lower )). next__5Patch = __1n ;
  256. switch (__1param ){
  257. case 0 :{
  258. REAL __3d ;
  259. __3d = ((__1value - ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [0 ]))/ ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [2 ]));
  260. if (__0this -> needsSampling__5Patch )
  261. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). spts__5Patch , (float *)((*__1lower )). spts__5Patch , __3d , (__0this ->
  262. pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec , (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec ) ;
  263. if (__0this -> cullval__5Patch == 2 )
  264. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). cpts__5Patch , (float *)((*__1lower )). cpts__5Patch , __3d ,
  265. (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec , (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec ) ;
  266. if (__0this -> notInBbox__5Patch )
  267. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). bpts__5Patch , (float *)((*__1lower )). bpts__5Patch , __3d , (__0this ->
  268. pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec , (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec ) ;
  269. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [0 ]);
  270. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [1 ])= __1value ;
  271. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [2 ])= (__1value - ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [0 ]));
  272. ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [0 ])= __1value ;
  273. ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [2 ])= (((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [1 ])- __1value );
  274. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [0 ]);
  275. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [1 ])= ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [1 ]);
  276. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [2 ])= ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [2 ]);
  277. break ;
  278. }
  279. case 1 :{
  280. REAL __3d ;
  281. __3d = ((__1value - ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [0 ]))/ ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [2 ]));
  282. if (__0this -> needsSampling__5Patch )
  283. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). spts__5Patch , (float *)((*__1lower )). spts__5Patch , __3d , (__0this ->
  284. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec ) ;
  285. if (__0this -> cullval__5Patch == 2 )
  286. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). cpts__5Patch , (float *)((*__1lower )). cpts__5Patch , __3d ,
  287. (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec ) ;
  288. if (__0this -> notInBbox__5Patch )
  289. __glsubdivide__7MapdescFPfT1fi1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)((*__1upper )). bpts__5Patch , (float *)((*__1lower )). bpts__5Patch , __3d , (__0this ->
  290. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec ) ;
  291. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [0 ]);
  292. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [1 ])= ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [1 ]);
  293. ((((*__1lower )). pspec__5Patch [0 ]). range__5Pspec [2 ])= ((((*__1upper )). pspec__5Patch [0 ]). range__5Pspec [2 ]);
  294. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [0 ])= ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [0 ]);
  295. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [1 ])= __1value ;
  296. ((((*__1lower )). pspec__5Patch [1 ]). range__5Pspec [2 ])= (__1value - ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [0 ]));
  297. ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [0 ])= __1value ;
  298. ((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [2 ])= (((((*__1upper )). pspec__5Patch [1 ]). range__5Pspec [1 ])- __1value );
  299. break ;
  300. }
  301. }
  302. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> bbox_subdividing__7Mapdesc != 0.0 )?1 :0 )) && (! __0this -> notInBbox__5Patch ))
  303. memcpy ( (void *)((*__1lower )). bb__5Patch ,
  304. (void *)((*__1upper )). bb__5Patch , sizeof __0this -> bb__5Patch ) ;
  305. __glcheckBboxConstraint__5Patc0 ( (struct Patch *)__1lower ) ;
  306. __glcheckBboxConstraint__5Patc0 ( (struct Patch *)__1upper ) ;
  307. } return __0this ;
  308. }
  309. void __glclamp__9PatchspecFf (struct Patchspec *, REAL );
  310. void __glclamp__5PatchFv (struct Patch *__0this )
  311. {
  312. if (__0this -> mapdesc__5Patch -> clampfactor__7Mapdesc != 0.0 ){
  313. __glclamp__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ])), __0this ->
  314. mapdesc__5Patch -> clampfactor__7Mapdesc ) ;
  315. __glclamp__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ])), __0this -> mapdesc__5Patch -> clampfactor__7Mapdesc ) ;
  316. }
  317. }
  318. void __glclamp__9PatchspecFf (struct Patchspec *__0this , REAL __1clampfactor )
  319. {
  320. if ((__0this -> sidestep__5Pspec [0 ])< __0this -> minstepsize__5Pspec )
  321. (__0this -> sidestep__5Pspec [0 ])= (__1clampfactor * __0this -> minstepsize__5Pspec );
  322. if ((__0this -> sidestep__5Pspec [1 ])< __0this -> minstepsize__5Pspec )
  323. (__0this -> sidestep__5Pspec [1 ])= (__1clampfactor * __0this -> minstepsize__5Pspec );
  324. if (__0this -> stepsize__5Pspec < __0this -> minstepsize__5Pspec )
  325. __0this -> stepsize__5Pspec = (__1clampfactor * __0this -> minstepsize__5Pspec );
  326. }
  327. int __glbboxTooBig__7MapdescFPfiN30 (struct Mapdesc *, REAL *, int , int , int , int , REAL (*)[5]);
  328. void __glcheckBboxConstraint__5Patc0 (struct Patch *__0this )
  329. {
  330. if (__0this -> notInBbox__5Patch && (__glbboxTooBig__7MapdescFPfiN30 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__0this -> bpts__5Patch , (__0this ->
  331. pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec , (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (float (*)[5])__0this -> bb__5Patch )
  332. != 1 ))
  333. {
  334. __0this -> notInBbox__5Patch = 0 ;
  335. }
  336. }
  337. void __glsurfbbox__7MapdescFPA5_f (struct Mapdesc *, REAL (*)[5]);
  338. void __glbbox__5PatchFv (struct Patch *__0this )
  339. {
  340. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> bbox_subdividing__7Mapdesc != 0.0 )?1 :0 )) )
  341. __glsurfbbox__7MapdescFPA5_f ( (struct Mapdesc *)__0this -> mapdesc__5Patch ,
  342. (float (*)[5])__0this -> bb__5Patch ) ;
  343. }
  344. void __glgetstepsize__9PatchspecFf (struct Patchspec *, REAL );
  345. void __glsingleStep__9PatchspecFv (struct Patchspec *);
  346. int __glproject__7MapdescFPfiT2T1N0 (struct Mapdesc *, REAL *, int , int , REAL *, int , int , int
  347. , int );
  348. REAL __glgetProperty__7MapdescFl (struct Mapdesc *, long );
  349. REAL __glcalcPartialVelocity__7Mapd1 (struct Mapdesc *, REAL *, REAL *, int , int , int , int , int ,
  350. int , REAL , REAL , int );
  351. // extern double sqrt (double );
  352. int __glneedsSamplingSubdivision__2 (struct Patch *);
  353. void __glgetstepsize__5PatchFv (struct Patch *__0this )
  354. {
  355. (__0this -> pspec__5Patch [0 ]). needsSubdivision__5Pspec = ((__0this -> pspec__5Patch [1 ]). needsSubdivision__5Pspec = 0 );
  356. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> sampling_method__7Mapdesc == 3.0 )?1 :0 )) ){
  357. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ])), __0this ->
  358. mapdesc__5Patch -> maxsrate__7Mapdesc ) ;
  359. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ])), __0this -> mapdesc__5Patch -> maxtrate__7Mapdesc ) ;
  360. }
  361. else
  362. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> sampling_method__7Mapdesc == 2.0 )?1 :0 )) ){
  363. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ])),
  364. __0this -> mapdesc__5Patch -> maxsrate__7Mapdesc * ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])) ;
  365. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ])), __0this -> mapdesc__5Patch -> maxtrate__7Mapdesc * ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])) ;
  366. }
  367. else
  368. if (! __0this -> needsSampling__5Patch ){
  369. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  370. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  371. }
  372. else
  373. {
  374. REAL __2tmp [24][24][5];
  375. ((void )0 );
  376. { int __2val ;
  377. __2val = __glproject__7MapdescFPfiT2T1N0 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__0this -> spts__5Patch , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec ,
  378. & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec ) ;
  379. if (__2val == 0 ){
  380. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ])), __0this -> mapdesc__5Patch -> maxsrate__7Mapdesc ) ;
  381. __glgetstepsize__9PatchspecFf ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ])), __0this -> mapdesc__5Patch -> maxtrate__7Mapdesc ) ;
  382. }
  383. else
  384. {
  385. REAL __3t ;
  386. __3t = __glgetProperty__7MapdescFl ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (long )1 ) ;
  387. (__0this -> pspec__5Patch [0 ]). minstepsize__5Pspec = ((__0this -> mapdesc__5Patch -> maxsrate__7Mapdesc > 0.0 )?(((double )(((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])/ __0this -> mapdesc__5Patch -> maxsrate__7Mapdesc ))):0.0 );
  388. (__0this -> pspec__5Patch [1 ]). minstepsize__5Pspec = ((__0this -> mapdesc__5Patch -> maxtrate__7Mapdesc > 0.0 )?(((double )(((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])/ __0this -> mapdesc__5Patch -> maxtrate__7Mapdesc ))):0.0 );
  389. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> sampling_method__7Mapdesc == 5.0 )?1 :0 )) ){
  390. REAL __4ssv [2];
  391. REAL __4ttv [2];
  392. REAL __4ss ;
  393. REAL __4st ;
  394. REAL __4tt ;
  395. __4ss = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4ssv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  396. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 2 , 0 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 0 )
  397. ;
  398. __4st = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)0 , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  399. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 1 , 1 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], -1)
  400. ;
  401. __4tt = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4ttv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  402. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 0 , 2 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 1 )
  403. ;
  404. if ((__4ss != 0.0 )&& (__4tt != 0.0 )){
  405. REAL __5ttq ;
  406. REAL __5ssq ;
  407. REAL __5ds ;
  408. REAL __5dt ;
  409. __5ttq = sqrt ( (double )(((float )__4ss ))) ;
  410. __5ssq = sqrt ( (double )(((float )__4tt ))) ;
  411. __5ds = sqrt ( (double )(((4 * __3t )* __5ttq )/ ((__4ss * __5ttq )+ (__4st * __5ssq )))) ;
  412. __5dt = sqrt ( (double )(((4 * __3t )* __5ssq )/ ((__4tt * __5ssq )+ (__4st * __5ttq )))) ;
  413. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__5ds < ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))?__5ds :((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  414. { REAL __5scutoff ;
  415. __5scutoff = ((2.0 * __3t )/ (((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])));
  416. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= (((__4ssv [0 ])> __5scutoff )?sqrt ( (2.0 * __3t )/ (__4ssv [0 ])) :(((double )((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))));
  417. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= (((__4ssv [1 ])> __5scutoff )?sqrt ( (2.0 * __3t )/ (__4ssv [1 ])) :(((double )((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))));
  418. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__5dt < ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))?__5dt :((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  419. { REAL __5tcutoff ;
  420. __5tcutoff = ((2.0 * __3t )/ (((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])));
  421. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= (((__4ttv [0 ])> __5tcutoff )?sqrt ( (2.0 * __3t )/ (__4ttv [0 ])) :(((double )((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))));
  422. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= (((__4ttv [1 ])> __5tcutoff )?sqrt ( (2.0 * __3t )/ (__4ttv [1 ])) :(((double )((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))));
  423. }
  424. }
  425. }
  426. else
  427. if (__4ss != 0.0 ){
  428. REAL __5x ;
  429. REAL __5ds ;
  430. __5x = (((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])* __4st );
  431. __5ds = ((sqrt ( (__5x * __5x )+ ((8.0 * __3t )* __4ss )) - __5x )/ __4ss );
  432. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__5ds < ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))?__5ds :((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  433. { REAL __5scutoff ;
  434. __5scutoff = ((2.0 * __3t )/ (((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])));
  435. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= (((__4ssv [0 ])> __5scutoff )?sqrt ( (2.0 * __3t )/ (__4ssv [0 ])) :(((double )((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))));
  436. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= (((__4ssv [1 ])> __5scutoff )?sqrt ( (2.0 * __3t )/ (__4ssv [1 ])) :(((double )((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))));
  437. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  438. }
  439. }
  440. else
  441. if (__4tt != 0.0 ){
  442. REAL __5x ;
  443. REAL __5dt ;
  444. __5x = (((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])* __4st );
  445. __5dt = ((sqrt ( (__5x * __5x )+ ((8.0 * __3t )* __4tt )) - __5x )/ __4tt );
  446. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  447. { REAL __5tcutoff ;
  448. __5tcutoff = ((2.0 * __3t )/ (((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])));
  449. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__5dt < ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))?__5dt :((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  450. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= (((__4ttv [0 ])> __5tcutoff )?sqrt ( (2.0 * __3t )/ (__4ttv [0 ])) :(((double )((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))));
  451. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= (((__4ttv [1 ])> __5tcutoff )?sqrt ( (2.0 * __3t )/ (__4ttv [1 ])) :(((double )((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))));
  452. }
  453. }
  454. else
  455. {
  456. if ((4.0 * __3t )> ((__4st * ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))){
  457. __glsingleStep__9PatchspecFv ( (struct
  458. Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  459. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  460. }
  461. else
  462. {
  463. REAL __6area ;
  464. REAL __6ds ;
  465. REAL __6dt ;
  466. __6area = ((4.0 * __3t )/ __4st );
  467. __6ds = sqrt ( (double )((__6area * ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))/ ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))) ;
  468. __6dt = sqrt ( (double )((__6area * ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))/ ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))) ;
  469. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__6ds < ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))?__6ds :((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  470. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]);
  471. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]);
  472. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__6dt < ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))?__6dt :((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  473. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]);
  474. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]);
  475. }
  476. }
  477. }
  478. else
  479. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> sampling_method__7Mapdesc == 6.0 )?1 :0 )) ){
  480. REAL __4msv [2];
  481. REAL __4mtv [2];
  482. REAL __4ms ;
  483. REAL __4mt ;
  484. __4ms = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4msv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  485. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 1 , 0 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 0 )
  486. ;
  487. __4mt = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4mtv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  488. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 0 , 1 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 1 )
  489. ;
  490. if (__4ms != 0.0 ){
  491. if (__4mt != 0.0 ){
  492. REAL __6d ;
  493. REAL __6ds ;
  494. REAL __6dt ;
  495. __6d = (__3t / ((__4ms * __4ms )+ (__4mt * __4mt )));
  496. __6ds = (__4mt * __6d );
  497. __6dt = (__4ms * __6d );
  498. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__6ds < ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))?__6ds :((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  499. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= ((((__4msv [0 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [0 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  500. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= ((((__4msv [1 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [1 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  501. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__6dt < ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))?__6dt :((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  502. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= ((((__4mtv [0 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [0 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  503. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= ((((__4mtv [1 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [1 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  504. }
  505. else
  506. {
  507. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__3t < (__4ms * ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])))?(__3t / __4ms ):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  508. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= ((((__4msv [0 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [0 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  509. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= ((((__4msv [1 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [1 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  510. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  511. }
  512. }
  513. else
  514. {
  515. if (__4mt != 0.0 ){
  516. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  517. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__3t < (__4mt * ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ])))?(__3t / __4mt ):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  518. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= ((((__4mtv [0 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [0 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  519. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= ((((__4mtv [1 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [1 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  520. }
  521. else
  522. {
  523. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  524. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  525. }
  526. }
  527. }
  528. else
  529. if (( ((((struct Mapdesc *)__0this -> mapdesc__5Patch )-> sampling_method__7Mapdesc == 7.0 )?1 :0 )) ){
  530. REAL __4msv [2];
  531. REAL __4mtv [2];
  532. REAL __4ms ;
  533. REAL __4mt ;
  534. __4ms = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4msv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  535. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 1 , 0 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 0 )
  536. ;
  537. __4mt = __glcalcPartialVelocity__7Mapd1 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__4mtv , & (((__2tmp [0 ])[0 ])[0 ]), (int )120, (int )5, (__0this ->
  538. pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , 0 , 1 , (__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ], (__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ], 1 )
  539. ;
  540. if ((__4ms != 0.0 )&& (__4mt != 0.0 )){
  541. REAL __5d ;
  542. __5d = (1.0 / (__4ms * __4mt ));
  543. __3t *= 1.41421356237309504880 ;
  544. { REAL __5ds ;
  545. REAL __5dt ;
  546. __5ds = (__3t * sqrt ( (double )((__5d * ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))/ ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))) );
  547. __5dt = (__3t * sqrt ( (double )((__5d * ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))/ ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))) );
  548. (__0this -> pspec__5Patch [0 ]). stepsize__5Pspec = ((__5ds < ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))?__5ds :((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  549. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])= ((((__4msv [0 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [0 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  550. ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])= ((((__4msv [1 ])* ((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4msv [1 ])):((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ]));
  551. (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec = ((__5dt < ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))?__5dt :((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  552. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])= ((((__4mtv [0 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [0 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  553. ((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [1 ])= ((((__4mtv [1 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]))> __3t )?(__3t / (__4mtv [1 ])):((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  554. }
  555. }
  556. else
  557. {
  558. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  559. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  560. }
  561. }
  562. else
  563. {
  564. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [0 ]))) ;
  565. __glsingleStep__9PatchspecFv ( (struct Patchspec *)(& (__0this -> pspec__5Patch [1 ]))) ;
  566. }
  567. }
  568. }
  569. }
  570. if (__0this -> mapdesc__5Patch -> minsavings__7Mapdesc != 0.0 ){
  571. REAL __2savings ;
  572. __2savings = (1. / ((__0this -> pspec__5Patch [0 ]). stepsize__5Pspec * (__0this -> pspec__5Patch [1 ]). stepsize__5Pspec ));
  573. __2savings -= ((2. / (((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [0 ])+ ((__0this -> pspec__5Patch [0 ]). sidestep__5Pspec [1 ])))* (2. / (((__0this -> pspec__5Patch [1 ]). sidestep__5Pspec [0 ])+ ((__0this -> pspec__5Patch [1 ]).
  574. sidestep__5Pspec [1 ]))));
  575. __2savings *= (((__0this -> pspec__5Patch [0 ]). range__5Pspec [2 ])* ((__0this -> pspec__5Patch [1 ]). range__5Pspec [2 ]));
  576. if (__2savings > __0this -> mapdesc__5Patch -> minsavings__7Mapdesc ){
  577. (__0this -> pspec__5Patch [0 ]). needsSubdivision__5Pspec = ((__0this -> pspec__5Patch [1 ]). needsSubdivision__5Pspec = 1 );
  578. }
  579. }
  580. if ((__0this -> pspec__5Patch [0 ]). stepsize__5Pspec < (__0this -> pspec__5Patch [0 ]). minstepsize__5Pspec )(__0this -> pspec__5Patch [0 ]). needsSubdivision__5Pspec = 1 ;
  581. if ((__0this -> pspec__5Patch [1 ]). stepsize__5Pspec < (__0this -> pspec__5Patch [1 ]). minstepsize__5Pspec )(__0this -> pspec__5Patch [1 ]). needsSubdivision__5Pspec = 1 ;
  582. __0this -> needsSampling__5Patch = (__0this -> needsSampling__5Patch ?__glneedsSamplingSubdivision__2 ( __0this ) :0 );
  583. }
  584. void __glsingleStep__9PatchspecFv (struct Patchspec *__0this )
  585. {
  586. __0this -> stepsize__5Pspec = ((__0this -> sidestep__5Pspec [0 ])= ((__0this -> sidestep__5Pspec [1 ])= (__0this -> range__5Pspec [2 ])));
  587. }
  588. void __glgetstepsize__9PatchspecFf (struct Patchspec *__0this , REAL __1max )
  589. {
  590. __0this -> stepsize__5Pspec = ((__1max >= 1.0 )?((__0this -> range__5Pspec [2 ])/ __1max ):(__0this -> range__5Pspec [2 ]));
  591. (__0this -> sidestep__5Pspec [0 ])= ((__0this -> sidestep__5Pspec [1 ])= (__0this -> minstepsize__5Pspec = __0this -> stepsize__5Pspec ));
  592. }
  593. int __glneedsSamplingSubdivision__2 (struct Patch *__0this )
  594. {
  595. return (((__0this -> pspec__5Patch [0 ]). needsSubdivision__5Pspec || (__0this -> pspec__5Patch [1 ]). needsSubdivision__5Pspec )?1 :0 );
  596. }
  597. int __glneedsNonSamplingSubdivisio0 (struct Patch *__0this )
  598. {
  599. return __0this -> notInBbox__5Patch ;
  600. }
  601. int __glneedsSubdivision__5PatchFi (struct Patch *__0this , int __1param )
  602. {
  603. return (__0this -> pspec__5Patch [__1param ]). needsSubdivision__5Pspec ;
  604. }
  605. int __glcullCheck__7MapdescFPfiN32 (struct Mapdesc *, REAL *, int , int , int , int );
  606. int __glcullCheck__5PatchFv (struct Patch *__0this )
  607. {
  608. if (__0this -> cullval__5Patch == 2 )
  609. __0this -> cullval__5Patch = __glcullCheck__7MapdescFPfiN32 ( (struct Mapdesc *)__0this -> mapdesc__5Patch , (float *)__0this ->
  610. cpts__5Patch , (__0this -> pspec__5Patch [0 ]). order__9Patchspec , (__0this -> pspec__5Patch [0 ]). stride__9Patchspec , (__0this -> pspec__5Patch [1 ]). order__9Patchspec , (__0this -> pspec__5Patch [1 ]). stride__9Patchspec ) ;
  611. return __0this -> cullval__5Patch ;
  612. }
  613. /* the end */