]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3data/3dslib.c
another way to do 265c42d
[xonotic/netradiant.git] / tools / quake3 / q3data / 3dslib.c
index cecfb621e3eed1bf30b020205c933d5fe9737f07..3e37f5e4b7217e15c9193849610c1e156fc86c65 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 #include <assert.h>
 #include "q3data.h"
@@ -33,8 +33,7 @@ static qboolean s_verbose;
 
 static char s_buffer[1000000];
 
-static int ReadString( FILE *fp, char *buffer )
-{
+static int ReadString( FILE *fp, char *buffer ){
        int i = 0;
        int bytesRead = 0;
 
@@ -48,17 +47,17 @@ static int ReadString( FILE *fp, char *buffer )
        return bytesRead;
 }
 
-static int ReadChunkAndLength( FILE *fp, short *chunk, long *len )
-{
-       if ( fread( chunk, sizeof( short ), 1, fp ) != 1 )
+static int ReadChunkAndLength( FILE *fp, unsigned short *chunk, long *len ){
+       if ( fread( chunk, sizeof( short ), 1, fp ) != 1 ) {
                return 0;
-       if ( fread( len, sizeof( long ), 1, fp ) != 1 )
+       }
+       if ( fread( len, sizeof( long ), 1, fp ) != 1 ) {
                Error( "Unexpected EOF found" );
+       }
        return 1;
 }
 
-static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen )
-{
+static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen ){
        unsigned short chunkID;
        long chunkLen;
        long bytesRead = 0;
@@ -75,13 +74,13 @@ static void LoadMapName( FILE *fp, char *buffer, int thisChunkLen )
                        break;
                }
                bytesRead += chunkLen;
-               if ( bytesRead >= thisChunkLen )
+               if ( bytesRead >= thisChunkLen ) {
                        return;
+               }
        }
 }
 
-static void LoadMaterialList( FILE *fp, long thisChunkLen, _3DSMaterial_t *pMat )
-{
+static void LoadMaterialList( FILE *fp, long thisChunkLen, _3DSMaterial_t *pMat ){
        long chunkLen;
        unsigned short chunkID;
        long bytesRead = 0;
@@ -91,106 +90,118 @@ static void LoadMaterialList( FILE *fp, long thisChunkLen, _3DSMaterial_t *pMat
 
        memset( &mat, 0, sizeof( mat ) );
 
-       if ( s_verbose )
+       if ( s_verbose ) {
                printf( "    >>> MATERIAL LIST\n" );
+       }
 
        while ( ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
        {
                switch ( chunkID )
                {
-                       case _3DS_CHUNK_MAT_NAME:
-                               fread( mat.name, chunkLen - 6, 1, fp );
-                               if ( s_verbose )
-                                       printf( "        found mat name '%s'\n", mat.name );
-                               break;
-                       case _3DS_CHUNK_TEXMAP:
-                               LoadMapName( fp, mat.texture, chunkLen - 6 );
-                               if ( s_verbose )
-                                       printf( "        found texture '%s'\n", mat.texture );
-                               break;
-                       case _3DS_CHUNK_SPECMAP:
-                               LoadMapName( fp, mat.specular, chunkLen - 6 );
-                               if ( s_verbose )
-                                       printf( "        found specular map '%s'\n", mat.specular );
-                               break;
-                       case _3DS_CHUNK_OPACMAP:
-                               LoadMapName( fp, mat.opacity, chunkLen - 6 );
-                               if ( s_verbose )
-                                       printf( "        found opacity map '%s'\n", mat.opacity );
-                               break;
-                       case _3DS_CHUNK_REFLMAP:
-                               LoadMapName( fp, mat.reflection, chunkLen - 6 );
-                               if ( s_verbose )
-                                       printf( "        found reflection map '%s'\n", mat.reflection );
-                               break;
-                       case _3DS_CHUNK_BUMPMAP:
-                               LoadMapName( fp, mat.bump, chunkLen - 6 );
-                               if ( s_verbose )
-                                       printf( "        found bump map '%s'\n", mat.bump );
-                               break;
-                       default:
-                               fread( s_buffer, chunkLen - 6, 1, fp );
-                               break;
+               case _3DS_CHUNK_MAT_NAME:
+                       fread( mat.name, chunkLen - 6, 1, fp );
+                       if ( s_verbose ) {
+                               printf( "        found mat name '%s'\n", mat.name );
+                       }
+                       break;
+               case _3DS_CHUNK_TEXMAP:
+                       LoadMapName( fp, mat.texture, chunkLen - 6 );
+                       if ( s_verbose ) {
+                               printf( "        found texture '%s'\n", mat.texture );
+                       }
+                       break;
+               case _3DS_CHUNK_SPECMAP:
+                       LoadMapName( fp, mat.specular, chunkLen - 6 );
+                       if ( s_verbose ) {
+                               printf( "        found specular map '%s'\n", mat.specular );
+                       }
+                       break;
+               case _3DS_CHUNK_OPACMAP:
+                       LoadMapName( fp, mat.opacity, chunkLen - 6 );
+                       if ( s_verbose ) {
+                               printf( "        found opacity map '%s'\n", mat.opacity );
+                       }
+                       break;
+               case _3DS_CHUNK_REFLMAP:
+                       LoadMapName( fp, mat.reflection, chunkLen - 6 );
+                       if ( s_verbose ) {
+                               printf( "        found reflection map '%s'\n", mat.reflection );
+                       }
+                       break;
+               case _3DS_CHUNK_BUMPMAP:
+                       LoadMapName( fp, mat.bump, chunkLen - 6 );
+                       if ( s_verbose ) {
+                               printf( "        found bump map '%s'\n", mat.bump );
+                       }
+                       break;
+               default:
+                       fread( s_buffer, chunkLen - 6, 1, fp );
+                       break;
                }
 
                bytesRead += chunkLen;
 
-               if ( bytesRead >= thisChunkLen )
+               if ( bytesRead >= thisChunkLen ) {
                        break;
+               }
        }
 
        Q_getwd( curdir );
 
-       if ( mat.texture[0] )
-       {
+       if ( mat.texture[0] ) {
                sprintf( buffer, "%s%s", curdir, mat.texture );
-               if ( strstr( buffer, gamedir + 1 ) )
+               if ( strstr( buffer, gamedir + 1 ) ) {
                        strcpy( mat.texture, strstr( buffer, gamedir + 1 ) + strlen( gamedir ) - 1 );
-               else
+               }
+               else{
                        strcpy( mat.texture, buffer );
+               }
        }
 
-       if ( mat.specular[0] )
-       {
+       if ( mat.specular[0] ) {
                sprintf( buffer, "%s%s", curdir, mat.specular );
-               if ( strstr( buffer, gamedir + 1 ) )
+               if ( strstr( buffer, gamedir + 1 ) ) {
                        strcpy( mat.specular, strstr( buffer, gamedir + 1 ) + strlen( gamedir ) - 1 );
-               else
+               }
+               else{
                        strcpy( mat.specular, buffer );
+               }
        }
 
-       if ( mat.bump[0] )
-       {
+       if ( mat.bump[0] ) {
                sprintf( buffer, "%s%s", curdir, mat.bump );
-               if ( strstr( buffer, gamedir + 1 ) )
+               if ( strstr( buffer, gamedir + 1 ) ) {
                        strcpy( mat.bump, strstr( buffer, gamedir + 1 ) + strlen( gamedir ) - 1 );
-               else
+               }
+               else{
                        strcpy( mat.bump, buffer );
+               }
        }
 
-       if ( mat.reflection[0] )
-       {
+       if ( mat.reflection[0] ) {
                sprintf( buffer, "%s%s", curdir, mat.reflection );
-               if ( strstr( buffer, gamedir + 1 ) )
+               if ( strstr( buffer, gamedir + 1 ) ) {
                        strcpy( mat.reflection, strstr( buffer, gamedir + 1 ) + strlen( gamedir ) - 1 );
-               else
+               }
+               else{
                        strcpy( mat.reflection, buffer );
+               }
        }
 
-       if ( mat.opacity[0] )
-       {
+       if ( mat.opacity[0] ) {
                sprintf( buffer, "%s%s", curdir, mat.opacity );
-               if ( strstr( buffer, gamedir + 1 ) )
+               if ( strstr( buffer, gamedir + 1 ) ) {
                        strcpy( mat.opacity, strstr( buffer, gamedir + 1 ) + strlen( gamedir ) - 1 );
-               else
+               }
+               else{
                        strcpy( mat.opacity, buffer );
+               }
        }
 
        *pMat = mat;
 }
 
-static void LoadMeshMaterialGroup( FILE *fp, long thisChunkLen, _3DSMeshMaterialGroup_t *pMMG )
-{
+static void LoadMeshMaterialGroup( FILE *fp, long thisChunkLen, _3DSMeshMaterialGroup_t *pMMG ){
        _3DSMeshMaterialGroup_t mmg;
 
        memset( &mmg, 0, sizeof( mmg ) );
@@ -201,8 +212,7 @@ static void LoadMeshMaterialGroup( FILE *fp, long thisChunkLen, _3DSMeshMaterial
        mmg.pFaces = malloc( sizeof( mmg.pFaces[0] ) * mmg.numFaces );
        fread( mmg.pFaces, sizeof( mmg.pFaces[0] ), mmg.numFaces, fp );
 
-       if ( s_verbose )
-       {
+       if ( s_verbose ) {
                printf( "    >>> MESH MATERIAL GROUP '%s' (%d faces)\n", mmg.name, mmg.numFaces );
 
                {
@@ -218,8 +228,7 @@ static void LoadMeshMaterialGroup( FILE *fp, long thisChunkLen, _3DSMeshMaterial
        *pMMG = mmg;
 }
 
-static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pTO )
-{
+static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pTO ){
        long chunkLen;
        unsigned short chunkID;
        int i = 0;
@@ -230,8 +239,9 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
 
        memset( &triObj, 0, sizeof( triObj ) );
 
-       if ( s_verbose )
+       if ( s_verbose ) {
                printf( "        >>> NAMED TRI OBJECT\n" );
+       }
 
        while ( ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
        {
@@ -250,8 +260,7 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
                        fread( triObj.pFaces, sizeof( triObj.pFaces[0] ), triObj.numFaces, fp );
                        bytesRead += sizeof( triObj.numFaces ) + triObj.numFaces * sizeof( triObj.pFaces[0] ) + 6;
 
-                       if ( s_verbose )
-                       {
+                       if ( s_verbose ) {
                                printf( "            found face array with %d faces\n", triObj.numFaces );
                                for ( i = 0; i < triObj.numFaces; i++ )
                                {
@@ -280,8 +289,7 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
                                triObj.pPoints[i].z = z;
                        }
 
-                       if ( s_verbose )
-                       {
+                       if ( s_verbose ) {
                                printf( "            found point array with %d points\n", triObj.numPoints );
                                for ( i = 0; i < triObj.numPoints; i++ )
                                {
@@ -295,8 +303,7 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
                        fread( triObj.pTexVerts, sizeof( triObj.pTexVerts[0] ), triObj.numTexVerts, fp );
                        bytesRead += sizeof( triObj.numTexVerts ) + sizeof( triObj.pTexVerts[0] ) * triObj.numTexVerts + 6;
 
-                       if ( s_verbose )
-                       {
+                       if ( s_verbose ) {
                                printf( "            found tex vert array with %d tex verts\n", triObj.numTexVerts );
                                for ( i = 0; i < triObj.numTexVerts; i++ )
                                {
@@ -310,13 +317,13 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
                        break;
                }
 
-               if ( bytesRead >= thisChunkLen )
+               if ( bytesRead >= thisChunkLen ) {
                        break;
+               }
        }
        *pTO = triObj;
 
-       if ( numMeshMaterialGroups == 0 )
-       {
+       if ( numMeshMaterialGroups == 0 ) {
                numMeshMaterialGroups = 1;
                strcpy( meshMaterialGroups[0].name, "(null)" );
                if ( pTO->numTexVerts ) {
@@ -338,8 +345,7 @@ static void LoadNamedTriObject( FILE *fp, long thisChunkLen, _3DSTriObject_t *pT
        assert( numMeshMaterialGroups <= 1 );
 }
 
-static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO )
-{
+static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO ){
        long chunkLen;
        unsigned short chunkID;
        int i = 0;
@@ -352,8 +358,9 @@ static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO
 
        bytesRead += ReadString( fp, name );
 
-       if ( s_verbose )
+       if ( s_verbose ) {
                printf( "    >>> NAMED OBJECT '%s'\n", name );
+       }
 
        while ( ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
        {
@@ -370,8 +377,9 @@ static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO
 
                bytesRead += chunkLen;
 
-               if ( bytesRead >= thisChunkLen )
+               if ( bytesRead >= thisChunkLen ) {
                        break;
+               }
        }
 
        strcpy( pNO->name, name );
@@ -382,8 +390,7 @@ static void LoadNamedObject( FILE *fp, long thisChunkLen, _3DSNamedObject_t *pNO
        assert( numTriObjects <= 1 );
 }
 
-static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC )
-{
+static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){
        unsigned short chunkID;
        long chunkLen;
        long bytesRead = 0;
@@ -396,8 +403,9 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC )
 
        memset( &editChunk, 0, sizeof( editChunk ) );
 
-       if ( s_verbose )
+       if ( s_verbose ) {
                printf( ">>> EDIT CHUNK\n" );
+       }
 
        while ( ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
        {
@@ -409,8 +417,9 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC )
                        break;
                case _3DS_CHUNK_NAMED_OBJECT:
                        LoadNamedObject( fp, chunkLen - 6, &namedObjects[numNamedObjects] );
-                       if ( namedObjects[numNamedObjects].numTriObjects != 0 )
+                       if ( namedObjects[numNamedObjects].numTriObjects != 0 ) {
                                ++numNamedObjects;
+                       }
                        break;
                case _3DS_CHUNK_MESH_VERSION:
                default:
@@ -420,12 +429,12 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC )
 
                bytesRead += chunkLen;
 
-               if ( bytesRead >= thisChunkLen )
+               if ( bytesRead >= thisChunkLen ) {
                        break;
+               }
        }
 
-       if ( numMaterials == 0 )
-       {
+       if ( numMaterials == 0 ) {
                numMaterials = 1;
                strcpy( mat[0].name, "(null)" );
                printf( "Warning: no material definitions found\n" );
@@ -440,45 +449,47 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC )
        memcpy( pEC->pNamedObjects, namedObjects, numNamedObjects * sizeof( namedObjects[0] ) );
 }
 
-static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose )
-{
+static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ){
        FILE *fp;
        unsigned short chunkID;
-       long  chunkLen;
+       long chunkLen;
        _3DSEditChunk_t editChunk;
 
        s_verbose = verbose;
 
-       if ( ( fp = fopen( filename, "rb" ) ) == 0 )
+       if ( ( fp = fopen( filename, "rb" ) ) == 0 ) {
                Error( "Unable to open '%s'", filename );
+       }
 
        // read magic number
        if ( ( fread( &chunkID, sizeof( short ), 1, fp ) != 1 ) ||
-                ( LittleShort( chunkID ) != _3DS_CHUNK_MAGIC ) )
-       {
+                ( LittleShort( chunkID ) != _3DS_CHUNK_MAGIC ) ) {
                Error( "Missing or incorrect magic number in '%s'", filename );
        }
-       if ( fread( &chunkLen, sizeof( chunkLen ), 1, fp ) != 1 )
+       if ( fread( &chunkLen, sizeof( chunkLen ), 1, fp ) != 1 ) {
                Error( "Unexpected EOF encountered in '%s'", filename );
+       }
        // version number
-       if ( !ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
+       if ( !ReadChunkAndLength( fp, &chunkID, &chunkLen ) ) {
                Error( "Missing version number in '%s'", filename );
-       if ( fread( s_buffer, chunkLen - 6, 1, fp ) != 1 )
+       }
+       if ( fread( s_buffer, chunkLen - 6, 1, fp ) != 1 ) {
                Error( "Unexpected EOF encountered in '%s'", filename );
+       }
 
        while ( ReadChunkAndLength( fp, &chunkID, &chunkLen ) )
        {
                switch ( chunkID )
                {
-                       case _3DS_CHUNK_EDIT:
-                               LoadEditChunk( fp, chunkLen - 6, &editChunk );
-                               break;
-                       case _3DS_CHUNK_KEYFRAME_DATA:
-                               fread( s_buffer, chunkLen - 6, 1, fp );
-                               break;
-                       default:
-                               fread( s_buffer, chunkLen - 6, 1, fp );
-                               break;
+               case _3DS_CHUNK_EDIT:
+                       LoadEditChunk( fp, chunkLen - 6, &editChunk );
+                       break;
+               case _3DS_CHUNK_KEYFRAME_DATA:
+                       fread( s_buffer, chunkLen - 6, 1, fp );
+                       break;
+               default:
+                       fread( s_buffer, chunkLen - 6, 1, fp );
+                       break;
                }
        }
 
@@ -487,10 +498,9 @@ static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose )
        p3DS->editChunk = editChunk;
 }
 
-static void ComputeNormals( _3DSTriObject_t *pTO, triangle_t *pTris )
-{
+static void ComputeNormals( _3DSTriObject_t *pTO, triangle_t *pTris ){
        vec3_t faceNormals[POLYSET_MAXTRIANGLES];
-       vec3_t vertexNormals[POLYSET_MAXTRIANGLES*3];
+       vec3_t vertexNormals[POLYSET_MAXTRIANGLES * 3];
        vec3_t side0, side1, facenormal;
        int f, v;
 
@@ -518,8 +528,7 @@ static void ComputeNormals( _3DSTriObject_t *pTO, triangle_t *pTris )
                {
                        if ( ( pTO->pFaces[f].a == v ) ||
                                 ( pTO->pFaces[f].b == v ) ||
-                                ( pTO->pFaces[f].c == v ) )
-                       {
+                                ( pTO->pFaces[f].c == v ) ) {
                                vertexNormals[v][0] += faceNormals[f][0];
                                vertexNormals[v][1] += faceNormals[f][1];
                                vertexNormals[v][2] += faceNormals[f][2];
@@ -547,8 +556,7 @@ static void ComputeNormals( _3DSTriObject_t *pTO, triangle_t *pTris )
 /*
 ** void _3DS_LoadPolysets
 */
-void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose )
-{
+void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose ){
        _3DS_t _3ds;
        int numPolysets;
        polyset_t *pPSET;
@@ -579,14 +587,17 @@ void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets,
                strcpy( pPSET[i].name, _3ds.editChunk.pNamedObjects[i].name );
 
                strcpy( matnamebuf, filename );
-               if ( strrchr( matnamebuf, '/' ) )
-                       *( strrchr( matnamebuf, '/' ) + 1 )= 0;
+               if ( strrchr( matnamebuf, '/' ) ) {
+                       *( strrchr( matnamebuf, '/' ) + 1 ) = 0;
+               }
                strcat( matnamebuf, pTO->pMeshMaterialGroups[0].name );
 
-               if ( strstr( matnamebuf, gamedir ) )
+               if ( strstr( matnamebuf, gamedir ) ) {
                        strcpy( pPSET[i].materialname, strstr( matnamebuf, gamedir ) + strlen( gamedir ) );
-               else
+               }
+               else{
                        strcpy( pPSET[i].materialname, pTO->pMeshMaterialGroups[0].name );
+               }
 
                assert( pPSET[i].numtriangles < POLYSET_MAXTRIANGLES );
 
@@ -608,16 +619,15 @@ void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets,
                        tri->verts[2][1] = pTO->pPoints[i2].y;
                        tri->verts[2][2] = pTO->pPoints[i2].z;
 /*
-                       for ( k = 0; k < 3; k++ )
-                       {
-                               tri->colors[0][k] = 1;
-                               tri->colors[1][k] = 1;
-                               tri->colors[2][k] = 1;
-                       }
-*/
-
-                       if ( pTO->pTexVerts )
-                       {
+            for ( k = 0; k < 3; k++ )
+            {
+                tri->colors[0][k] = 1;
+                tri->colors[1][k] = 1;
+                tri->colors[2][k] = 1;
+            }
+ */
+
+                       if ( pTO->pTexVerts ) {
                                tri->texcoords[0][0] = pTO->pTexVerts[i0].s;
                                tri->texcoords[0][1] = 1.0f - pTO->pTexVerts[i0].t;
                                tri->texcoords[1][0] = pTO->pTexVerts[i1].s;
@@ -639,7 +649,7 @@ void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets,
        {
                // unique vertices based solely on vertex position
                ComputeNormals( &_3ds.editChunk.pNamedObjects[i].pTriObjects[0],
-                                                pPSET[i].triangles );
+                                               pPSET[i].triangles );
        }
 #endif