Changeset 275
- Timestamp:
- 06/26/08 06:21:13 (2 months ago)
- Files:
-
- GtkRadiant/trunk/libs/l_net/l_net_berkeley.c (modified) (5 diffs)
- GtkRadiant/trunk/libs/mathlib/linear.c (modified) (1 diff)
- GtkRadiant/trunk/libs/mathlib/m4x4.c (modified) (9 diffs)
- GtkRadiant/trunk/libs/picomodel/picomodel.c (modified) (66 diffs)
- GtkRadiant/trunk/libs/picomodel/pm_ase.c (modified) (25 diffs)
- GtkRadiant/trunk/libs/picomodel/pm_obj.c (modified) (3 diffs)
- GtkRadiant/trunk/plugins/vfspak/vfs.cpp (modified) (6 diffs)
- GtkRadiant/trunk/plugins/vfspk3/vfs.cpp (modified) (12 diffs)
- GtkRadiant/trunk/plugins/vfswad/vfs.cpp (modified) (3 diffs)
- GtkRadiant/trunk/radiant/mainframe.cpp (modified) (1 diff)
- GtkRadiant/trunk/www (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/trunk/libs/l_net/l_net_berkeley.c
r250 r275 144 144 struct sockaddr_s addr; 145 145 char *p; 146 int r; 147 /* 146 /* 148 147 linux doesn't have anything to initialize for the net 149 "Windows .. built for the internet .. the internet .. built with unix" 148 "Windows .. built for the internet .. the internet .. built with unix" 150 149 */ 151 150 #if 0 152 WORD wVersionRequested; 151 int r; 152 WORD wVersionRequested; 153 153 154 154 wVersionRequested = MAKEWORD(2, 2); … … 433 433 int num; 434 434 int mask; 435 435 436 436 buff[0] = '.'; 437 437 b = buff; … … 450 450 addr = (addr<<8) + num; 451 451 } 452 452 453 453 hostaddr->sa_family = AF_INET; 454 454 ((struct sockaddr_in *)hostaddr)->sin_port = htons((u_short)net_hostport); 455 455 ((struct sockaddr_in *)hostaddr)->sin_addr.s_addr = (myAddr & htonl(mask)) | htonl(addr); 456 456 457 457 return 0; 458 458 } //end of the function PartialIPAddress … … 595 595 int WINS_Write(int socket, byte *buf, int len, struct sockaddr_s *addr) 596 596 { 597 int ret , written;597 int ret = 0, written; 598 598 599 599 if (addr) … … 726 726 if (name[0] >= '0' && name[0] <= '9') 727 727 return PartialIPAddress (name, addr); 728 728 729 729 hostentry = gethostbyname (name); 730 730 if (!hostentry) GtkRadiant/trunk/libs/mathlib/linear.c
r183 r275 53 53 float *vv; 54 54 55 imax = 0; 55 56 vv=(float*)malloc(sizeof(float)*n); 56 57 *d=1.0; GtkRadiant/trunk/libs/mathlib/m4x4.c
r183 r275 49 49 { 50 50 double cx, sx, cy, sy, cz, sz; 51 51 52 52 cx = cos(DEG2RAD(euler[0])); 53 53 sx = sin(DEG2RAD(euler[0])); … … 689 689 { 690 690 float det; 691 691 692 692 det = mat[0] * ( mat[4]*mat[8] - mat[7]*mat[5] ) 693 693 - mat[1] * ( mat[3]*mat[8] - mat[6]*mat[5] ) 694 694 + mat[2] * ( mat[3]*mat[7] - mat[6]*mat[4] ); 695 695 696 696 return( det ); 697 697 } … … 701 701 { 702 702 float det = m3_det( ma ); 703 703 704 704 if ( fabs( det ) < 0.0005 ) 705 705 { … … 707 707 return; 708 708 } 709 709 710 710 mr[0] = ma[4]*ma[8] - ma[5]*ma[7] / det; 711 711 mr[1] = -( ma[1]*ma[8] - ma[7]*ma[2] ) / det; 712 712 mr[2] = ma[1]*ma[5] - ma[4]*ma[2] / det; 713 713 714 714 mr[3] = -( ma[3]*ma[8] - ma[5]*ma[6] ) / det; 715 715 mr[4] = ma[0]*ma[8] - ma[6]*ma[2] / det; 716 716 mr[5] = -( ma[0]*ma[5] - ma[3]*ma[2] ) / det; 717 717 718 718 mr[6] = ma[3]*ma[7] - ma[6]*ma[4] / det; 719 719 mr[7] = -( ma[0]*ma[7] - ma[6]*ma[1] ) / det; … … 725 725 { 726 726 int ti, tj, idst, jdst; 727 727 728 idst = 0; 728 729 for ( ti = 0; ti < 4; ti++ ) 729 730 { … … 733 734 if ( ti > i ) 734 735 idst = ti-1; 735 736 736 737 for ( tj = 0; tj < 4; tj++ ) 737 738 { … … 741 742 if ( tj > j ) 742 743 jdst = tj-1; 743 744 744 745 if ( ti != i && tj != j ) 745 746 mb[idst*3 + jdst] = mr[ti*4 + tj ]; … … 753 754 m3x3_t msub3; 754 755 int n; 755 756 756 757 for ( n = 0; n < 4; n++, i *= -1 ) 757 758 { 758 759 m4_submat( mr, msub3, 0, n ); 759 760 760 761 det = m3_det( msub3 ); 761 762 result += mr[n] * det * i; 762 763 } 763 764 764 765 return result; 765 766 } … … 771 772 int i, j, sign; 772 773 m4x4_t m4x4_temp; 773 774 774 775 if ( fabs( mdet ) < 0.0000000001 ) //% 0.0005 775 776 return 1; 776 777 777 778 memcpy(m4x4_temp, matrix, sizeof(m4x4_t)); 778 779 779 780 for ( i = 0; i < 4; i++ ) 780 781 for ( j = 0; j < 4; j++ ) 781 782 { 782 783 sign = 1 - ( (i +j) % 2 ) * 2; 783 784 784 785 m4_submat( m4x4_temp, mtemp, i, j ); 785 786 786 787 matrix[i+j*4] = ( m3_det( mtemp ) * sign ) / mdet; 787 788 } 788 789 789 790 return 0; 790 791 } GtkRadiant/trunk/libs/picomodel/picomodel.c
r183 r275 162 162 char *modelFileName, *remapFileName; 163 163 164 164 165 165 /* init */ 166 166 model = NULL; 167 167 168 168 /* make sure we've got a file name */ 169 169 if( fileName == NULL ) … … 172 172 return NULL; 173 173 } 174 174 175 175 /* load file data (buffer is allocated by host app) */ 176 176 _pico_load_file( fileName, &buffer, &bufSize ); … … 183 183 /* get ptr to list of supported modules */ 184 184 modules = PicoModuleList( NULL ); 185 185 186 186 /* run it through the various loader functions and try */ 187 187 /* to find a loader that fits the given file data */ … … 190 190 /* get module */ 191 191 pm = *modules; 192 192 193 193 /* sanity check */ 194 194 if( pm == NULL) … … 198 198 if( pm->canload == NULL || pm->load == NULL ) 199 199 continue; 200 200 201 201 /* see whether this module can load the model file or not */ 202 202 if( pm->canload( fileName, buffer, bufSize ) == PICO_PMV_OK ) … … 209 209 return NULL; 210 210 } 211 211 212 212 /* assign pointer to file format module */ 213 213 model->module = pm; 214 214 215 215 /* get model file name */ 216 216 modelFileName = PicoGetModelFileName( model ); 217 217 218 218 /* apply model remappings from <model>.remap */ 219 219 if( strlen( modelFileName ) ) … … 234 234 } 235 235 } 236 236 237 237 /* model was loaded, so break out of loop */ 238 238 break; 239 239 } 240 240 } 241 241 242 242 /* free memory used by file buffer */ 243 243 if( buffer) … … 262 262 { 263 263 picoModel_t *model; 264 264 265 265 /* allocate */ 266 266 model = _pico_alloc( sizeof(picoModel_t) ); … … 270 270 /* clear */ 271 271 memset( model,0,sizeof(picoModel_t) ); 272 272 273 273 /* model set up */ 274 274 _pico_zero_bounds( model->mins,model->maxs ); … … 291 291 { 292 292 int i; 293 293 294 294 295 295 /* sanity check */ 296 296 if( model == NULL ) 297 297 return; 298 298 299 299 /* free bits */ 300 300 if( model->name ) 301 301 _pico_free( model->name ); 302 302 303 303 /* free shaders */ 304 304 for( i = 0; i < model->numShaders; i++ ) 305 305 PicoFreeShader( model->shader[ i ] ); 306 306 free( model->shader ); 307 307 308 308 /* free surfaces */ 309 309 for( i = 0; i < model->numSurfaces; i++ ) 310 310 PicoFreeSurface( model->surface[ i ] ); 311 311 free( model->surface ); 312 312 313 313 /* free the model */ 314 314 _pico_free( model ); … … 328 328 if( model == NULL ) 329 329 return 0; 330 330 331 331 /* bare minimums */ 332 332 /* sea: null surface/shader fix (1s=>0s) */ … … 343 343 return 0; 344 344 } 345 345 346 346 /* set shader count to higher */ 347 347 if( numShaders > model->numShaders ) 348 348 model->numShaders = numShaders; 349 349 350 350 /* additional surfaces? */ 351 351 while( numSurfaces > model->maxSurfaces ) … … 355 355 return 0; 356 356 } 357 357 358 358 /* set shader count to higher */ 359 359 if( numSurfaces > model->numSurfaces ) 360 360 model->numSurfaces = numSurfaces; 361 361 362 362 /* return ok */ 363 363 return 1; … … 378 378 { 379 379 picoShader_t *shader; 380 380 381 381 382 382 /* allocate and clear */ … … 385 385 return NULL; 386 386 memset( shader, 0, sizeof(picoShader_t) ); 387 387 388 388 /* attach it to the model */ 389 389 if( model != NULL ) … … 424 424 if( shader == NULL ) 425 425 return; 426 426 427 427 /* free bits */ 428 428 if( shader->name ) … … 430 430 if( shader->mapName ) 431 431 _pico_free( shader->mapName ); 432 432 433 433 /* free the shader */ 434 434 _pico_free( shader ); … … 445 445 { 446 446 int i; 447 448 447 448 449 449 /* sanity checks */ 450 450 if( model == NULL || name == NULL ) /* sea: null name fix */ 451 451 return NULL; 452 452 453 453 /* walk list */ 454 454 for( i = 0; i < model->numShaders; i++ ) … … 468 468 return model->shader[ i ]; 469 469 } 470 470 471 471 /* named shader not found */ 472 472 return NULL; … … 488 488 picoSurface_t *surface; 489 489 char surfaceName[64]; 490 490 491 491 /* allocate and clear */ 492 492 surface = _pico_alloc( sizeof( *surface ) ); … … 494 494 return NULL; 495 495 memset( surface, 0, sizeof( *surface ) ); 496 496 497 497 /* attach it to the model */ 498 498 if( model != NULL ) … … 504 504 return NULL; 505 505 } 506 506 507 507 /* attach */ 508 508 model->surface[ model->numSurfaces - 1 ] = surface; 509 509 surface->model = model; 510 510 511 511 /* set default name */ 512 512 sprintf( surfaceName, "Unnamed_%d", model->numSurfaces ); 513 513 PicoSetSurfaceName( surface, surfaceName ); 514 514 } 515 515 516 516 /* return */ 517 517 return surface; … … 527 527 { 528 528 int i; 529 530 529 530 531 531 /* dummy check */ 532 532 if( surface == NULL ) 533 533 return; 534 534 535 535 /* free bits */ 536 536 _pico_free( surface->xyz ); … … 538 538 _pico_free( surface->index ); 539 539 _pico_free( surface->faceNormal ); 540 540 541 541 /* free arrays */ 542 542 for( i = 0; i < surface->numSTArrays; i++ ) … … 546 546 _pico_free( surface->color[ i ] ); 547 547 free( surface->color ); 548 548 549 549 /* free the surface */ 550 550 _pico_free( surface ); … … 562 562 { 563 563 int i; 564 565 564 565 566 566 /* dummy check */ 567 567 if( surface == NULL ) 568 568 return 0; 569 569 570 570 /* bare minimums */ 571 571 if( numVertexes < 1 ) … … 577 577 if( numIndexes < 1 ) 578 578 numIndexes = 1; 579 579 580 580 /* additional vertexes? */ 581 581 while( numVertexes > surface->maxVertexes ) /* fix */ … … 593 593 return 0; 594 594 } 595 595 596 596 /* set vertex count to higher */ 597 597 if( numVertexes > surface->numVertexes ) 598 598 surface->numVertexes = numVertexes; 599 599 600 600 /* additional st arrays? */ 601 601 while( numSTArrays > surface->maxSTArrays ) /* fix */ … … 611 611 } 612 612 } 613 613 614 614 /* additional color arrays? */ 615 615 while( numColorArrays > surface->maxColorArrays ) /* fix */ … … 625 625 } 626 626 } 627 627 628 628 /* additional indexes? */ 629 629 while( numIndexes > surface->maxIndexes ) /* fix */ … … 633 633 return 0; 634 634 } 635 635 636 636 /* set index count to higher */ 637 637 if( numIndexes > surface->numIndexes ) … … 666 666 if( model == NULL || name == NULL ) 667 667 return NULL; 668 668 669 669 /* walk list */ 670 670 for( i = 0; i < model->numSurfaces; i++ ) … … 1036 1036 if( num < 0 || num >= model->numShaders ) 1037 1037 return NULL; 1038 1038 1039 1039 /* return the shader */ 1040 1040 return model->shader[ num ]; … … 1061 1061 if( num < 0 || num >= model->numSurfaces ) 1062 1062 return NULL; 1063 1063 1064 1064 /* return the surface */ 1065 1065 return model->surface[ num ]; … … 1071 1071 { 1072 1072 int i, count; 1073 1074 1073 1074 1075 1075 if( model == NULL ) 1076 1076 return 0; 1077 1077 if( model->surface == NULL ) 1078 1078 return 0; 1079 1079 1080 1080 count = 0; 1081 1081 for( i = 0; i < model->numSurfaces; i++ ) 1082 1082 count += PicoGetSurfaceNumVertexes( model->surface[ i ] ); 1083 1083 1084 1084 return count; 1085 1085 } … … 1090 1090 { 1091 1091 int i, count; 1092 1093 1092 1093 1094 1094 if( model == NULL ) 1095 1095 return 0; 1096 1096 if( model->surface == NULL ) 1097 1097 return 0; 1098 1098 1099 1099 count = 0; 1100 1100 for( i = 0; i < model->numSurfaces; i++ ) 1101 1101 count += PicoGetSurfaceNumIndexes( model->surface[ i ] ); 1102 1102 1103 1103 return count; 1104 1104 } … … 1414 1414 if( (vertexCombinationHash->vcd.normal[ 0 ] != normal[ 0 ] || vertexCombinationHash->vcd.normal[ 1 ] != normal[ 1 ] || vertexCombinationHash->vcd.normal[ 2 ] != normal[ 2 ]) ) 1415 1415 continue; 1416 1416 1417 1417 /* check st */ 1418 1418 if( vertexCombinationHash->vcd.st[ 0 ] != st[ 0 ] || vertexCombinationHash->vcd.st[ 1 ] != st[ 1 ] ) … … 1430 1430 ( fabs(normal[ 2 ] - vertexCombinationHash->vcd.normal[ 2 ]) ) > HASH_NORMAL_EPSILON ) 1431 1431 continue; 1432 1432 1433 1433 /* check st */ 1434 1434 if( ( fabs(st[ 0 ] - vertexCombinationHash->vcd.st[ 0 ]) ) > HASH_ST_EPSILON || … … 1489 1489 { 1490 1490 int i, j; 1491 1492 1491 1492 1493 1493 /* dummy check */ 1494 1494 if( surface == NULL || surface->numVertexes <= 0 ) 1495 1495 return -1; 1496 1496 1497 1497 /* walk vertex list */ 1498 1498 for( i = 0; i < surface->numVertexes; i++ ) … … 1501 1501 if( xyz != NULL && (surface->xyz[ i ][ 0 ] != xyz[ 0 ] || surface->xyz[ i ][ 1 ] != xyz[ 1 ] || surface->xyz[ i ][ 2 ] != xyz[ 2 ]) ) 1502 1502 continue; 1503 1503 1504 1504 /* check normal */ 1505 1505 if( normal != NULL && (surface->normal[ i ][ 0 ] != normal[ 0 ] || surface->normal[ i ][ 1 ] != normal[ 1 ] || surface->normal[ i ][ 2 ] != normal[ 2 ]) ) 1506 1506 continue; 1507 1507 1508 1508 /* check st */ 1509 1509 if( numSTs > 0 && st != NULL ) … … 1517 1517 continue; 1518 1518 } 1519 1519 1520 1520 /* check color */ 1521 1521 if( numColors > 0 && color != NULL ) … … 1529 1529 continue; 1530 1530 } 1531 1531 1532 1532 /* vertex matches */ 1533 1533 return i; 1534 1534 } 1535 1535 1536 1536 /* nada */ 1537 1537 return -1; … … 1555 1555 picoVec3_t *normals, diff; 1556 1556 picoVec4_t plane; 1557 1558 1557 1558 1559 1559 /* dummy check */ 1560 1560 if( surface == NULL || surface->numVertexes == 0 ) 1561 1561 return; 1562 1562 1563 1563 /* fixme: handle other surface types */ 1564 1564 if( surface->type != PICO_TRIANGLES ) 1565 1565 return; 1566 1566 1567 1567 /* allocate normal storage */ 1568 1568 normals = _pico_alloc( surface->numVertexes * sizeof( *normals ) ); … … 1572 1572 return; 1573 1573 } 1574 1574 1575 1575 /* zero it out */ 1576 1576 memset( normals, 0, surface->numVertexes * sizeof( *normals ) ); 1577 1577 1578 1578 /* walk vertex list */ 1579 1579 for( i = 0; i < surface->numVertexes; i++ ) … … 1581 1581 /* zero out votes */ 1582 1582 numVotes = 0; 1583 1583 1584 1584 /* find all the triangles that reference this vertex */ 1585 1585 for( j = 0, faceIndex = 0; j < surface->numIndexes; j += 3, faceIndex++ ) … … 1589 1589 b = surface->index[ j + 1 ]; 1590 1590 c = surface->index[ j + 2 ]; 1591 1591 1592 1592 /* ignore degenerate triangles */ 1593 1593 if( a == b || b == c || c == a ) 1594 1594 continue; 1595 1595 1596 1596 /* ignore indexes out of range */ 1597 1597 if( a < 0 || a >= surface->numVertexes || … … 1599 1599 c < 0 || c >= surface->numVertexes ) 1600 1600 continue; 1601 1601 1602 1602 /* test triangle */ 1603 1603 if( a == i || b == i || c == i ) … … 1631 1631 break; 1632 1632 } 1633 1633 1634 1634 /* add a new vote? */ 1635 1635 if( k == numVotes && numVotes < MAX_NORMAL_VOTES ) … … 1640 1640 } 1641 1641 } 1642 1642 1643 1643 /* tally votes */ 1644 1644 if( numVotes > 0 ) … … 1648 1648 for( k = 0; k < numVotes; k++ ) 1649 1649 _pico_add_vec( normals[ i ], votes[ k ], normals[ i ] ); 1650 1650 1651 1651 /* normalize it */ 1652 1652 if( _pico_normalize_vec( normals[ i ] ) ) … … 1663 1663 } 1664 1664 } 1665 1665 1666 1666 /* free normal storage */ 1667 1667 _pico_free( normals ); … … 1690 1690 picoByte_t *remapBuffer; 1691 1691 int remapBufSize; 1692 1693 1692 1693 1694 1694 /* sanity checks */ 1695 1695 if( model == NULL || remapFile == NULL ) 1696 1696 return 0; 1697 1697 1698 1698 /* load remap file contents */ 1699 1699 _pico_load_file( remapFile,&remapBuffer,&remapBufSize ); 1700 1700 1701 1701 /* check result */ 1702 1702 if( remapBufSize == 0 ) … … 1704 1704 if( remapBufSize < 0 ) 1705 1705 return 0; /* load failed: error */ 1706 1706 1707 1707 /* create a new pico parser */ 1708 1708 p = _pico_new_parser( remapBuffer, remapBufSize ); … … 1712 1712 _prm_error_return; 1713 1713 } 1714 1714 1715 1715 /* doo teh parse */ 1716 1716 while( 1 ) … … 1726 1726 continue; 1727 1727 } 1728 1728 1729 1729 /* block for quick material shader name remapping */ 1730 1730 /* materials { "m" (=>|->|=) "s" } */ … … 1742 1742 picoShader_t *shader; 1743 1743 char *materialName; 1744 1745 1744 1745 1746 1746 /* get material name */ 1747 1747 if (_pico_parse( p,1 ) == NULL) break; … … 1808 1808 /* check square closing bracket */ 1809 1809 if (!_pico_parse_check( p,0,"]" )) 1810 _prm_error_return; 1810 _prm_error_return; 1811 1811 1812 1812 /* try to find material by name */ … … 1865 1865 color[ 1 ] = (picoByte_t)v[ 1 ]; 1866 1866 color[ 2 ] = (picoByte_t)v[ 2 ]; 1867 color[ 3 ] = 1; 1867 1868 1868 1869 /* set new ambient color */ … … 1882 1883 color[ 1 ] = (picoByte_t)v[ 1 ]; 1883 1884 color[ 2 ] = (picoByte_t)v[ 2 ]; 1885 color[ 3 ] = 1; 1884 1886 1885 1887 /* set new ambient color */ … … 1899 1901 color[ 1 ] = (picoByte_t)v[ 1 ]; 1900 1902 color[ 2 ] = (picoByte_t)v[ 2 ]; 1903 color[ 3 ] = 1; 1901 1904 1902 1905 /* set new ambient color */ … … 1909 1912 /* end 'materials[' */ 1910 1913 } 1911 1914 1912 1915 /* free both parser and file buffer */ 1913 1916 _pico_free_parser( p ); … … 1925 1928 */ 1926 1929 1927 void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, 1930 void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, 1928 1931 int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, 1929 1932 picoShader_t* shader ) … … 1938 1941 workSurface = model->surface[i]; 1939 1942 if ( workSurface->shader == shader ) 1940 { 1943 { 1941 1944 break; 1942 1945 } … … 1961 1964 1962 1965 /* add the triangle data to the surface */ 1963 for ( i = 0 ; i < 3 ; i++ ) 1966 for ( i = 0 ; i < 3 ; i++ ) 1964 1967 { 1965 1968 /* get the next free spot in the index array */ … … 1971 1974 /* the vertex wasn't found, so create a new vertex in the pool from the data we have */ 1972 1975 if ( vertDataIndex == -1 ) 1973 { 1976 { 1974 1977 /* find the next spot for a new vertex */ 1975 vertDataIndex = PicoGetSurfaceNumVertexes ( workSurface ); 1978 vertDataIndex = PicoGetSurfaceNumVertexes ( workSurface ); 1976 1979 1977 1980 /* assign the data to it */ 1978 1981 PicoSetSurfaceXYZ ( workSurface ,vertDataIndex , *xyz[i] ); 1979 PicoSetSurfaceNormal ( workSurface , vertDataIndex , *normals[i] ); 1982 PicoSetSurfaceNormal ( workSurface , vertDataIndex , *normals[i] ); 1980 1983 1981 1984 /* make sure to copy over all available ST's and colors for the vertex */ … … 1990 1993 } 1991 1994 1992 /* add this vertex to the triangle */ 1995 /* add this vertex to the triangle */ 1993 1996 PicoSetSurfaceIndex ( workSurface , newVertIndex , vertDataIndex ); 1994 } 1995 } 1997 } 1998 } GtkRadiant/trunk/libs/picomodel/pm_ase.c
r183 r275 38 38 39 39 /* uncomment when debugging this module */ 40 //#define DEBUG_PM_ASE 40 //#define DEBUG_PM_ASE 41 41 //#define DEBUG_PM_ASE_EX 42 42 … … 62 62 int subMtlId; 63 63 picoShader_t* shader; 64 64 65 65 } aseSubMaterial_t; 66 66 … … 69 69 struct aseMaterial_s* next; 70 70 struct aseSubMaterial_s* subMtls; 71 int mtlId; 71 int mtlId; 72 72 } aseMaterial_t; 73 73 … … 199 199 void _ase_add_face( aseFace_t **list, aseFace_t **tail, aseFace_t *newFace ) 200 200 { 201 aseFace_t* face = *list;202 aseFace_t* tempFace = NULL;203 204 201 /* insert as head of list */ 205 202 if ( !(*list) ) … … 210 207 { 211 208 (*tail)->next = newFace; 212 } 209 } 213 210 214 211 *tail = newFace; 215 212 newFace->next = NULL; 216 213 217 214 //tag the color indices so we can detect them and apply the default color to them 218 215 newFace->index[6] = -1; … … 259 256 { 260 257 picoParser_t *p; 261 262 258 259 263 260 /* quick data length validation */ 264 261 if( bufSize < 80 ) 265 262 return PICO_PMV_ERROR_SIZE; 266 263 267 264 /* keep the friggin compiler happy */ 268 265 *fileName = *fileName; 269 266 270 267 /* create pico parser */ 271 268 p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); 272 269 if( p == NULL ) 273 270 return PICO_PMV_ERROR_MEMORY; 274 271 275 272 /* get first token */ 276 273 if( _pico_parse_first( p ) == NULL) … … 278 275 return PICO_PMV_ERROR_IDENT; 279 276 } 280 277 281 278 /* check first token */ 282 279 if( _pico_stricmp( p->token, "*3dsmax_asciiexport" ) ) … … 285 282 return PICO_PMV_ERROR_IDENT; 286 283 } 287 284 288 285 /* free the pico parser object */ 289 286 _pico_free_parser( p ); 290 287 291 288 /* file seems to be a valid ase file */ 292 289 return PICO_PMV_OK; … … 330 327 } 331 328 } 332 329 333 330 /* we pull the data from the surface using the facelist data */ 334 331 for ( i = 0 ; i < 3 ; i ++ ) 335 332 { 336 333 xyz[i] = (picoVec3_t*) PicoGetSurfaceXYZ ( surface, face->index[ i ] ); 337 normal[i] = (picoVec3_t*) PicoGetSurfaceNormal( surface, face->index[ i ] ); 334 normal[i] = (picoVec3_t*) PicoGetSurfaceNormal( surface, face->index[ i ] ); 338 335 st[i] = (picoVec2_t*) PicoGetSurfaceST ( surface, 0, face->index[ i + 3 ] ); 339 336 340 337 if ( face->index [ i + 6] >= 0 ) 341 338 {
