29 #include "../idlib/precompiled.h"
54 switch( clip->
type ) {
102 if ( !clip )
goto Fail;
127 switch ( clip->
type ) {
167 if ( rlen < 0 || rlen > sz )
goto Fail;
176 rlen = fp->
Tell() - pos;
177 if ( cksize < rlen )
goto Fail;
178 if ( cksize == rlen )
230 if ( !filt )
goto Fail;
254 if ( rlen < 0 || rlen > sz )
goto Fail;
263 rlen = fp->
Tell() - pos;
264 if ( cksize < rlen )
goto Fail;
265 if ( cksize == rlen )
break;
296 if ( clip->
index == index )
break;
325 static int compare_keys(
lwKey *k1,
lwKey *k2 )
346 int i, nparams, pos, rlen;
352 if ( !env )
goto Fail;
394 if ( !key )
goto Fail;
402 if ( !key )
goto Fail;
405 nparams = ( sz - 4 ) / 4;
406 if ( nparams > 4 ) nparams = 4;
407 for ( i = 0; i < nparams; i++ )
408 f[ i ] =
getF4( fp );
410 switch ( key->
shape ) {
420 for ( i = 0; i < nparams; i++ )
421 key->
param[ i ] = f[ i ];
428 if ( !plug )
goto Fail;
445 if ( rlen < 0 || rlen > sz )
goto Fail;
454 rlen = fp->
Tell() - pos;
455 if ( cksize < rlen )
goto Fail;
456 if ( cksize == rlen )
break;
487 if ( env->
index == index )
break;
507 static float range(
float v,
float lo,
float hi,
int *
i )
509 float v2,
r = hi - lo;
516 v2 = lo + v - r * (
float ) floor((
double ) v / r );
517 if ( i ) *i = -(
int )(( v2 - v ) / r + ( v2 > v ? 0.5 : -0.5 ));
530 static
void hermite(
float t,
float *h1,
float *h2,
float *h3,
float *h4 )
537 *h2 = 3.0f * t2 - t3 - t3;
551 static float bezier(
float x0,
float x1,
float x2,
float x3,
float t )
553 float a,
b,
c, t2, t3;
558 c = 3.0f * ( x1 - x0 );
559 b = 3.0f * ( x2 - x1 ) - c;
562 return a * t3 + b * t2 + c * t + x0;
576 static float bez2_time(
float x0,
float x1,
float x2,
float x3,
float time,
577 float *t0,
float *t1 )
581 t = *t0 + ( *t1 - *t0 ) * 0.5
f;
582 v = bezier( x0, x1, x2, x3, t );
588 return bez2_time( x0, x1, x2, x3, time, t0, t1 );
602 static float bez2(
lwKey *key0,
lwKey *key1,
float time )
604 float x,
y,
t, t0 = 0.0f, t1 = 1.0f;
632 static float outgoing(
lwKey *key0,
lwKey *key1 )
634 float a,
b, d,
t, out;
636 switch ( key0->
shape )
641 * ( 1.0f + key0->
bias );
644 * ( 1.0f - key0->
bias );
667 out = key0->
param[ 1 ];
675 out /= key0->
param[ 2 ];
698 static float incoming(
lwKey *key0,
lwKey *key1 )
700 float a,
b, d,
t,
in;
702 switch ( key1->
shape )
717 * ( 1.0f + key1->
bias );
720 * ( 1.0f - key1->
bias );
733 in = key1->
param[ 0 ];
742 in /= key1->
param[ 0 ];
767 lwKey *key0, *key1, *skey, *ekey;
768 float t, h1, h2, h3, h4,
in, out,
offset = 0.0f;
774 if ( env->
nkeys == 0 )
return 0.0f;
778 if ( env->
nkeys == 1 )
783 skey = ekey = env->
key;
784 while ( ekey->
next ) ekey = ekey->
next;
788 if ( time < skey->time ) {
804 time = ekey->
time - skey->
time - time;
809 offset = noff * ( ekey->
value - skey->
value );
813 out = outgoing( skey, skey->
next )
815 return out * ( time - skey->
time ) + skey->
value;
821 else if ( time > ekey->
time ) {
837 time = ekey->
time - skey->
time - time;
842 offset = noff * ( ekey->
value - skey->
value );
846 in = incoming( ekey->
prev, ekey )
848 return in * ( time - ekey->
time ) + ekey->
value;
861 if ( time == key0->
time )
863 else if ( time == key1->
time )
868 t = ( time - key0->
time ) / ( key1->
time - key0->
time );
872 switch ( key1->
shape )
877 out = outgoing( key0, key1 );
878 in = incoming( key0, key1 );
879 hermite( t, &h1, &h2, &h3, &h4 );
883 return bez2( key0, key1, time ) +
offset;
929 head = *((
lwNode ** ) list );
950 void lwListInsert(
void **vlist,
void *vitem,
int ( *compare )(
void *,
void * ))
952 lwNode **list, *item, *node, *prev;
959 list = (
lwNode ** ) vlist;
960 item = (
lwNode * ) vitem;
965 if ( 0 < compare( node, item ))
break;
998 #define FLEN_ERROR -9999
1020 if ( size != fp->
Read( data, size ) ) {
1047 i = fp->
Read(&c, 1);
1052 if ( c > 127 ) c -= 256;
1063 if ( 2 != fp->
Read( &i, 2 )) {
1078 if ( 4 != fp->
Read( &i, 4 )) {
1094 i = fp->
Read(&c, 1);
1109 if ( 2 != fp->
Read( &i, 2 )) {
1124 if ( 4 != fp->
Read( &i, 4 )) {
1142 if (fp->
Read(&c, 1) == -1) {
1149 if (fp->
Read(&c, 1) == -1) {
1157 if (fp->
Read(&c, 1) == -1) {
1162 if (fp->
Read(&c, 1) == -1) {
1167 if (fp->
Read(&c, 1) == -1) {
1183 if ( 4 != fp->
Read( &f, 4 ) ) {
1205 for ( i = 1; ; i++ ) {
1207 if (fp->
Read(&c, 1) == -1) {
1211 if ( c == 0 )
break;
1222 len = i + ( i & 1 );
1233 if ( len != fp->
Read( s, len )) {
1249 if ( i > 127 ) i -= 256;
1261 memcpy( &i, *bp, 2 );
1274 memcpy( &i, *bp, 4 );
1296 unsigned char *buf = *bp;
1300 i = ( buf[ 0 ] << 8 ) | buf[ 1 ];
1312 memcpy( &i, *bp, 4 );
1322 unsigned char *buf = *bp;
1327 if ( buf[ 0 ] != 0xFF ) {
1328 i = buf[ 0 ] << 8 | buf[ 1 ];
1333 i = ( buf[ 1 ] << 16 ) | ( buf[ 2 ] << 8 ) | buf[ 3 ];
1346 memcpy( &f, *bp, 4 );
1361 unsigned char *buf = *bp;
1366 len = strlen( (
const char*)buf ) + 1;
1379 memcpy( s, buf, len );
1451 int id, formsize,
type, cksize;
1463 formsize =
getU4( fp );
1474 if ( failpos ) *failpos = 12;
1483 if ( failpos ) *failpos = 12;
1491 if ( !
object )
goto Fail;
1494 if ( !layer )
goto Fail;
1495 object->layer = layer;
1502 cksize =
getU4( fp );
1508 cksize += cksize & 1;
1515 if ( !layer )
goto Fail;
1529 if ( rlen < 0 || rlen > cksize )
goto Fail;
1530 if ( rlen <= cksize - 2 )
1533 if ( rlen < cksize )
1552 if ( !node )
goto Fail;
1565 for ( i = 0; i < 6; i++ )
1568 if ( rlen < 0 || rlen > cksize )
goto Fail;
1569 if ( rlen < cksize )
1580 if ( !node )
goto Fail;
1587 if ( !node )
goto Fail;
1594 if ( !node )
goto Fail;
1609 if ( formsize <= fp->Tell() - 8 )
break;
1615 cksize =
getU4( fp );
1623 object->nlayers = 1;
1625 layer =
object->layer;
1635 layer = layer->
next;
1641 if ( failID ) *failID =
id;
1643 if ( failpos ) *failpos = fp->
Tell();
1655 #define ID_SRFS LWID_('S','R','F','S')
1656 #define ID_FLAG LWID_('F','L','A','G')
1657 #define ID_VLUM LWID_('V','L','U','M')
1658 #define ID_VDIF LWID_('V','D','I','F')
1659 #define ID_VSPC LWID_('V','S','P','C')
1660 #define ID_RFLT LWID_('R','F','L','T')
1661 #define ID_BTEX LWID_('B','T','E','X')
1662 #define ID_CTEX LWID_('C','T','E','X')
1663 #define ID_DTEX LWID_('D','T','E','X')
1664 #define ID_LTEX LWID_('L','T','E','X')
1665 #define ID_RTEX LWID_('R','T','E','X')
1666 #define ID_STEX LWID_('S','T','E','X')
1667 #define ID_TTEX LWID_('T','T','E','X')
1668 #define ID_TFLG LWID_('T','F','L','G')
1669 #define ID_TSIZ LWID_('T','S','I','Z')
1670 #define ID_TCTR LWID_('T','C','T','R')
1671 #define ID_TFAL LWID_('T','F','A','L')
1672 #define ID_TVEL LWID_('T','V','E','L')
1673 #define ID_TCLR LWID_('T','C','L','R')
1674 #define ID_TVAL LWID_('T','V','A','L')
1675 #define ID_TAMP LWID_('T','A','M','P')
1676 #define ID_TIMG LWID_('T','I','M','G')
1677 #define ID_TAAS LWID_('T','A','A','S')
1678 #define ID_TREF LWID_('T','R','E','F')
1679 #define ID_TOPC LWID_('T','O','P','C')
1680 #define ID_SDAT LWID_('S','D','A','T')
1681 #define ID_TFP0 LWID_('T','F','P','0')
1682 #define ID_TFP1 LWID_('T','F','P','1')
1693 static int add_clip(
char *
s,
lwClip **clist,
int *nclips )
1699 if ( !clip )
return 0;
1706 if ( p = strstr( s,
"(sequence)" )) {
1718 clip->
index = *nclips;
1734 static int add_tvel(
float pos[],
float vel[],
lwEnvelope **elist,
int *nenvs )
1740 for ( i = 0; i < 3; i++ ) {
1744 if ( !env || !key0 || !key1 )
return 0;
1750 key1->
value = pos[
i ] + vel[
i ] * 30.0f;
1754 env->
index = *nenvs + i + 1;
1755 env->
type = 0x0301 +
i;
1758 strcpy( env->
name,
"Position.X" );
1759 env->
name[ 9 ] +=
i;
1770 return env->
index - 2;
1786 if ( !tex )
return NULL;
1794 if ( strstr( s,
"Image Map" )) {
1828 unsigned int id, flags;
1836 if ( !surf )
goto Fail;
1878 flags =
getU2( fp );
1879 if ( flags & 4 ) surf->
smooth = 1.56207f;
1947 tex = get_texture( s );
1953 tex = get_texture( s );
1959 tex = get_texture( s );
1965 tex = get_texture( s );
1971 tex = get_texture( s );
1977 tex = get_texture( s );
1983 tex = get_texture( s );
1988 flags =
getU2( fp );
1990 if ( flags & 1 ) i = 0;
1991 if ( flags & 2 ) i = 1;
1992 if ( flags & 4 ) i = 2;
2000 if ( flags & 16 ) tex->
negative = 1;
2009 for ( i = 0; i < 3; i++ )
2014 for ( i = 0; i < 3; i++ )
2019 for ( i = 0; i < 3; i++ )
2024 for ( i = 0; i < 3; i++ )
2025 v[ i ] =
getF4( fp );
2032 for ( i = 0; i < 3; i++ )
2075 if ( !shdr )
goto Fail;
2092 if ( rlen < 0 || rlen > sz )
goto Fail;
2101 if ( cksize <= fp->Tell() - pos )
2132 unsigned char *buf, *bp;
2133 int i,
j, nv, nverts, npols;
2136 if ( cksize == 0 )
return 1;
2141 buf = (
unsigned char*)
getbytes( fp, cksize );
2142 if ( !buf )
goto Fail;
2150 while ( bp < buf + cksize ) {
2156 if ( i < 0 ) bp += 2;
2168 for ( i = 0; i < npols; i++ ) {
2173 if ( !pp->
v ) pp->
v = pv;
2174 for ( j = 0; j < nv; j++ )
2225 int id, formsize,
type, cksize;
2241 formsize =
getU4( fp );
2252 if ( failpos ) *failpos = 12;
2259 if ( !
object )
goto Fail2;
2262 if ( !layer )
goto Fail2;
2263 object->layer = layer;
2264 object->nlayers = 1;
2269 cksize =
getU4( fp );
2275 cksize += cksize & 1;
2297 if ( !node )
goto Fail2;
2309 if ( formsize <= fp->Tell() - 8 )
break;
2315 cksize =
getU4( fp );
2326 &object->
surf, &object->
nsurfs ))
goto Fail2;
2332 if ( failID ) *failID =
id;
2334 if ( failpos ) *failpos = fp->
Tell();
2354 for ( i = 0; i < point->
count; i++ ) {
2378 for ( i = 0; i < plist->
count; i++ ) {
2379 if ( plist->
pol[ i ].
v ) {
2380 for ( j = 0; j < plist->
pol[
i ].
nverts; j++ )
2381 if ( plist->
pol[ i ].
v[ j ].
vm )
2385 if ( plist->
pol[ 0 ].
v )
2407 if ( cksize == 1 )
return 1;
2416 if ( !point->
pt )
return 0;
2425 f = (
float * )
getbytes( fp, cksize );
2431 for ( i = 0, j = 0; i < np; i++, j += 3 ) {
2432 point->
pt[
i ].
pos[ 0 ] = f[
j ];
2433 point->
pt[
i ].
pos[ 1 ] = f[ j + 1 ];
2434 point->
pt[
i ].
pos[ 2 ] = f[ j + 2 ];
2454 if ( point->
count == 0 )
return;
2456 for ( i = 0; i < 6; i++ )
2457 if ( bbox[ i ] != 0.0
f )
return;
2459 bbox[ 0 ] = bbox[ 1 ] = bbox[ 2 ] = 1e20f;
2460 bbox[ 3 ] = bbox[ 4 ] = bbox[ 5 ] = -1e20f;
2461 for ( i = 0; i < point->
count; i++ ) {
2462 for ( j = 0; j < 3; j++ ) {
2463 if ( bbox[ j ] > point->
pt[ i ].
pos[ j ] )
2464 bbox[
j ] = point->
pt[
i ].
pos[
j ];
2465 if ( bbox[ j + 3 ] < point->
pt[ i ].
pos[ j ] )
2466 bbox[ j + 3 ] = point->
pt[
i ].
pos[
j ];
2484 plist->
count += npols;
2487 if ( !plist->
pol )
return 0;
2498 if ( !plist->
pol[ 0 ].
v )
return 0;
2507 for ( i = 1; i < plist->
offset; i++ )
2526 unsigned char *buf, *bp;
2527 int i,
j, flags, nv, nverts, npols;
2531 if ( cksize == 0 )
return 1;
2537 buf = (
unsigned char*)
getbytes( fp, cksize - 4 );
2538 if ( cksize !=
get_flen() )
goto Fail;
2546 while ( bp < buf + cksize - 4 ) {
2551 for ( i = 0; i < nv; i++ )
2564 for ( i = 0; i < npols; i++ ) {
2566 flags = nv & 0xFC00;
2572 if ( !pp->
v ) pp->
v = pv;
2573 for ( j = 0; j < nv; j++ )
2602 float p1[ 3 ], p2[ 3 ], pn[ 3 ],
v1[ 3 ], v2[ 3 ];
2604 for ( i = 0; i < polygon->
count; i++ ) {
2605 if ( polygon->
pol[ i ].
nverts < 3 )
continue;
2606 for ( j = 0; j < 3; j++ ) {
2614 for ( j = 0; j < 3; j++ ) {
2615 v1[
j ] = p2[
j ] - p1[
j ];
2616 v2[
j ] = pn[
j ] - p1[
j ];
2640 for ( i = 0; i < polygon->
count; i++ )
2641 for ( j = 0; j < polygon->
pol[
i ].
nverts; j++ )
2646 for ( i = 0; i < point->
count; i++ ) {
2647 if ( point->
pt[ i ].
npols == 0 )
continue;
2649 if ( !point->
pt[ i ].
pol )
return 0;
2655 for ( i = 0; i < polygon->
count; i++ ) {
2656 for ( j = 0; j < polygon->
pol[
i ].
nverts; j++ ) {
2682 if ( tlist->
count == 0 )
return 1;
2687 for ( i = 0; i < tlist->
count; i++ ) {
2698 for ( i = 0; i < polygon->
count; i++ ) {
2701 if ( !s[ index ] ) {
2703 if ( !s[ index ] )
return 0;
2705 if ( !s[ index ]->
name )
return 0;
2706 strcpy( s[ index ]->
name, tlist->
tag[ index ] );
2708 *nsurfs = *nsurfs + 1;
2735 int j, k,
n,
g, h,
p;
2738 for ( j = 0; j < polygon->
count; j++ ) {
2739 for ( n = 0; n < polygon->
pol[
j ].
nverts; n++ ) {
2740 for ( k = 0; k < 3; k++ )
2747 for ( g = 0; g < point->
pt[
p ].
npols; g++ ) {
2749 if ( h == j )
continue;
2756 for ( k = 0; k < 3; k++ )
2779 for ( i = 0; i < tlist->
count; i++ )
2780 if ( tlist->
tag[ i ] ) {
2803 if ( cksize == 0 )
return 1;
2808 buf = (
char*)
getbytes( fp, cksize );
2809 if ( !buf )
return 0;
2815 while ( bp < buf + cksize ) {
2816 len = strlen( bp ) + 1;
2825 tlist->
count += ntags;
2826 char **oldtag = tlist->
tag;
2828 if ( !tlist->
tag )
goto Fail;
2830 memcpy( tlist->
tag, oldtag, tlist->
offset *
sizeof(
char * ) );
2833 memset( &tlist->
tag[ tlist->
offset ], 0, ntags *
sizeof(
char * ) );
2838 for ( i = 0; i < ntags; i++ )
2865 if ( rlen < 0 )
return 0;
2872 while ( rlen < cksize ) {
2876 if ( rlen < 0 || rlen > cksize )
return 0;
2918 switch ( t->
type ) {
3035 if ( rlen < 0 || rlen > sz )
return 0;
3044 if ( hsz <= fp->Tell() - pos )
3085 for ( i = 0; i < 3; i++ )
3091 for ( i = 0; i < 3; i++ )
3097 for ( i = 0; i < 3; i++ )
3104 for ( i = 0; i < 3; i++ )
3124 if ( rlen < 0 || rlen > sz )
return 0;
3133 if ( tmapsz <= fp->Tell() - pos )
3233 if ( rlen < 0 || rlen > sz )
return 0;
3242 if ( rsz <= fp->Tell() - pos )
3308 if ( rlen < 0 || rlen > sz )
return 0;
3317 if ( rsz <= fp->Tell() - pos )
3344 int rlen, pos,
i,
j, nkeys;
3384 for ( i = 0; i < nkeys; i++ ) {
3386 for ( j = 0; j < 4; j++ )
3395 for ( i = 0; i < nkeys; i++ )
3406 if ( rlen < 0 || rlen > sz )
return 0;
3415 if ( rsz <= fp->Tell() - pos )
3445 if ( !tex )
return NULL;
3460 sz = bloksz - sz - 6;
3494 if ( !shdr )
return NULL;
3540 if ( rlen < 0 || rlen > sz )
goto Fail;
3549 if ( bloksz <= fp->Tell() - pos )
3602 switch ( tex->
chan ) {
3616 lwListInsert( (
void**)list, tex, (
int (__cdecl *)(
void *,
void *))compare_textures );
3633 if ( !surf )
return NULL;
3668 if ( !surf )
goto Fail;
3833 if ( !tex )
goto Fail;
3834 if ( !add_texture( surf, tex ))
3840 if ( !shdr )
goto Fail;
3855 if ( rlen < 0 || rlen > sz )
goto Fail;
3864 if ( cksize <= fp->Tell() - pos )
3883 float dot(
float a[],
float b[] )
3885 return a[ 0 ] * b[ 0 ] + a[ 1 ] * b[ 1 ] + a[ 2 ] * b[ 2 ];
3889 void cross(
float a[],
float b[],
float c[] )
3891 c[ 0 ] = a[ 1 ] * b[ 2 ] - a[ 2 ] * b[ 1 ];
3892 c[ 1 ] = a[ 2 ] * b[ 0 ] - a[ 0 ] * b[ 2 ];
3893 c[ 2 ] = a[ 0 ] * b[ 1 ] - a[ 1 ] * b[ 0 ];
3941 unsigned char *buf, *bp;
3944 int i,
j, npts, rlen;
3950 buf = (
unsigned char*)
getbytes( fp, cksize );
3951 if ( !buf )
return NULL;
3973 while ( bp < buf + cksize ) {
3985 if ( !vmap->
vindex )
goto Fail;
3988 if ( !vmap->
pindex )
goto Fail;
3991 if ( vmap->
dim > 0 ) {
3993 if ( !vmap->
val )
goto Fail;
3995 if ( !f )
goto Fail;
3996 for ( i = 0; i < npts; i++ )
3997 vmap->
val[ i ] = f + i * vmap->
dim;
4003 for ( i = 0; i < npts; i++ ) {
4007 for ( j = 0; j < vmap->
dim; j++ )
4038 for ( i = 0; i < vm->
nverts; i++ )
4045 for ( i = 0; i < point->
count; i++ ) {
4048 if ( !point->
pt[ i ].
vm )
return 0;
4058 for ( i = 0; i < vm->
nverts; i++ ) {
4091 for ( i = 0; i < vm->
nverts; i++ ) {
4106 for ( i = 0; i < polygon->
count; i++ ) {
4107 for ( j = 0; j < polygon->
pol[
i ].
nverts; j++ ) {
4108 pv = &polygon->
pol[
i ].
v[
j ];
4111 if ( !pv->
vm )
return 0;
4122 for ( i = 0; i < vm->
nverts; i++ ) {
struct st_lwSurface * next
unsigned short sgetU2(unsigned char **bp)
virtual idFile * OpenFileRead(const char *relativePath, bool allowCopyFiles=true, const char *gamedir=NULL)=0
int lwGetProcedural(idFile *fp, int rsz, lwTexture *tex)
int sgetI4(unsigned char **bp)
unsigned int sgetU4(unsigned char **bp)
int lwGetGradient(idFile *fp, int rsz, lwTexture *tex)
int lwGetPolyVMaps(lwPolygonList *polygon, lwVMap *vmap)
void cross(float a[], float b[], float c[])
int lwGetPointPolygons(lwPointList *point, lwPolygonList *polygon)
void lwFreeClip(lwClip *clip)
lwVMap * lwGetVMap(idFile *fp, int cksize, int ptoffset, int poloffset, int perpoly)
void lwFreePoints(lwPointList *point)
unsigned char sgetU1(unsigned char **bp)
void * getbytes(idFile *fp, int size)
int lwResolvePolySurfaces(lwPolygonList *polygon, lwTagList *tlist, lwSurface **surf, int *nsurfs)
lwClip * lwFindClip(lwClip *list, int index)
void lwFreePlugin(lwPlugin *p)
void lwGetBoundingBox(lwPointList *point, float bbox[])
char * sgetS0(unsigned char **bp)
int lwGetTags(idFile *fp, int cksize, lwTagList *tlist)
idFileSystem * fileSystem
union st_lwClip::@92 source
static float Sqrt(float x)
unsigned char getU1(idFile *fp)
GLuint GLuint GLsizei GLenum type
short sgetI2(unsigned char **bp)
unsigned short getU2(idFile *fp)
lwSurface * lwDefaultSurface(void)
lwObject * lwGetObject5(const char *filename, unsigned int *failID, int *failpos)
GLfloat GLfloat GLfloat v2
lwPlugin * lwGetShader(idFile *fp, int bloksz)
int lwGetPointVMaps(lwPointList *point, lwVMap *vmap)
lwEnvelope * lwGetEnvelope(idFile *fp, int cksize)
static float Fabs(float f)
lwSurface * lwGetSurface5(idFile *fp, int cksize, lwObject *obj)
int lwGetTHeader(idFile *fp, int hsz, lwTexture *tex)
GLsizei GLsizei GLenum GLenum const GLvoid * data
int lwAllocPolygons(lwPolygonList *plist, int npols, int nverts)
struct st_lwEnvelope * next
virtual int Read(void *buffer, int len)
int lwGetImageMap(idFile *fp, int rsz, lwTexture *tex)
lwEnvelope * lwFindEnvelope(lwEnvelope *list, int index)
void lwFreeLayer(lwLayer *layer)
void lwFreeTexture(lwTexture *t)
void lwListFree(void *list, void(*freeNode)(void *))
int lwGetPolygonTags(idFile *fp, int cksize, lwTagList *tlist, lwPolygonList *plist)
GLubyte GLubyte GLubyte a
virtual int Seek(long offset, fsOrigin_t origin)
virtual ID_TIME_T Timestamp(void)
float sgetF4(unsigned char **bp)
void lwFreeTags(lwTagList *tlist)
int lwGetTMap(idFile *fp, int tmapsz, lwTMap *tmap)
void lwFreeVMap(lwVMap *vmap)
GLdouble GLdouble GLdouble r
void lwGetPolyNormals(lwPointList *point, lwPolygonList *polygon)
void lwGetVertNormals(lwPointList *point, lwPolygonList *polygon)
void BigRevBytes(void *bp, int elsize, int elcount)
void lwFreeEnvelope(lwEnvelope *env)
#define FLOAT_IS_DENORMAL(x)
float evalEnvelope(lwEnvelope *env, float time)
lwClip * lwGetClip(idFile *fp, int cksize)
void * Mem_ClearedAlloc(const int size)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
unsigned int getU4(idFile *fp)
lwTexture * lwGetTexture(idFile *fp, int bloksz, unsigned int type)
int lwGetPoints(idFile *fp, int cksize, lwPointList *point)
lwObject * lwGetObject(const char *filename, unsigned int *failID, int *failpos)
void * Mem_Alloc(const int size)
int sgetI1(unsigned char **bp)
union st_lwTexture::@93 param
float dot(float a[], float b[])
void lwFreePolygons(lwPolygonList *plist)
if(!ValidDisplayID(prefInfo.prefDisplayID)) prefInfo.prefDisplayID
lwSurface * lwGetSurface(idFile *fp, int cksize)
int sgetVX(unsigned char **bp)
void lwFreeObject(lwObject *object)
virtual void CloseFile(idFile *f)=0
void lwListInsert(void **vlist, void *vitem, int(*compare)(void *, void *))
struct st_lwGradKey lwGradKey
int lwGetPolygons(idFile *fp, int cksize, lwPolygonList *plist, int ptoffset)
int lwGetPolygons5(idFile *fp, int cksize, lwPolygonList *plist, int ptoffset)
void lwListAdd(void **list, void *node)
void lwFreeSurface(lwSurface *surf)
void skipbytes(idFile *fp, int n)
void normalize(float v[])