Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp	(revision 2127)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp	(revision 2341)
@@ -14,4 +14,6 @@
 #include	<cctype>
 #include	<map>
+#include "GeoLodStripsLibrary.h"
+#include "GeoLodStripsConstructor.h"
 
 using namespace Geometry;
@@ -165,5 +167,4 @@
 	unsigned	short	headerID;
 	size_t					i;
-	//float						aux;
 	size_t					k;
 	bool						found;
@@ -462,5 +463,4 @@
 	}
 	
-
 	if (idx32bit)
 	{
@@ -561,5 +561,4 @@
 		}
 	}
-
 }
 
@@ -597,5 +596,4 @@
 		
 		jumpChunk(f);
-
 	}
 }
@@ -606,36 +604,47 @@
 void GeoMeshLoader::readSubMeshNameTable(FILE	*f, Mesh	*geoMesh)
 {
-		unsigned	short	chunkID;
-		unsigned	short	subMeshIndex;
-		char						string[255];
-
+	unsigned	short	chunkID;
+	unsigned	short	subMeshIndex;
+	char						string[255];
+
+	if (!feof(f))
+	{
+		chunkID	=	readChunk(f);
+
+		while	(!feof(f) && (chunkID == M_SUBMESH_NAME_TABLE_ELEMENT))
+		{
+			//	Debug.
+			cout	<<	"		M_SUBMESH_NAME_TABLE_ELEMENT"
+				<<	endl;
+
+			//	Read in the index of the submesh.
+			fread(&subMeshIndex,sizeof(unsigned short),1,f);
+
+			//	Read in the String and map it to its index.
+			fgets(string,255,f);
+
+			string[strlen(string) - 1]	=	'\0';
+
+			//	Gets the submesh name.
+			strcpy(geoMesh->mSubMesh[subMeshIndex].mName,string);
+
+			cout	<<	"--> SubMesh "
+				<<	subMeshIndex
+				<<	": "
+				<<	string
+				<<	endl;
+
+			// If we're not end of file get the next chunk ID.
+			if (!feof(f))
+			{
+				chunkID = readChunk(f);
+			}
+		}
 		if (!feof(f))
 		{
-			chunkID	=	readChunk(f);
-			
-			while	(!feof(f) && (chunkID == M_SUBMESH_NAME_TABLE_ELEMENT ))
-			{
-				//	Debug.
-				cout	<<	"		M_SUBMESH_NAME_TABLE_ELEMENT"
-							<<	endl;
-				
-				// Read in the index of the submesh.
-				fread(&subMeshIndex,sizeof(unsigned short),1,f);
-				
-				// Read in the String and map it to its index.
-				fgets(string,255,f);
-
-				// If we're not end of file get the next chunk ID.
-				if (!feof(f))
-				{
-					chunkID = readChunk(f);
-				}
-			}
-			if (!feof(f))
-			{
-				// Backpedal back to start of chunk.
-				fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
-			}
-		}
+			// Backpedal back to start of chunk.
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+		}
+	}
 }
 
@@ -643,8 +652,4 @@
 //	Read a mesh file.
 //-------------------------------------------------------------------------
-
-#include "GeoLodStripsLibrary.h"
-#include "GeoLodStripsConstructor.h"
-
 void GeoMeshLoader::readMesh(FILE	*f, Mesh	*geoMesh, int option)
 {
@@ -667,19 +672,21 @@
 		chunkID	=	readChunk(f);
 
-		while(!feof(f) &&
-				(chunkID == M_GEOMETRY ||
-				 chunkID == M_SUBMESH ||
-				 chunkID == M_MESH_SKELETON_LINK ||
-				 chunkID == M_MESH_BONE_ASSIGNMENT ||
-				 chunkID == M_MESH_LOD ||
-				 chunkID == M_MESH_BOUNDS ||
-				 chunkID == M_SUBMESH_NAME_TABLE ||
-				 chunkID == M_EDGE_LISTS ||
-				 chunkID == 0xabcd || 
-				 chunkID == 0xdcba))
+		while	(!feof(f) &&
+				(chunkID == M_GEOMETRY							||
+				 chunkID == M_SUBMESH								||
+				 chunkID == M_MESH_SKELETON_LINK		||
+				 chunkID == M_MESH_BONE_ASSIGNMENT	||
+				 chunkID == M_MESH_LOD							||
+				 chunkID == M_MESH_BOUNDS						||
+				 chunkID == M_SUBMESH_NAME_TABLE		||
+				 chunkID == M_EDGE_LISTS						||
+				 chunkID == M_LODSTRIPS							||
+				 chunkID == M_LODTREES							||
+				 chunkID == M_POSES									||
+				 chunkID == M_ANIMATIONS))
 		{
 			switch(chunkID)
 			{
-				case 0xabcd:
+				case M_LODSTRIPS:
 					
 					//	Debug.
@@ -741,5 +748,6 @@
 					break;
 
-				case 0xdcba:
+				case M_LODTREES:
+
 					cout << "LODTREES_Chunk" << endl;
 					treesimpseq = new Geometry::TreeSimplificationSequence;
@@ -761,5 +769,4 @@
 					break;
 
-
 				case M_GEOMETRY:
 
@@ -792,5 +799,4 @@
 					cout	<<	"		M_MESH_SKELETON_LINK  "
 								<<	endl;
-								
 
 					readSkeletonLink(f, geoMesh, option);
@@ -799,8 +805,4 @@
 
 				case M_MESH_BONE_ASSIGNMENT:
-
-					//	Debug.
-					//cout	<<	"		M_MESH_BONE_ASSIGNMENT  "
-					//			<<	endl;
 
 					readMeshBoneAssignment(f, geoMesh, option);
@@ -823,5 +825,4 @@
 								<<	endl;
 
-					//jumpChunk(f);
 					readMeshBounds(f, geoMesh, option);
 					break;
@@ -844,4 +845,22 @@
 					jumpChunk(f);
 					break;
+
+				case M_POSES:
+
+					//	Debug.
+					cout	<<	"		M_POSES "
+								<<	endl;
+
+					jumpChunk(f);
+					break;
+
+				case M_ANIMATIONS:
+
+					//	Debug.
+					cout	<<	"		M_ANIMATIONS "
+								<<	endl;
+
+					jumpChunk(f);
+					break;
 			}
 
@@ -866,7 +885,5 @@
 		}
 	}
-
-}
-
+}
 
 //-------------------------------------------------------------------------
@@ -879,5 +896,4 @@
 	size_t	strip_count;
 	size_t	tailIndex;
-	//size_t	tail;
 
 	head_found							=	false;
@@ -1476,4 +1492,6 @@
 	{
 		fgets(geoMesh->mSkeletonName,255,f);
+
+		geoMesh->mSkeletonName[strlen(geoMesh->mSkeletonName) - 1]	=	'\0';
 		
 		geoMesh->hasSkeleton	=	true;
