doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Model_lwo.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef __LWO2_H__
30 #define __LWO2_H__
31 
32 /*
33 ======================================================================
34 
35  LWO2 loader. (LightWave Object)
36 
37  Ernie Wright 17 Sep 00
38 
39 ======================================================================
40 */
41 
42 /* chunk and subchunk IDs */
43 
44 #define LWID_(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d))
45 
46 #define ID_FORM LWID_('F','O','R','M')
47 #define ID_LWO2 LWID_('L','W','O','2')
48 #define ID_LWOB LWID_('L','W','O','B')
49 
50 /* top-level chunks */
51 #define ID_LAYR LWID_('L','A','Y','R')
52 #define ID_TAGS LWID_('T','A','G','S')
53 #define ID_PNTS LWID_('P','N','T','S')
54 #define ID_BBOX LWID_('B','B','O','X')
55 #define ID_VMAP LWID_('V','M','A','P')
56 #define ID_VMAD LWID_('V','M','A','D')
57 #define ID_POLS LWID_('P','O','L','S')
58 #define ID_PTAG LWID_('P','T','A','G')
59 #define ID_ENVL LWID_('E','N','V','L')
60 #define ID_CLIP LWID_('C','L','I','P')
61 #define ID_SURF LWID_('S','U','R','F')
62 #define ID_DESC LWID_('D','E','S','C')
63 #define ID_TEXT LWID_('T','E','X','T')
64 #define ID_ICON LWID_('I','C','O','N')
65 
66 /* polygon types */
67 #define ID_FACE LWID_('F','A','C','E')
68 #define ID_CURV LWID_('C','U','R','V')
69 #define ID_PTCH LWID_('P','T','C','H')
70 #define ID_MBAL LWID_('M','B','A','L')
71 #define ID_BONE LWID_('B','O','N','E')
72 
73 /* polygon tags */
74 #define ID_SURF LWID_('S','U','R','F')
75 #define ID_PART LWID_('P','A','R','T')
76 #define ID_SMGP LWID_('S','M','G','P')
77 
78 /* envelopes */
79 #define ID_PRE LWID_('P','R','E',' ')
80 #define ID_POST LWID_('P','O','S','T')
81 #define ID_KEY LWID_('K','E','Y',' ')
82 #define ID_SPAN LWID_('S','P','A','N')
83 #define ID_TCB LWID_('T','C','B',' ')
84 #define ID_HERM LWID_('H','E','R','M')
85 #define ID_BEZI LWID_('B','E','Z','I')
86 #define ID_BEZ2 LWID_('B','E','Z','2')
87 #define ID_LINE LWID_('L','I','N','E')
88 #define ID_STEP LWID_('S','T','E','P')
89 
90 /* clips */
91 #define ID_STIL LWID_('S','T','I','L')
92 #define ID_ISEQ LWID_('I','S','E','Q')
93 #define ID_ANIM LWID_('A','N','I','M')
94 #define ID_XREF LWID_('X','R','E','F')
95 #define ID_STCC LWID_('S','T','C','C')
96 #define ID_TIME LWID_('T','I','M','E')
97 #define ID_CONT LWID_('C','O','N','T')
98 #define ID_BRIT LWID_('B','R','I','T')
99 #define ID_SATR LWID_('S','A','T','R')
100 #define ID_HUE LWID_('H','U','E',' ')
101 #define ID_GAMM LWID_('G','A','M','M')
102 #define ID_NEGA LWID_('N','E','G','A')
103 #define ID_IFLT LWID_('I','F','L','T')
104 #define ID_PFLT LWID_('P','F','L','T')
105 
106 /* surfaces */
107 #define ID_COLR LWID_('C','O','L','R')
108 #define ID_LUMI LWID_('L','U','M','I')
109 #define ID_DIFF LWID_('D','I','F','F')
110 #define ID_SPEC LWID_('S','P','E','C')
111 #define ID_GLOS LWID_('G','L','O','S')
112 #define ID_REFL LWID_('R','E','F','L')
113 #define ID_RFOP LWID_('R','F','O','P')
114 #define ID_RIMG LWID_('R','I','M','G')
115 #define ID_RSAN LWID_('R','S','A','N')
116 #define ID_TRAN LWID_('T','R','A','N')
117 #define ID_TROP LWID_('T','R','O','P')
118 #define ID_TIMG LWID_('T','I','M','G')
119 #define ID_RIND LWID_('R','I','N','D')
120 #define ID_TRNL LWID_('T','R','N','L')
121 #define ID_BUMP LWID_('B','U','M','P')
122 #define ID_SMAN LWID_('S','M','A','N')
123 #define ID_SIDE LWID_('S','I','D','E')
124 #define ID_CLRH LWID_('C','L','R','H')
125 #define ID_CLRF LWID_('C','L','R','F')
126 #define ID_ADTR LWID_('A','D','T','R')
127 #define ID_SHRP LWID_('S','H','R','P')
128 #define ID_LINE LWID_('L','I','N','E')
129 #define ID_LSIZ LWID_('L','S','I','Z')
130 #define ID_ALPH LWID_('A','L','P','H')
131 #define ID_AVAL LWID_('A','V','A','L')
132 #define ID_GVAL LWID_('G','V','A','L')
133 #define ID_BLOK LWID_('B','L','O','K')
134 
135 /* texture layer */
136 #define ID_TYPE LWID_('T','Y','P','E')
137 #define ID_CHAN LWID_('C','H','A','N')
138 #define ID_NAME LWID_('N','A','M','E')
139 #define ID_ENAB LWID_('E','N','A','B')
140 #define ID_OPAC LWID_('O','P','A','C')
141 #define ID_FLAG LWID_('F','L','A','G')
142 #define ID_PROJ LWID_('P','R','O','J')
143 #define ID_STCK LWID_('S','T','C','K')
144 #define ID_TAMP LWID_('T','A','M','P')
145 
146 /* texture coordinates */
147 #define ID_TMAP LWID_('T','M','A','P')
148 #define ID_AXIS LWID_('A','X','I','S')
149 #define ID_CNTR LWID_('C','N','T','R')
150 #define ID_SIZE LWID_('S','I','Z','E')
151 #define ID_ROTA LWID_('R','O','T','A')
152 #define ID_OREF LWID_('O','R','E','F')
153 #define ID_FALL LWID_('F','A','L','L')
154 #define ID_CSYS LWID_('C','S','Y','S')
155 
156 /* image map */
157 #define ID_IMAP LWID_('I','M','A','P')
158 #define ID_IMAG LWID_('I','M','A','G')
159 #define ID_WRAP LWID_('W','R','A','P')
160 #define ID_WRPW LWID_('W','R','P','W')
161 #define ID_WRPH LWID_('W','R','P','H')
162 #define ID_VMAP LWID_('V','M','A','P')
163 #define ID_AAST LWID_('A','A','S','T')
164 #define ID_PIXB LWID_('P','I','X','B')
165 
166 /* procedural */
167 #define ID_PROC LWID_('P','R','O','C')
168 #define ID_COLR LWID_('C','O','L','R')
169 #define ID_VALU LWID_('V','A','L','U')
170 #define ID_FUNC LWID_('F','U','N','C')
171 #define ID_FTPS LWID_('F','T','P','S')
172 #define ID_ITPS LWID_('I','T','P','S')
173 #define ID_ETPS LWID_('E','T','P','S')
174 
175 /* gradient */
176 #define ID_GRAD LWID_('G','R','A','D')
177 #define ID_GRST LWID_('G','R','S','T')
178 #define ID_GREN LWID_('G','R','E','N')
179 #define ID_PNAM LWID_('P','N','A','M')
180 #define ID_INAM LWID_('I','N','A','M')
181 #define ID_GRPT LWID_('G','R','P','T')
182 #define ID_FKEY LWID_('F','K','E','Y')
183 #define ID_IKEY LWID_('I','K','E','Y')
184 
185 /* shader */
186 #define ID_SHDR LWID_('S','H','D','R')
187 #define ID_DATA LWID_('D','A','T','A')
188 
189 
190 /* generic linked list */
191 
192 typedef struct st_lwNode {
193  struct st_lwNode *next, *prev;
194  void *data;
195 } lwNode;
196 
197 
198 /* plug-in reference */
199 
200 typedef struct st_lwPlugin {
201  struct st_lwPlugin *next, *prev;
202  char *ord;
203  char *name;
204  int flags;
205  void *data;
206 } lwPlugin;
207 
208 
209 /* envelopes */
210 
211 typedef struct st_lwKey {
212  struct st_lwKey *next, *prev;
213  float value;
214  float time;
215  unsigned int shape; /* ID_TCB, ID_BEZ2, etc. */
216  float tension;
217  float continuity;
218  float bias;
219  float param[ 4 ];
220 } lwKey;
221 
222 typedef struct st_lwEnvelope {
224  int index;
225  int type;
226  char *name;
227  lwKey *key; /* linked list of keys */
228  int nkeys;
229  int behavior[ 2 ]; /* pre and post (extrapolation) */
230  lwPlugin *cfilter; /* linked list of channel filters */
232 } lwEnvelope;
233 
234 #define BEH_RESET 0
235 #define BEH_CONSTANT 1
236 #define BEH_REPEAT 2
237 #define BEH_OSCILLATE 3
238 #define BEH_OFFSET 4
239 #define BEH_LINEAR 5
240 
241 
242 /* values that can be enveloped */
243 
244 typedef struct st_lwEParam {
245  float val;
246  int eindex;
247 } lwEParam;
248 
249 typedef struct st_lwVParam {
250  float val[ 3 ];
251  int eindex;
252 } lwVParam;
253 
254 
255 /* clips */
256 
257 typedef struct st_lwClipStill {
258  char *name;
259 } lwClipStill;
260 
261 typedef struct st_lwClipSeq {
262  char *prefix; /* filename before sequence digits */
263  char *suffix; /* after digits, e.g. extensions */
264  int digits;
265  int flags;
266  int offset;
267  int start;
268  int end;
269 } lwClipSeq;
270 
271 typedef struct st_lwClipAnim {
272  char *name;
273  char *server; /* anim loader plug-in */
274  void *data;
275 } lwClipAnim;
276 
277 typedef struct st_lwClipXRef {
278  char *string;
279  int index;
280  struct st_lwClip *clip;
281 } lwClipXRef;
282 
283 typedef struct st_lwClipCycle {
284  char *name;
285  int lo;
286  int hi;
287 } lwClipCycle;
288 
289 typedef struct st_lwClip {
290  struct st_lwClip *next, *prev;
291  int index;
292  unsigned int type; /* ID_STIL, ID_ISEQ, etc. */
293  union {
299  } source;
300  float start_time;
301  float duration;
302  float frame_rate;
308  int negative;
309  lwPlugin *ifilter; /* linked list of image filters */
311  lwPlugin *pfilter; /* linked list of pixel filters */
313 } lwClip;
314 
315 
316 /* textures */
317 
318 typedef struct st_lwTMap {
324  char *ref_object;
326 } lwTMap;
327 
328 typedef struct st_lwImageMap {
329  int cindex;
331  char *vmap_name;
332  int axis;
337  float aa_strength;
339  int pblend;
342 } lwImageMap;
343 
344 #define PROJ_PLANAR 0
345 #define PROJ_CYLINDRICAL 1
346 #define PROJ_SPHERICAL 2
347 #define PROJ_CUBIC 3
348 #define PROJ_FRONT 4
349 
350 #define WRAP_NONE 0
351 #define WRAP_EDGE 1
352 #define WRAP_REPEAT 2
353 #define WRAP_MIRROR 3
354 
355 typedef struct st_lwProcedural {
356  int axis;
357  float value[ 3 ];
358  char *name;
359  void *data;
360 } lwProcedural;
361 
362 typedef struct st_lwGradKey {
363  struct st_lwGradKey *next, *prev;
364  float value;
365  float rgba[ 4 ];
366 } lwGradKey;
367 
368 typedef struct st_lwGradient {
369  char *paramname;
370  char *itemname;
371  float start;
372  float end;
373  int repeat;
374  lwGradKey *key; /* array of gradient keys */
375  short *ikey; /* array of interpolation codes */
376 } lwGradient;
377 
378 typedef struct st_lwTexture {
379  struct st_lwTexture *next, *prev;
380  char *ord;
381  unsigned int type;
382  unsigned int chan;
384  short opac_type;
385  short enabled;
386  short negative;
387  short axis;
388  union {
392  } param;
394 } lwTexture;
395 
396 
397 /* values that can be textured */
398 
399 typedef struct st_lwTParam {
400  float val;
401  int eindex;
402  lwTexture *tex; /* linked list of texture layers */
403 } lwTParam;
404 
405 typedef struct st_lwCParam {
406  float rgb[ 3 ];
407  int eindex;
408  lwTexture *tex; /* linked list of texture layers */
409 } lwCParam;
410 
411 
412 /* surfaces */
413 
414 typedef struct st_lwGlow {
415  short enabled;
416  short type;
419 } Glow;
420 
421 typedef struct st_lwRMap {
423  int options;
424  int cindex;
425  float seam_angle;
426 } lwRMap;
427 
428 typedef struct st_lwLine {
429  short enabled;
430  unsigned short flags;
432 } lwLine;
433 
434 typedef struct st_lwSurface {
435  struct st_lwSurface *next, *prev;
436  char *name;
437  char *srcname;
448  float smooth;
450  float alpha;
458  lwPlugin *shader; /* linked list of shaders */
459  int nshaders;
460 } lwSurface;
461 
462 
463 /* vertex maps */
464 
465 typedef struct st_lwVMap {
466  struct st_lwVMap *next, *prev;
467  char *name;
468  unsigned int type;
469  int dim;
470  int nverts;
471  int perpoly;
472  int *vindex; /* array of point indexes */
473  int *pindex; /* array of polygon indexes */
474  float **val;
475 
476  // added by duffy
477  int offset;
478 } lwVMap;
479 
480 typedef struct st_lwVMapPt {
482  int index; /* vindex or pindex element */
483 } lwVMapPt;
484 
485 
486 /* points and polygons */
487 
488 typedef struct st_lwPoint {
489  float pos[ 3 ];
490  int npols; /* number of polygons sharing the point */
491  int *pol; /* array of polygon indexes */
492  int nvmaps;
493  lwVMapPt *vm; /* array of vmap references */
494 } lwPoint;
495 
496 typedef struct st_lwPolVert {
497  int index; /* index into the point array */
498  float norm[ 3 ];
499  int nvmaps;
500  lwVMapPt *vm; /* array of vmap references */
501 } lwPolVert;
502 
503 typedef struct st_lwPolygon {
505  int part; /* part index */
506  int smoothgrp; /* smoothing group */
507  int flags;
508  unsigned int type;
509  float norm[ 3 ];
510  int nverts;
511  lwPolVert *v; /* array of vertex records */
512 } lwPolygon;
513 
514 typedef struct st_lwPointList {
515  int count;
516  int offset; /* only used during reading */
517  lwPoint *pt; /* array of points */
518 } lwPointList;
519 
520 typedef struct st_lwPolygonList {
521  int count;
522  int offset; /* only used during reading */
523  int vcount; /* total number of vertices */
524  int voffset; /* only used during reading */
525  lwPolygon *pol; /* array of polygons */
526 } lwPolygonList;
527 
528 
529 /* geometry layers */
530 
531 typedef struct st_lwLayer {
532  struct st_lwLayer *next, *prev;
533  char *name;
534  int index;
535  int parent;
536  int flags;
537  float pivot[ 3 ];
538  float bbox[ 6 ];
541  int nvmaps;
542  lwVMap *vmap; /* linked list of vmaps */
543 } lwLayer;
544 
545 
546 /* tag strings */
547 
548 typedef struct st_lwTagList {
549  int count;
550  int offset; /* only used during reading */
551  char **tag; /* array of strings */
552 } lwTagList;
553 
554 
555 /* an object */
556 
557 typedef struct st_lwObject {
558  ID_TIME_T timeStamp;
559  lwLayer * layer; /* linked list of layers */
560  lwEnvelope * env; /* linked list of envelopes */
561  lwClip * clip; /* linked list of clips */
562  lwSurface * surf; /* linked list of surfaces */
564  int nlayers;
565  int nenvs;
566  int nclips;
567  int nsurfs;
568 } lwObject;
569 
570 
571 /* lwo2.c */
572 
573 lwObject *lwGetObject( const char *filename, unsigned int *failID, int *failpos );
574 void lwFreeObject( lwObject *object );
575 void lwFreeLayer( lwLayer *layer );
576 
577 /* pntspols.c */
578 
579 void lwFreePoints( lwPointList *point );
580 void lwFreePolygons( lwPolygonList *plist );
581 int lwGetPoints( idFile *fp, int cksize, lwPointList *point );
582 void lwGetBoundingBox( lwPointList *point, float bbox[] );
583 int lwAllocPolygons( lwPolygonList *plist, int npols, int nverts );
584 int lwGetPolygons( idFile *fp, int cksize, lwPolygonList *plist, int ptoffset );
585 void lwGetPolyNormals( lwPointList *point, lwPolygonList *polygon );
586 int lwGetPointPolygons( lwPointList *point, lwPolygonList *polygon );
587 int lwResolvePolySurfaces( lwPolygonList *polygon, lwTagList *tlist,
588  lwSurface **surf, int *nsurfs );
589 void lwGetVertNormals( lwPointList *point, lwPolygonList *polygon );
590 void lwFreeTags( lwTagList *tlist );
591 int lwGetTags( idFile *fp, int cksize, lwTagList *tlist );
592 int lwGetPolygonTags( idFile *fp, int cksize, lwTagList *tlist,
593  lwPolygonList *plist );
594 
595 /* vmap.c */
596 
597 void lwFreeVMap( lwVMap *vmap );
598 lwVMap *lwGetVMap( idFile *fp, int cksize, int ptoffset, int poloffset,
599  int perpoly );
600 int lwGetPointVMaps( lwPointList *point, lwVMap *vmap );
601 int lwGetPolyVMaps( lwPolygonList *polygon, lwVMap *vmap );
602 
603 /* clip.c */
604 
605 void lwFreeClip( lwClip *clip );
606 lwClip *lwGetClip( idFile *fp, int cksize );
607 lwClip *lwFindClip( lwClip *list, int index );
608 
609 /* envelope.c */
610 
611 void lwFreeEnvelope( lwEnvelope *env );
612 lwEnvelope *lwGetEnvelope( idFile *fp, int cksize );
614 float lwEvalEnvelope( lwEnvelope *env, float time );
615 
616 /* surface.c */
617 
618 void lwFreePlugin( lwPlugin *p );
619 void lwFreeTexture( lwTexture *t );
620 void lwFreeSurface( lwSurface *surf );
621 int lwGetTHeader( idFile *fp, int hsz, lwTexture *tex );
622 int lwGetTMap( idFile *fp, int tmapsz, lwTMap *tmap );
623 int lwGetImageMap( idFile *fp, int rsz, lwTexture *tex );
624 int lwGetProcedural( idFile *fp, int rsz, lwTexture *tex );
625 int lwGetGradient( idFile *fp, int rsz, lwTexture *tex );
626 lwTexture *lwGetTexture( idFile *fp, int bloksz, unsigned int type );
627 lwPlugin *lwGetShader( idFile *fp, int bloksz );
628 lwSurface *lwGetSurface( idFile *fp, int cksize );
629 lwSurface *lwDefaultSurface( void );
630 
631 /* lwob.c */
632 
633 lwSurface *lwGetSurface5( idFile *fp, int cksize, lwObject *obj );
634 int lwGetPolygons5( idFile *fp, int cksize, lwPolygonList *plist, int ptoffset );
635 lwObject *lwGetObject5( const char *filename, unsigned int *failID, int *failpos );
636 
637 /* list.c */
638 
639 void lwListFree( void *list, void ( *freeNode )( void * ));
640 void lwListAdd( void **list, void *node );
641 void lwListInsert( void **vlist, void *vitem,
642  int ( *compare )( void *, void * ));
643 
644 /* vecmath.c */
645 
646 float dot( float a[], float b[] );
647 void cross( float a[], float b[], float c[] );
648 void normalize( float v[] );
649 #define vecangle( a, b ) ( float ) idMath::ACos( dot( a, b ) )
650 
651 /* lwio.c */
652 
653 void set_flen( int i );
654 int get_flen( void );
655 void *getbytes( idFile *fp, int size );
656 void skipbytes( idFile *fp, int n );
657 int getI1( idFile *fp );
658 short getI2( idFile *fp );
659 int getI4( idFile *fp );
660 unsigned char getU1( idFile *fp );
661 unsigned short getU2( idFile *fp );
662 unsigned int getU4( idFile *fp );
663 int getVX( idFile *fp );
664 float getF4( idFile *fp );
665 char *getS0( idFile *fp );
666 int sgetI1( unsigned char **bp );
667 short sgetI2( unsigned char **bp );
668 int sgetI4( unsigned char **bp );
669 unsigned char sgetU1( unsigned char **bp );
670 unsigned short sgetU2( unsigned char **bp );
671 unsigned int sgetU4( unsigned char **bp );
672 int sgetVX( unsigned char **bp );
673 float sgetF4( unsigned char **bp );
674 char *sgetS0( unsigned char **bp );
675 
676 #endif /* !__LWO2_H__ */
struct st_lwSurface * next
Definition: Model_lwo.h:435
int lwGetGradient(idFile *fp, int rsz, lwTexture *tex)
Definition: Model_lwo.cpp:3340
lwEnvelope * lwFindEnvelope(lwEnvelope *list, int index)
Definition: Model_lwo.cpp:481
lwTParam bump
Definition: Model_lwo.h:447
int offset
Definition: Model_lwo.h:477
lwEParam brightness
Definition: Model_lwo.h:304
lwTexture * lwGetTexture(idFile *fp, int bloksz, unsigned int type)
Definition: Model_lwo.cpp:3438
char * ref_object
Definition: Model_lwo.h:324
GLsizei const GLfloat * value
Definition: glext.h:3614
char * ord
Definition: Model_lwo.h:380
int lwGetPoints(idFile *fp, int cksize, lwPointList *point)
Definition: Model_lwo.cpp:2402
unsigned short sgetU2(unsigned char **bp)
Definition: Model_lwo.cpp:1294
void set_flen(int i)
Definition: Model_lwo.cpp:1002
int lwGetTMap(idFile *fp, int tmapsz, lwTMap *tmap)
Definition: Model_lwo.cpp:3068
void lwGetPolyNormals(lwPointList *point, lwPolygonList *polygon)
Definition: Model_lwo.cpp:2599
unsigned short flags
Definition: Model_lwo.h:430
lwRMap transparency
Definition: Model_lwo.h:444
lwCParam color
Definition: Model_lwo.h:438
int getVX(idFile *fp)
Definition: Model_lwo.cpp:1134
unsigned char sgetU1(unsigned char **bp)
Definition: Model_lwo.cpp:1282
lwSurface * surf
Definition: Model_lwo.h:504
lwEParam dif_sharp
Definition: Model_lwo.h:455
struct st_lwClipCycle lwClipCycle
lwEParam stck
Definition: Model_lwo.h:340
void lwFreeTags(lwTagList *tlist)
Definition: Model_lwo.cpp:2773
short axis
Definition: Model_lwo.h:387
lwClipCycle cycle
Definition: Model_lwo.h:298
int get_flen(void)
Definition: Model_lwo.cpp:1004
char * name
Definition: Model_lwo.h:203
lwObject * lwGetObject5(const char *filename, unsigned int *failID, int *failpos)
Definition: Model_lwo.cpp:2219
void skipbytes(idFile *fp, int n)
Definition: Model_lwo.cpp:1031
struct st_lwEnvelope lwEnvelope
void lwFreeTexture(lwTexture *t)
Definition: Model_lwo.cpp:2914
lwTParam luminosity
Definition: Model_lwo.h:439
const GLdouble * v
Definition: glext.h:2936
void lwFreeClip(lwClip *clip)
Definition: Model_lwo.cpp:49
short type
Definition: Model_lwo.h:416
struct st_lwVMapPt lwVMapPt
struct st_lwKey lwKey
lwVParam falloff
Definition: Model_lwo.h:322
int negative
Definition: Model_lwo.h:308
char * srcname
Definition: Model_lwo.h:437
lwEParam saturation
Definition: Model_lwo.h:305
struct st_lwPolygonList lwPolygonList
struct st_lwTagList lwTagList
void lwFreeSurface(lwSurface *surf)
Definition: Model_lwo.cpp:2944
float getF4(idFile *fp)
Definition: Model_lwo.cpp:1178
struct st_lwImageMap lwImageMap
lwKey * key
Definition: Model_lwo.h:227
float value
Definition: Model_lwo.h:213
char * name
Definition: Model_lwo.h:533
void lwListFree(void *list, void(*freeNode)(void *))
Definition: Model_lwo.cpp:905
struct st_lwClip lwClip
lwClipXRef xref
Definition: Model_lwo.h:297
lwGradient grad
Definition: Model_lwo.h:391
lwVMap * vmap
Definition: Model_lwo.h:542
GLfloat param
Definition: glext.h:3038
GLenum GLsizei n
Definition: glext.h:3705
lwPlugin * shader
Definition: Model_lwo.h:458
struct st_lwGradKey * next
Definition: Model_lwo.h:363
struct st_lwGlow Glow
short negative
Definition: Model_lwo.h:386
int lwGetPolygons(idFile *fp, int cksize, lwPolygonList *plist, int ptoffset)
Definition: Model_lwo.cpp:2522
lwPolVert * v
Definition: Model_lwo.h:511
void cross(float a[], float b[], float c[])
Definition: Model_lwo.cpp:3889
lwEParam size
Definition: Model_lwo.h:418
struct st_lwClipSeq lwClipSeq
float smooth
Definition: Model_lwo.h:448
lwVMapPt * vm
Definition: Model_lwo.h:493
union st_lwClip::@92 source
int lwGetPointVMaps(lwPointList *point, lwVMap *vmap)
Definition: Model_lwo.cpp:4028
struct st_lwEnvelope * prev
Definition: Model_lwo.h:223
float val[3]
Definition: Model_lwo.h:250
lwVMap * vmap
Definition: Model_lwo.h:481
struct st_lwClipXRef lwClipXRef
unsigned int type
Definition: Model_lwo.h:508
float val
Definition: Model_lwo.h:400
char * itemname
Definition: Model_lwo.h:370
void lwGetBoundingBox(lwPointList *point, float bbox[])
Definition: Model_lwo.cpp:2450
struct st_lwPlugin * next
Definition: Model_lwo.h:201
lwTParam eta
Definition: Model_lwo.h:445
struct st_lwLayer * next
Definition: Model_lwo.h:532
lwEParam contrast
Definition: Model_lwo.h:303
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
lwEnvelope * env
Definition: Model_lwo.h:560
int getI4(idFile *fp)
Definition: Model_lwo.cpp:1073
lwClip * clip
Definition: Model_lwo.h:561
lwPoint * pt
Definition: Model_lwo.h:517
int nvmaps
Definition: Model_lwo.h:541
lwPlugin * lwGetShader(idFile *fp, int bloksz)
Definition: Model_lwo.cpp:3486
struct st_lwClip * next
Definition: Model_lwo.h:290
struct st_lwPlugin * prev
Definition: Model_lwo.h:201
GLhandleARB obj
Definition: glext.h:3602
struct st_lwCParam lwCParam
lwEParam wraph
Definition: Model_lwo.h:336
lwTParam val
Definition: Model_lwo.h:422
lwGradKey * key
Definition: Model_lwo.h:374
lwEParam glow
Definition: Model_lwo.h:456
int i
Definition: process.py:33
char * name
Definition: Model_lwo.h:272
struct st_lwPlugin lwPlugin
struct st_lwClip * prev
Definition: Model_lwo.h:290
struct st_lwLayer * prev
Definition: Model_lwo.h:532
lwVParam rotate
Definition: Model_lwo.h:321
lwClipStill still
Definition: Model_lwo.h:294
int sgetI4(unsigned char **bp)
Definition: Model_lwo.cpp:1269
struct st_lwTexture * next
Definition: Model_lwo.h:379
unsigned short getU2(idFile *fp)
Definition: Model_lwo.cpp:1104
unsigned int type
Definition: Model_lwo.h:381
struct st_lwNode * next
Definition: Model_lwo.h:193
int index
Definition: Model_lwo.h:291
struct st_lwKey * prev
Definition: Model_lwo.h:212
lwPointList point
Definition: Model_lwo.h:539
int options
Definition: Model_lwo.h:423
struct st_lwSurface * prev
Definition: Model_lwo.h:435
lwEParam wrapw
Definition: Model_lwo.h:335
lwTexture * tex
Definition: Model_lwo.h:408
lwEParam color_filter
Definition: Model_lwo.h:453
float duration
Definition: Model_lwo.h:301
lwTParam specularity
Definition: Model_lwo.h:441
struct st_lwVParam lwVParam
int lwGetPolyVMaps(lwPolygonList *polygon, lwVMap *vmap)
Definition: Model_lwo.cpp:4080
lwPlugin * ifilter
Definition: Model_lwo.h:309
lwTParam translucency
Definition: Model_lwo.h:446
Definition: File.h:50
lwPolygon * pol
Definition: Model_lwo.h:525
int fall_type
Definition: Model_lwo.h:323
struct st_lwVMap * prev
Definition: Model_lwo.h:466
int cindex
Definition: Model_lwo.h:424
void * data
Definition: Model_lwo.h:205
float val
Definition: Model_lwo.h:245
float bias
Definition: Model_lwo.h:218
void lwListAdd(void **list, void *node)
Definition: Model_lwo.cpp:925
int lwGetPolygonTags(idFile *fp, int cksize, lwTagList *tlist, lwPolygonList *plist)
Definition: Model_lwo.cpp:2857
int getI1(idFile *fp)
Definition: Model_lwo.cpp:1041
struct st_lwPointList lwPointList
GLuint index
Definition: glext.h:3476
const GLubyte * c
Definition: glext.h:4677
int coord_sys
Definition: Model_lwo.h:325
char ** tag
Definition: Model_lwo.h:551
void lwFreeLayer(lwLayer *layer)
Definition: Model_lwo.cpp:1392
struct st_lwRMap lwRMap
char * ord
Definition: Model_lwo.h:202
struct st_lwPoint lwPoint
void lwListInsert(void **vlist, void *vitem, int(*compare)(void *, void *))
Definition: Model_lwo.cpp:950
int lwGetImageMap(idFile *fp, int rsz, lwTexture *tex)
Definition: Model_lwo.cpp:3156
int lwAllocPolygons(lwPolygonList *plist, int npols, int nverts)
Definition: Model_lwo.cpp:2479
void normalize(float v[])
Definition: Model_lwo.cpp:3897
struct st_lwNode * prev
Definition: Model_lwo.h:193
short getI2(idFile *fp)
Definition: Model_lwo.cpp:1058
struct st_lwClipAnim lwClipAnim
lwEParam amplitude
Definition: Model_lwo.h:341
struct st_lwEParam lwEParam
lwEParam hue
Definition: Model_lwo.h:306
lwLayer * layer
Definition: Model_lwo.h:559
struct st_lwTexture * prev
Definition: Model_lwo.h:379
int lwGetPolygons5(idFile *fp, int cksize, lwPolygonList *plist, int ptoffset)
Definition: Model_lwo.cpp:2128
struct st_lwEnvelope * next
Definition: Model_lwo.h:223
float lwEvalEnvelope(lwEnvelope *env, float time)
char * string
Definition: Model_lwo.h:278
lwPolygonList polygon
Definition: Model_lwo.h:540
lwEParam color_hilite
Definition: Model_lwo.h:452
lwEParam size
Definition: Model_lwo.h:431
int sgetI1(unsigned char **bp)
Definition: Model_lwo.cpp:1243
float rgba[4]
Definition: Model_lwo.h:365
int lwGetTHeader(idFile *fp, int hsz, lwTexture *tex)
Definition: Model_lwo.cpp:2977
struct st_lwGradKey * prev
Definition: Model_lwo.h:363
lwEParam opacity
Definition: Model_lwo.h:383
struct st_lwTMap lwTMap
char * sgetS0(unsigned char **bp)
Definition: Model_lwo.cpp:1358
int perpoly
Definition: Model_lwo.h:471
void lwFreeEnvelope(lwEnvelope *env)
Definition: Model_lwo.cpp:314
struct st_lwPolVert lwPolVert
struct st_lwClip * clip
Definition: Model_lwo.h:280
lwProcedural proc
Definition: Model_lwo.h:390
lwTagList taglist
Definition: Model_lwo.h:563
ID_TIME_T timeStamp
Definition: Model_lwo.h:558
void lwFreePlugin(lwPlugin *p)
Definition: Model_lwo.cpp:2896
unsigned int type
Definition: Model_lwo.h:292
GLubyte GLubyte GLubyte a
Definition: glext.h:4662
lwClipSeq seq
Definition: Model_lwo.h:295
unsigned char getU1(idFile *fp)
Definition: Model_lwo.cpp:1088
short enabled
Definition: Model_lwo.h:415
lwClipAnim anim
Definition: Model_lwo.h:296
int * vindex
Definition: Model_lwo.h:472
float frame_rate
Definition: Model_lwo.h:302
lwObject * lwGetObject(const char *filename, unsigned int *failID, int *failpos)
Definition: Model_lwo.cpp:1445
float rgb[3]
Definition: Model_lwo.h:406
char * getS0(idFile *fp)
Definition: Model_lwo.cpp:1197
lwPlugin * cfilter
Definition: Model_lwo.h:230
GLubyte GLubyte b
Definition: glext.h:4662
struct st_lwPolygon lwPolygon
int nvmaps
Definition: Model_lwo.h:492
struct st_lwVMap lwVMap
lwTMap tmap
Definition: Model_lwo.h:393
void * getbytes(idFile *fp, int size)
Definition: Model_lwo.cpp:1006
lwVMapPt * vm
Definition: Model_lwo.h:500
struct st_lwLayer lwLayer
struct st_lwSurface lwSurface
char * name
Definition: Model_lwo.h:226
lwRMap reflection
Definition: Model_lwo.h:443
int lwResolvePolySurfaces(lwPolygonList *polygon, lwTagList *tlist, lwSurface **surf, int *nsurfs)
Definition: Model_lwo.cpp:2676
float continuity
Definition: Model_lwo.h:217
lwSurface * surf
Definition: Model_lwo.h:562
char * server
Definition: Model_lwo.h:273
float ** val
Definition: Model_lwo.h:474
struct st_lwLine lwLine
lwEnvelope * lwGetEnvelope(idFile *fp, int cksize)
Definition: Model_lwo.cpp:338
struct st_lwKey * next
Definition: Model_lwo.h:212
unsigned int type
Definition: Model_lwo.h:468
Definition: quaddefs.h:113
unsigned int shape
Definition: Model_lwo.h:215
void lwFreeVMap(lwVMap *vmap)
Definition: Model_lwo.cpp:3916
GLsizeiptr size
Definition: glext.h:3112
int alpha_mode
Definition: Model_lwo.h:451
int nverts
Definition: Model_lwo.h:470
float start_time
Definition: Model_lwo.h:300
int behavior[2]
Definition: Model_lwo.h:229
lwEParam add_trans
Definition: Model_lwo.h:454
int * pindex
Definition: Model_lwo.h:473
void * data
Definition: Model_lwo.h:274
struct st_lwTexture lwTexture
lwSurface * lwGetSurface5(idFile *fp, int cksize, lwObject *obj)
Definition: Model_lwo.cpp:1821
void * data
Definition: Model_lwo.h:194
void lwFreePoints(lwPointList *point)
Definition: Model_lwo.cpp:2348
lwTParam glossiness
Definition: Model_lwo.h:442
float bbox[6]
Definition: Model_lwo.h:538
struct st_lwGradient lwGradient
struct st_lwProcedural lwProcedural
struct st_lwNode lwNode
char * vmap_name
Definition: Model_lwo.h:331
short * ikey
Definition: Model_lwo.h:375
char * name
Definition: Model_lwo.h:467
struct st_lwTParam lwTParam
int lwGetProcedural(idFile *fp, int rsz, lwTexture *tex)
Definition: Model_lwo.cpp:3265
void lwFreeObject(lwObject *object)
Definition: Model_lwo.cpp:1411
short enabled
Definition: Model_lwo.h:429
char * paramname
Definition: Model_lwo.h:369
lwEParam gamma
Definition: Model_lwo.h:307
float aa_strength
Definition: Model_lwo.h:337
int lwGetTags(idFile *fp, int cksize, lwTagList *tlist)
Definition: Model_lwo.cpp:2798
struct st_lwClipStill lwClipStill
char * prefix
Definition: Model_lwo.h:262
float pos[3]
Definition: Model_lwo.h:489
float tension
Definition: Model_lwo.h:216
float dot(float a[], float b[])
Definition: Model_lwo.cpp:3883
short opac_type
Definition: Model_lwo.h:384
short enabled
Definition: Model_lwo.h:385
union st_lwTexture::@93 param
int npfilters
Definition: Model_lwo.h:312
lwPlugin * pfilter
Definition: Model_lwo.h:311
struct st_lwObject lwObject
int nifilters
Definition: Model_lwo.h:310
lwSurface * lwDefaultSurface(void)
Definition: Model_lwo.cpp:3628
int lwGetPointPolygons(lwPointList *point, lwPolygonList *polygon)
Definition: Model_lwo.cpp:2634
struct st_lwVMap * next
Definition: Model_lwo.h:466
lwVParam center
Definition: Model_lwo.h:320
lwImageMap imap
Definition: Model_lwo.h:389
float time
Definition: Model_lwo.h:214
float pivot[3]
Definition: Model_lwo.h:537
GLfloat GLfloat p
Definition: glext.h:4674
void lwGetVertNormals(lwPointList *point, lwPolygonList *polygon)
Definition: Model_lwo.cpp:2733
lwTParam diffuse
Definition: Model_lwo.h:440
int sgetVX(unsigned char **bp)
Definition: Model_lwo.cpp:1320
short sgetI2(unsigned char **bp)
Definition: Model_lwo.cpp:1256
char * suffix
Definition: Model_lwo.h:263
lwTexture * tex
Definition: Model_lwo.h:402
unsigned int sgetU4(unsigned char **bp)
Definition: Model_lwo.cpp:1307
int * pol
Definition: Model_lwo.h:491
unsigned int chan
Definition: Model_lwo.h:382
float value
Definition: Model_lwo.h:364
lwSurface * lwGetSurface(idFile *fp, int cksize)
Definition: Model_lwo.cpp:3655
float alpha
Definition: Model_lwo.h:450
struct st_lwGradKey lwGradKey
int parent
Definition: Model_lwo.h:535
lwClip * lwFindClip(lwClip *list, int index)
Definition: Model_lwo.cpp:290
float sgetF4(unsigned char **bp)
Definition: Model_lwo.cpp:1341
lwEParam intensity
Definition: Model_lwo.h:417
void lwFreePolygons(lwPolygonList *plist)
Definition: Model_lwo.cpp:2372
lwVParam size
Definition: Model_lwo.h:319
unsigned int getU4(idFile *fp)
Definition: Model_lwo.cpp:1119
lwLine line
Definition: Model_lwo.h:457
lwVMap * lwGetVMap(idFile *fp, int cksize, int ptoffset, int poloffset, int perpoly)
Definition: Model_lwo.cpp:3938
char * name
Definition: Model_lwo.h:436
float seam_angle
Definition: Model_lwo.h:425
GLdouble GLdouble t
Definition: glext.h:2943
lwClip * lwGetClip(idFile *fp, int cksize)
Definition: Model_lwo.cpp:90