Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp	(revision 993)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp	(revision 996)
@@ -14,5 +14,4 @@
 	float	percent;
 
-	percent	=	10;
 
 	this->GenerarModeloV(upb);
@@ -20,4 +19,5 @@
 
 	//	Last updtate of the progress bar.
+	percent	=	100.0;
 	upb(percent);
 }
@@ -32,7 +32,7 @@
 	long 		int							k;
 	long 		int							i;
-	unsigned long 		int					t;
+	unsigned long 		int		t;
 	long 		int							r;
-	unsigned long 		int					v;
+	unsigned long 		int		v;
 	long 		int							p0;
 	long 		int							lod	=	0;
@@ -45,8 +45,9 @@
 	LODChanges							listaCambios;
 	float										percent;
+	float										increment;
 	long		int							update;
 
-	//	Guardamos copia original.
-	TiraOriginal	=	this->cStrips;
+	//	Saves original copy.
+	TiraOriginal			=	this->cStrips;
 
 	this->MARCAVACIO	=	int(10 * this->cVerts.size());
@@ -54,13 +55,15 @@
 	listaCambios.clear();
 
-	update	=	0;
+	//	Initialize increment.
+	increment	=	0.0;
 	
 	for	(lod = 0; ((this->cVerts[lod].Next) != -1); lod++)
 	{
-		update++;
-	}
-
-	update	=	update	/ 20;
-	percent	=	0.5;
+		increment	+=	1.0;
+	}
+
+	update		=	-1;
+	increment	=	(float)30.0	/	increment;
+	percent		=	1.0;
 	
 	this->LodsDisp	=	this->TOTALCAMBIOS	=	lod;
@@ -68,11 +71,11 @@
 	pCambios[0]			=	0;
 	
-	//	5 min.
 	for	(lod = 0; ((this->cVerts[lod].Next) != -1); lod++)
 	{
-		if ((lod % update) == 0)
-		{
+		if (update	!= (int)(increment * lod))
+		{
+			update	=	(int)(increment * lod);
 			upb(percent);
-		}
+		}			
 		
 		RegsCambios				=	0;
@@ -81,16 +84,15 @@
 		for(t = 0; t < this->cStrips.size(); t++)
 		{
-			//Inicializar
+			//	Initialize.
 			regLOD.strip	=	this->MARCAVACIO;
 
-			//PRIMERO: los cambios de los vertices
+			//	Change vertices.
 			totalRegs		=	0;
 			
 			for (v = 0; v < this->cStrips[t].size(); v++)
 			{
-				//	RESOLUCION VARIABLE MAL.
 				if (this->cStrips[t][v] == lod)	
 				{ 
-					//Gestion de Tiras.
+					//	Strips.
 					if (regLOD.strip == this->MARCAVACIO)
 					{
@@ -108,6 +110,6 @@
 			regLOD.nP	=	char(totalRegs);
 
-			//SEGUNDO: Simplificaciones de Longitud 1
-			// Cambio para simplifaciones de nivel 1 mayores de 2
+			//	Simplifications length 1.
+			//	Changes for simplification of level 1 to greater than 2.
 			totalRegs	=	0;
 			i					=	0;
@@ -123,5 +125,5 @@
 						)
 				{ 
-					//	Salvar el inicio de la repeticion.
+					//	Saves beginning of repetition.
 					if (!r)
 					{
@@ -271,19 +273,22 @@
 	long	int						c2;
 	//	Progress bar
-	float	percent;
+	float			percent;
+	float			increment;
 	long	int	update;
 
 	bEncontrado = false;
 
-	c1	=	0;
-	c2	=	0;
-	
-	update	=	long(geoMeshSQ->mSteps.size() / 20);
-	percent	=	0.5;
+	c1					=	0;
+	c2					=	0;
+	
+	update			=	-1;
+	percent			=	1.0;
+	increment		=	(float)(10.0) / (float)(geoMeshSQ->mSteps.size());
 	
 	for	(i = 0; i < this->geoMeshSQ->mSteps.size(); i++)
 	{
-		if ((i % update) == 0)
-		{
+		if (update	!= (int)(i * increment))
+		{
+			update	=	(int)(i * increment);
 			upb(percent);
 		}
@@ -305,16 +310,17 @@
 	this->NumVertsRepetidos = c2;
 
-	update	=	long(Ordenacion.size() / 20);
-	percent	=	0.5;
-
-	//	1 min.
+	update		=	-1;
+	increment	=	(float)(10.0) / (float)(Ordenacion.size());
+	percent		=	1.0;
+
 	//	Change all vertices that have x != 0.
-	for(i=0;i<Ordenacion.size();i++)
-	{
-		if ((i % update) == 0)
-		{
+	for(i	=	0;	i < Ordenacion.size();	i++)
+	{
+		if (update	!= (int)(i * increment))
+		{
+			update	= (int)(i * increment);
 			upb(percent);
 		}
-
+		
 		Ord	=	&(Ordenacion[i]);
 
@@ -342,6 +348,7 @@
 	}
 
-	update	=	long(Ordenacion.size() / 20);
-	percent	=	0.5;
+	update		=	-1;
+	increment	=	(float)(10.0) / (float)(Ordenacion.size());
+	percent		=	1.0;
 
 	//	3 seg.
@@ -349,6 +356,7 @@
 	for(i = 0; i < Ordenacion.size(); i++)
 	{
-		if ((i % update) == 0)
-		{
+		if (update	!=	(int)(i * increment))
+		{
+			update	=	(int)(i * increment);
 			upb(percent);
 		}
@@ -386,6 +394,7 @@
 	}
 
-	update	=	long(Ordenacion.size() / 20);
-	percent	=	0.5;
+	update		=	-1;
+	increment	=	(float)(10.0)	/	(float)(Ordenacion.size());
+	percent		=	1.0;
 	
 	//	2 min.
@@ -393,9 +402,10 @@
 	for (i = 0; i < Ordenacion.size(); i++)
 	{
-		if ((i % update) == 0)
-		{
+		if (update	!=	(int)(i * increment))
+		{
+			update	=	(int)(i * increment);
 			upb(percent);
 		}
-
+		
 		v	=	Ordenacion[i].vQslimNext;
 
@@ -430,6 +440,7 @@
 	}
 
-	update	=	long(NuevosVerts.size() / 40);
-	percent	=	0.5;
+	update		=	-1;
+	increment	=	(float)(20.0) / (float)(NuevosVerts.size());
+	percent		=	1.0;
 
 	k	=	0;
@@ -439,9 +450,10 @@
 	for(v = 0; v < NuevosVerts.size(); v++)
 	{
-		if ((v % update) == 0)
-		{
+		if (update != (int)(v * increment))
+		{
+			update	=	(int)(v * increment);
 			upb(percent);
 		}
-
+		
 		for(t = 0; t < this->cStrips.size(); t++)
 		{
@@ -469,7 +481,7 @@
 	this->cVerts	=	NuevosVerts;
 
-	percent	=	10;
-	upb(percent);
-}		
+	//percent	=	100.0;
+	//upb(percent);
+}
 
 //-----------------------------------------------------------------------------
@@ -541,6 +553,6 @@
 {
 	unsigned int	i, j;
-	int k=0;
-	char	simp[256];
+	int						k	=	0;
+	char					simp[256];
 
 	//******************  1º CONSTRUCCION DEL FICHERO.LOD *********************
@@ -1114,5 +1126,5 @@
 }
 
-///	GetMesh: Return de current Mesh.
+//	GetMesh: Return de current Mesh.
 Mesh	*	LodStripsConstructor::GetMesh()
 {
