Changeset 275

Show
Ignore:
Timestamp:
06/26/08 06:21:13 (2 months ago)
Author:
mattn
Message:

* fixed warnings
* removed www dir (dead links, almost none of the posted links are available - correct me when i'm wrong, then we can revert this remove)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/trunk/libs/l_net/l_net_berkeley.c

    r250 r275  
    144144        struct sockaddr_s addr; 
    145145        char    *p; 
    146         int             r; 
    147 /*  
     146/* 
    148147 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" 
    150149 */ 
    151150#if 0 
    152         WORD    wVersionRequested;  
     151        int             r; 
     152        WORD    wVersionRequested; 
    153153 
    154154        wVersionRequested = MAKEWORD(2, 2); 
     
    433433        int num; 
    434434        int mask; 
    435          
     435 
    436436        buff[0] = '.'; 
    437437        b = buff; 
     
    450450                addr = (addr<<8) + num; 
    451451        } 
    452          
     452 
    453453        hostaddr->sa_family = AF_INET; 
    454454        ((struct sockaddr_in *)hostaddr)->sin_port = htons((u_short)net_hostport); 
    455455        ((struct sockaddr_in *)hostaddr)->sin_addr.s_addr = (myAddr & htonl(mask)) | htonl(addr); 
    456          
     456 
    457457        return 0; 
    458458} //end of the function PartialIPAddress 
     
    595595int WINS_Write(int socket, byte *buf, int len, struct sockaddr_s *addr) 
    596596{ 
    597         int ret, written; 
     597        int ret = 0, written; 
    598598 
    599599        if (addr) 
     
    726726        if (name[0] >= '0' && name[0] <= '9') 
    727727                return PartialIPAddress (name, addr); 
    728          
     728 
    729729        hostentry = gethostbyname (name); 
    730730        if (!hostentry) 
  • GtkRadiant/trunk/libs/mathlib/linear.c

    r183 r275  
    5353        float *vv; 
    5454 
     55        imax = 0; 
    5556        vv=(float*)malloc(sizeof(float)*n); 
    5657        *d=1.0; 
  • GtkRadiant/trunk/libs/mathlib/m4x4.c

    r183 r275  
    4949{ 
    5050  double cx, sx, cy, sy, cz, sz; 
    51      
     51 
    5252  cx = cos(DEG2RAD(euler[0])); 
    5353  sx = sin(DEG2RAD(euler[0])); 
     
    689689{ 
    690690  float det; 
    691    
     691 
    692692  det = mat[0] * ( mat[4]*mat[8] - mat[7]*mat[5] ) 
    693693    - mat[1] * ( mat[3]*mat[8] - mat[6]*mat[5] ) 
    694694    + mat[2] * ( mat[3]*mat[7] - mat[6]*mat[4] ); 
    695    
     695 
    696696  return( det ); 
    697697} 
     
    701701{ 
    702702  float det = m3_det( ma ); 
    703    
     703 
    704704  if ( fabs( det ) < 0.0005 ) 
    705705  { 
     
    707707    return; 
    708708  } 
    709    
     709 
    710710  mr[0] =    ma[4]*ma[8] - ma[5]*ma[7]   / det; 
    711711  mr[1] = -( ma[1]*ma[8] - ma[7]*ma[2] ) / det; 
    712712  mr[2] =    ma[1]*ma[5] - ma[4]*ma[2]   / det; 
    713    
     713 
    714714  mr[3] = -( ma[3]*ma[8] - ma[5]*ma[6] ) / det; 
    715715  mr[4] =    ma[0]*ma[8] - ma[6]*ma[2]   / det; 
    716716  mr[5] = -( ma[0]*ma[5] - ma[3]*ma[2] ) / det; 
    717    
     717 
    718718  mr[6] =    ma[3]*ma[7] - ma[6]*ma[4]   / det; 
    719719  mr[7] = -( ma[0]*ma[7] - ma[6]*ma[1] ) / det; 
     
    725725{ 
    726726  int ti, tj, idst, jdst; 
    727    
     727 
     728        idst = 0; 
    728729  for ( ti = 0; ti < 4; ti++ ) 
    729730  { 
     
    733734      if ( ti > i ) 
    734735        idst = ti-1; 
    735        
     736 
    736737      for ( tj = 0; tj < 4; tj++ ) 
    737738      { 
     
    741742          if ( tj > j ) 
    742743            jdst = tj-1; 
    743            
     744 
    744745          if ( ti != i && tj != j ) 
    745746            mb[idst*3 + jdst] = mr[ti*4 + tj ]; 
     
    753754  m3x3_t msub3; 
    754755  int     n; 
    755    
     756 
    756757  for ( n = 0; n < 4; n++, i *= -1 ) 
    757758  { 
    758759    m4_submat( mr, msub3, 0, n ); 
    759      
     760 
    760761    det     = m3_det( msub3 ); 
    761762    result += mr[n] * det * i; 
    762763  } 
    763    
     764 
    764765  return result; 
    765766} 
     
    771772  int     i, j, sign; 
    772773  m4x4_t m4x4_temp; 
    773    
     774 
    774775  if ( fabs( mdet ) < 0.0000000001 )    //% 0.0005 
    775776    return 1; 
    776777 
    777778  memcpy(m4x4_temp, matrix, sizeof(m4x4_t)); 
    778    
     779 
    779780  for ( i = 0; i < 4; i++ ) 
    780781    for ( j = 0; j < 4; j++ ) 
    781782    { 
    782783      sign = 1 - ( (i +j) % 2 ) * 2; 
    783        
     784 
    784785      m4_submat( m4x4_temp, mtemp, i, j ); 
    785        
     786 
    786787      matrix[i+j*4] = ( m3_det( mtemp ) * sign ) / mdet; 
    787788    } 
    788      
     789 
    789790  return 0; 
    790791} 
  • GtkRadiant/trunk/libs/picomodel/picomodel.c

    r183 r275  
    162162        char                            *modelFileName, *remapFileName; 
    163163 
    164          
     164 
    165165        /* init */ 
    166166        model = NULL; 
    167          
     167 
    168168        /* make sure we've got a file name */ 
    169169        if( fileName == NULL ) 
     
    172172                return NULL; 
    173173        } 
    174          
     174 
    175175        /* load file data (buffer is allocated by host app) */ 
    176176        _pico_load_file( fileName, &buffer, &bufSize ); 
     
    183183        /* get ptr to list of supported modules */ 
    184184        modules = PicoModuleList( NULL ); 
    185          
     185 
    186186        /* run it through the various loader functions and try */ 
    187187        /* to find a loader that fits the given file data */ 
     
    190190                /* get module */ 
    191191                pm = *modules; 
    192                  
     192 
    193193                /* sanity check */ 
    194194                if( pm == NULL) 
     
    198198                if( pm->canload == NULL || pm->load == NULL ) 
    199199                        continue; 
    200                  
     200 
    201201                /* see whether this module can load the model file or not */ 
    202202                if( pm->canload( fileName, buffer, bufSize ) == PICO_PMV_OK ) 
     
    209209                                return NULL; 
    210210                        } 
    211                          
     211 
    212212                        /* assign pointer to file format module */ 
    213213                        model->module = pm; 
    214                          
     214 
    215215                        /* get model file name */ 
    216216                        modelFileName = PicoGetModelFileName( model ); 
    217                          
     217 
    218218                        /* apply model remappings from <model>.remap */ 
    219219                        if( strlen( modelFileName ) ) 
     
    234234                                } 
    235235                        } 
    236                          
     236 
    237237                        /* model was loaded, so break out of loop */ 
    238238                        break; 
    239239                } 
    240240        } 
    241          
     241 
    242242        /* free memory used by file buffer */ 
    243243        if( buffer) 
     
    262262{ 
    263263        picoModel_t     *model; 
    264          
     264 
    265265        /* allocate */ 
    266266        model = _pico_alloc( sizeof(picoModel_t) ); 
     
    270270        /* clear */ 
    271271        memset( model,0,sizeof(picoModel_t) ); 
    272          
     272 
    273273        /* model set up */ 
    274274        _pico_zero_bounds( model->mins,model->maxs ); 
     
    291291{ 
    292292        int                             i; 
    293          
     293 
    294294 
    295295        /* sanity check */ 
    296296        if( model == NULL ) 
    297297                return; 
    298          
     298 
    299299        /* free bits */ 
    300300        if( model->name ) 
    301301                _pico_free( model->name ); 
    302          
     302 
    303303        /* free shaders */ 
    304304        for( i = 0; i < model->numShaders; i++ ) 
    305305                PicoFreeShader( model->shader[ i ] ); 
    306306        free( model->shader ); 
    307          
     307 
    308308        /* free surfaces */ 
    309309        for( i = 0; i < model->numSurfaces; i++ ) 
    310310                PicoFreeSurface( model->surface[ i ] ); 
    311311        free( model->surface ); 
    312          
     312 
    313313        /* free the model */ 
    314314        _pico_free( model ); 
     
    328328        if( model == NULL ) 
    329329                return 0; 
    330          
     330 
    331331        /* bare minimums */ 
    332332        /* sea: null surface/shader fix (1s=>0s) */ 
     
    343343                        return 0; 
    344344        } 
    345          
     345 
    346346        /* set shader count to higher */ 
    347347        if( numShaders > model->numShaders ) 
    348348                model->numShaders = numShaders; 
    349          
     349 
    350350        /* additional surfaces? */ 
    351351        while( numSurfaces > model->maxSurfaces ) 
     
    355355                        return 0; 
    356356        } 
    357          
     357 
    358358        /* set shader count to higher */ 
    359359        if( numSurfaces > model->numSurfaces ) 
    360360                model->numSurfaces = numSurfaces; 
    361          
     361 
    362362        /* return ok */ 
    363363        return 1; 
     
    378378{ 
    379379        picoShader_t    *shader; 
    380          
     380 
    381381 
    382382        /* allocate and clear */ 
     
    385385                return NULL; 
    386386        memset( shader, 0, sizeof(picoShader_t) ); 
    387          
     387 
    388388        /* attach it to the model */ 
    389389        if( model != NULL ) 
     
    424424        if( shader == NULL ) 
    425425                return; 
    426          
     426 
    427427        /* free bits */ 
    428428        if( shader->name ) 
     
    430430        if( shader->mapName ) 
    431431                _pico_free( shader->mapName ); 
    432          
     432 
    433433        /* free the shader */ 
    434434        _pico_free( shader ); 
     
    445445{ 
    446446        int             i; 
    447          
    448          
     447 
     448 
    449449        /* sanity checks */ 
    450450        if( model == NULL || name == NULL )     /* sea: null name fix */ 
    451451                return NULL; 
    452          
     452 
    453453        /* walk list */ 
    454454        for( i = 0; i < model->numShaders; i++ ) 
     
    468468                                return model->shader[ i ]; 
    469469        } 
    470          
     470 
    471471        /* named shader not found */ 
    472472        return NULL; 
     
    488488        picoSurface_t   *surface; 
    489489        char surfaceName[64]; 
    490          
     490 
    491491        /* allocate and clear */ 
    492492        surface = _pico_alloc( sizeof( *surface ) ); 
     
    494494                return NULL; 
    495495        memset( surface, 0, sizeof( *surface ) ); 
    496          
     496 
    497497        /* attach it to the model */ 
    498498        if( model != NULL ) 
     
    504504                        return NULL; 
    505505                } 
    506                  
     506 
    507507                /* attach */ 
    508508                model->surface[ model->numSurfaces - 1 ] = surface; 
    509509                surface->model = model; 
    510                  
     510 
    511511                /* set default name */ 
    512512                sprintf( surfaceName, "Unnamed_%d", model->numSurfaces ); 
    513513                PicoSetSurfaceName( surface, surfaceName ); 
    514514        } 
    515          
     515 
    516516        /* return */ 
    517517        return surface; 
     
    527527{ 
    528528        int             i; 
    529          
    530          
     529 
     530 
    531531        /* dummy check */ 
    532532        if( surface == NULL ) 
    533533                return; 
    534          
     534 
    535535        /* free bits */ 
    536536        _pico_free( surface->xyz ); 
     
    538538        _pico_free( surface->index ); 
    539539        _pico_free( surface->faceNormal ); 
    540          
     540 
    541541        /* free arrays */ 
    542542        for( i = 0; i < surface->numSTArrays; i++ ) 
     
    546546                _pico_free( surface->color[ i ] ); 
    547547        free( surface->color ); 
    548          
     548 
    549549        /* free the surface */ 
    550550        _pico_free( surface ); 
     
    562562{ 
    563563        int             i; 
    564          
    565          
     564 
     565 
    566566        /* dummy check */ 
    567567        if( surface == NULL ) 
    568568                return 0; 
    569          
     569 
    570570        /* bare minimums */ 
    571571        if( numVertexes < 1 ) 
     
    577577        if( numIndexes < 1 ) 
    578578                numIndexes = 1; 
    579          
     579 
    580580        /* additional vertexes? */ 
    581581        while( numVertexes > surface->maxVertexes ) /* fix */ 
     
    593593                        return 0; 
    594594        } 
    595          
     595 
    596596        /* set vertex count to higher */ 
    597597        if( numVertexes > surface->numVertexes ) 
    598598                surface->numVertexes = numVertexes; 
    599          
     599 
    600600        /* additional st arrays? */ 
    601601        while( numSTArrays > surface->maxSTArrays ) /* fix */ 
     
    611611                } 
    612612        } 
    613          
     613 
    614614        /* additional color arrays? */ 
    615615        while( numColorArrays > surface->maxColorArrays ) /* fix */ 
     
    625625                } 
    626626        } 
    627          
     627 
    628628        /* additional indexes? */ 
    629629        while( numIndexes > surface->maxIndexes ) /* fix */ 
     
    633633                        return 0; 
    634634        } 
    635          
     635 
    636636        /* set index count to higher */ 
    637637        if( numIndexes > surface->numIndexes ) 
     
    666666        if( model == NULL || name == NULL ) 
    667667                return NULL; 
    668          
     668 
    669669        /* walk list */ 
    670670        for( i = 0; i < model->numSurfaces; i++ ) 
     
    10361036        if( num < 0 || num >= model->numShaders ) 
    10371037                return NULL; 
    1038          
     1038 
    10391039        /* return the shader */ 
    10401040        return model->shader[ num ]; 
     
    10611061        if( num < 0 || num >= model->numSurfaces ) 
    10621062                return NULL; 
    1063          
     1063 
    10641064        /* return the surface */ 
    10651065        return model->surface[ num ]; 
     
    10711071{ 
    10721072        int             i, count; 
    1073          
    1074          
     1073 
     1074 
    10751075        if( model == NULL ) 
    10761076                return 0; 
    10771077        if( model->surface == NULL ) 
    10781078                return 0; 
    1079          
     1079 
    10801080        count = 0; 
    10811081        for( i = 0; i < model->numSurfaces; i++ ) 
    10821082                 count += PicoGetSurfaceNumVertexes( model->surface[ i ] ); 
    1083          
     1083 
    10841084        return count; 
    10851085} 
     
    10901090{ 
    10911091        int             i, count; 
    1092          
    1093          
     1092 
     1093 
    10941094        if( model == NULL ) 
    10951095                return 0; 
    10961096        if( model->surface == NULL ) 
    10971097                return 0; 
    1098          
     1098 
    10991099        count = 0; 
    11001100        for( i = 0; i < model->numSurfaces; i++ ) 
    11011101                 count += PicoGetSurfaceNumIndexes( model->surface[ i ] ); 
    1102          
     1102 
    11031103        return count; 
    11041104} 
     
    14141414                if( (vertexCombinationHash->vcd.normal[ 0 ] != normal[ 0 ] || vertexCombinationHash->vcd.normal[ 1 ] != normal[ 1 ] || vertexCombinationHash->vcd.normal[ 2 ] != normal[ 2 ]) ) 
    14151415                        continue; 
    1416                  
     1416 
    14171417                /* check st */ 
    14181418                if( vertexCombinationHash->vcd.st[ 0 ] != st[ 0 ] || vertexCombinationHash->vcd.st[ 1 ] != st[ 1 ] ) 
     
    14301430                        ( fabs(normal[ 2 ] - vertexCombinationHash->vcd.normal[ 2 ]) ) > HASH_NORMAL_EPSILON ) 
    14311431                        continue; 
    1432                  
     1432 
    14331433                /* check st */ 
    14341434                if( ( fabs(st[ 0 ] - vertexCombinationHash->vcd.st[ 0 ]) ) > HASH_ST_EPSILON || 
     
    14891489{ 
    14901490        int             i, j; 
    1491          
    1492          
     1491 
     1492 
    14931493        /* dummy check */ 
    14941494        if( surface == NULL || surface->numVertexes <= 0 ) 
    14951495                return -1; 
    1496          
     1496 
    14971497        /* walk vertex list */ 
    14981498        for( i = 0; i < surface->numVertexes; i++ ) 
     
    15011501                if( xyz != NULL && (surface->xyz[ i ][ 0 ] != xyz[ 0 ] || surface->xyz[ i ][ 1 ] != xyz[ 1 ] || surface->xyz[ i ][ 2 ] != xyz[ 2 ]) ) 
    15021502                        continue; 
    1503                  
     1503 
    15041504                /* check normal */ 
    15051505                if( normal != NULL && (surface->normal[ i ][ 0 ] != normal[ 0 ] || surface->normal[ i ][ 1 ] != normal[ 1 ] || surface->normal[ i ][ 2 ] != normal[ 2 ]) ) 
    15061506                        continue; 
    1507                  
     1507 
    15081508                /* check st */ 
    15091509                if( numSTs > 0 && st != NULL ) 
     
    15171517                                continue; 
    15181518                } 
    1519                  
     1519 
    15201520                /* check color */ 
    15211521                if( numColors > 0 && color != NULL ) 
     
    15291529                                continue; 
    15301530                } 
    1531                  
     1531 
    15321532                /* vertex matches */ 
    15331533                return i; 
    15341534        } 
    1535          
     1535 
    15361536        /* nada */ 
    15371537        return -1; 
     
    15551555        picoVec3_t              *normals, diff; 
    15561556        picoVec4_t              plane; 
    1557          
    1558          
     1557 
     1558 
    15591559        /* dummy check */ 
    15601560        if( surface == NULL || surface->numVertexes == 0 ) 
    15611561                return; 
    1562          
     1562 
    15631563        /* fixme: handle other surface types */ 
    15641564        if( surface->type != PICO_TRIANGLES ) 
    15651565                return; 
    1566          
     1566 
    15671567        /* allocate normal storage */ 
    15681568        normals = _pico_alloc( surface->numVertexes * sizeof( *normals ) ); 
     
    15721572                return; 
    15731573        } 
    1574          
     1574 
    15751575        /* zero it out */ 
    15761576        memset( normals, 0, surface->numVertexes * sizeof( *normals ) ); 
    1577          
     1577 
    15781578        /* walk vertex list */ 
    15791579        for( i = 0; i < surface->numVertexes; i++ ) 
     
    15811581                /* zero out votes */ 
    15821582                numVotes = 0; 
    1583                  
     1583 
    15841584                /* find all the triangles that reference this vertex */ 
    15851585                for( j = 0, faceIndex = 0; j < surface->numIndexes; j += 3, faceIndex++ ) 
     
    15891589                        b = surface->index[ j + 1 ]; 
    15901590                        c = surface->index[ j + 2 ]; 
    1591                          
     1591 
    15921592                        /* ignore degenerate triangles */ 
    15931593                        if( a == b || b == c || c == a ) 
    15941594                                continue; 
    1595                          
     1595 
    15961596                        /* ignore indexes out of range */ 
    15971597                        if( a < 0 || a >= surface->numVertexes || 
     
    15991599                                c < 0 || c >= surface->numVertexes ) 
    16001600                                continue; 
    1601                          
     1601 
    16021602                        /* test triangle */ 
    16031603                        if( a == i || b == i || c == i ) 
     
    16311631                                                break; 
    16321632                                } 
    1633                                  
     1633 
    16341634                                /* add a new vote? */ 
    16351635                                if( k == numVotes && numVotes < MAX_NORMAL_VOTES ) 
     
    16401640                        } 
    16411641                } 
    1642                  
     1642 
    16431643                /* tally votes */ 
    16441644                if( numVotes > 0 ) 
     
    16481648                        for( k = 0; k < numVotes; k++ ) 
    16491649                                _pico_add_vec( normals[ i ], votes[ k ], normals[ i ] ); 
    1650                          
     1650 
    16511651                        /* normalize it */ 
    16521652                        if( _pico_normalize_vec( normals[ i ] ) ) 
     
    16631663                } 
    16641664        } 
    1665          
     1665 
    16661666        /* free normal storage */ 
    16671667        _pico_free( normals ); 
     
    16901690        picoByte_t              *remapBuffer; 
    16911691        int                             remapBufSize; 
    1692          
    1693          
     1692 
     1693 
    16941694        /* sanity checks */ 
    16951695        if( model == NULL || remapFile == NULL ) 
    16961696                return 0; 
    1697          
     1697 
    16981698        /* load remap file contents */ 
    16991699        _pico_load_file( remapFile,&remapBuffer,&remapBufSize ); 
    1700          
     1700 
    17011701        /* check result */ 
    17021702        if( remapBufSize == 0 ) 
     
    17041704        if( remapBufSize < 0 ) 
    17051705                return 0;       /* load failed: error */ 
    1706          
     1706 
    17071707        /* create a new pico parser */ 
    17081708        p = _pico_new_parser( remapBuffer, remapBufSize ); 
     
    17121712                _prm_error_return; 
    17131713        } 
    1714          
     1714 
    17151715        /* doo teh parse */ 
    17161716        while( 1 ) 
     
    17261726                        continue; 
    17271727                } 
    1728                  
     1728 
    17291729                /* block for quick material shader name remapping */ 
    17301730                /* materials { "m" (=>|->|=) "s" } */ 
     
    17421742                                picoShader_t    *shader; 
    17431743                                char                    *materialName; 
    1744                                  
    1745                                  
     1744 
     1745 
    17461746                                /* get material name */ 
    17471747                                if (_pico_parse( p,1 ) == NULL) break; 
     
    18081808                        /* check square closing bracket */ 
    18091809                        if (!_pico_parse_check( p,0,"]" )) 
    1810                                 _prm_error_return;                      
     1810                                _prm_error_return; 
    18111811 
    18121812                        /* try to find material by name */ 
     
    18651865                                        color[ 1 ] = (picoByte_t)v[ 1 ]; 
    18661866                                        color[ 2 ] = (picoByte_t)v[ 2 ]; 
     1867                                        color[ 3 ] = 1; 
    18671868 
    18681869                                        /* set new ambient color */ 
     
    18821883                                        color[ 1 ] = (picoByte_t)v[ 1 ]; 
    18831884                                        color[ 2 ] = (picoByte_t)v[ 2 ]; 
     1885                                        color[ 3 ] = 1; 
    18841886 
    18851887                                        /* set new ambient color */ 
     
    18991901                                        color[ 1 ] = (picoByte_t)v[ 1 ]; 
    19001902                                        color[ 2 ] = (picoByte_t)v[ 2 ]; 
     1903                                        color[ 3 ] = 1; 
    19011904 
    19021905                                        /* set new ambient color */ 
     
    19091912                /* end 'materials[' */ 
    19101913        } 
    1911          
     1914 
    19121915        /* free both parser and file buffer */ 
    19131916        _pico_free_parser( p ); 
     
    19251928*/ 
    19261929 
    1927 void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals,  
     1930void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, 
    19281931                                                        int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, 
    19291932                                                        picoShader_t* shader ) 
     
    19381941                workSurface = model->surface[i]; 
    19391942                if ( workSurface->shader == shader ) 
    1940                 {                       
     1943                { 
    19411944                        break; 
    19421945                } 
     
    19611964 
    19621965        /* add the triangle data to the surface */ 
    1963         for ( i = 0 ; i < 3 ; i++ )     
     1966        for ( i = 0 ; i < 3 ; i++ ) 
    19641967        { 
    19651968                /* get the next free spot in the index array */ 
     
    19711974                /* the vertex wasn't found, so create a new vertex in the pool from the data we have */ 
    19721975                if ( vertDataIndex == -1 ) 
    1973                 {                       
     1976                { 
    19741977                        /* find the next spot for a new vertex */ 
    1975                         vertDataIndex = PicoGetSurfaceNumVertexes ( workSurface );                      
     1978                        vertDataIndex = PicoGetSurfaceNumVertexes ( workSurface ); 
    19761979 
    19771980                        /* assign the data to it */ 
    19781981                        PicoSetSurfaceXYZ ( workSurface ,vertDataIndex , *xyz[i] ); 
    1979                         PicoSetSurfaceNormal ( workSurface , vertDataIndex , *normals[i] );                     
     1982                        PicoSetSurfaceNormal ( workSurface , vertDataIndex , *normals[i] ); 
    19801983 
    19811984                        /* make sure to copy over all available ST's and colors for the vertex */ 
     
    19901993                } 
    19911994 
    1992                 /* add this vertex to the triangle */           
     1995                /* add this vertex to the triangle */ 
    19931996                PicoSetSurfaceIndex ( workSurface , newVertIndex , vertDataIndex ); 
    1994         }       
    1995 } 
     1997        } 
     1998} 
  • GtkRadiant/trunk/libs/picomodel/pm_ase.c

    r183 r275  
    3838 
    3939/* uncomment when debugging this module */ 
    40 //#define DEBUG_PM_ASE  
     40//#define DEBUG_PM_ASE 
    4141//#define DEBUG_PM_ASE_EX 
    4242 
     
    6262        int subMtlId; 
    6363        picoShader_t* shader; 
    64          
     64 
    6565} aseSubMaterial_t; 
    6666 
     
    6969        struct aseMaterial_s* next; 
    7070        struct aseSubMaterial_s* subMtls; 
    71         int mtlId;              
     71        int mtlId; 
    7272} aseMaterial_t; 
    7373 
     
    199199void _ase_add_face( aseFace_t **list, aseFace_t **tail, aseFace_t *newFace ) 
    200200{ 
    201         aseFace_t* face = *list; 
    202         aseFace_t* tempFace = NULL; 
    203  
    204201        /* insert as head of list */ 
    205202        if ( !(*list) ) 
     
    210207        { 
    211208                (*tail)->next = newFace; 
    212         }       
     209        } 
    213210 
    214211        *tail = newFace; 
    215212        newFace->next = NULL; 
    216          
     213 
    217214        //tag the color indices so we can detect them and apply the default color to them 
    218215        newFace->index[6] = -1; 
     
    259256{ 
    260257        picoParser_t *p; 
    261          
    262          
     258 
     259 
    263260        /* quick data length validation */ 
    264261        if( bufSize < 80 ) 
    265262                return PICO_PMV_ERROR_SIZE; 
    266          
     263 
    267264        /* keep the friggin compiler happy */ 
    268265        *fileName = *fileName; 
    269          
     266 
    270267        /* create pico parser */ 
    271268        p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); 
    272269        if( p == NULL ) 
    273270                return PICO_PMV_ERROR_MEMORY; 
    274          
     271 
    275272        /* get first token */ 
    276273        if( _pico_parse_first( p ) == NULL) 
     
    278275                return PICO_PMV_ERROR_IDENT; 
    279276        } 
    280          
     277 
    281278        /* check first token */ 
    282279        if( _pico_stricmp( p->token, "*3dsmax_asciiexport" ) ) 
     
    285282                return PICO_PMV_ERROR_IDENT; 
    286283        } 
    287          
     284 
    288285        /* free the pico parser object */ 
    289286        _pico_free_parser( p ); 
    290          
     287 
    291288        /* file seems to be a valid ase file */ 
    292289        return PICO_PMV_OK; 
     
    330327                        } 
    331328                } 
    332                  
     329 
    333330                /* we pull the data from the surface using the facelist data */ 
    334331                for ( i = 0 ; i < 3 ; i ++ ) 
    335332                { 
    336333                        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 ] ); 
    338335                        st[i]     = (picoVec2_t*) PicoGetSurfaceST    ( surface, 0, face->index[ i + 3 ] ); 
    339                          
     336 
    340337                        if ( face->index [ i + 6] >= 0 ) 
    341338                        {