about summary refs log tree commit diff
path: root/src/game/client/render_map.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-04-13 20:37:12 +0200
committeroy <Tom_Adams@web.de>2011-04-13 20:37:12 +0200
commit06115dd49dca2f8eb5f14606437e8fd20037cc4d (patch)
tree5ec4bca6158319b3f5285d7689c5f94ae8da8c93 /src/game/client/render_map.cpp
parent63e059b8fff6498e42b765a1dca000e53005ea77 (diff)
downloadzcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.tar.gz
zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.zip
added "Whitespace and line Endings cleanup" by GreYFoX
Diffstat (limited to 'src/game/client/render_map.cpp')
-rw-r--r--src/game/client/render_map.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp
index bffc4c2d..33cc1c7d 100644
--- a/src/game/client/render_map.cpp
+++ b/src/game/client/render_map.cpp
@@ -16,7 +16,7 @@ void CRenderTools::RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Cha
 		pResult[3] = 0;
 		return;
 	}
-	
+
 	if(NumPoints == 1)
 	{
 		pResult[0] = fx2f(pPoints[0].m_aValues[0]);
@@ -25,7 +25,7 @@ void CRenderTools::RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Cha
 		pResult[3] = fx2f(pPoints[0].m_aValues[3]);
 		return;
 	}
-	
+
 	Time = fmod(Time, pPoints[NumPoints-1].m_Time/1000.0f)*1000.0f;
 	for(int i = 0; i < NumPoints-1; i++)
 	{
@@ -50,18 +50,18 @@ void CRenderTools::RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Cha
 			{
 				// linear
 			}
-					
+
 			for(int c = 0; c < Channels; c++)
 			{
 				float v0 = fx2f(pPoints[i].m_aValues[c]);
 				float v1 = fx2f(pPoints[i+1].m_aValues[c]);
 				pResult[c] = v0 + (v1-v0) * a;
 			}
-			
+
 			return;
 		}
 	}
-	
+
 	pResult[0] = fx2f(pPoints[NumPoints-1].m_aValues[0]);
 	pResult[1] = fx2f(pPoints[NumPoints-1].m_aValues[1]);
 	pResult[2] = fx2f(pPoints[NumPoints-1].m_aValues[2]);
@@ -85,7 +85,7 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 	for(int i = 0; i < NumQuads; i++)
 	{
 		CQuad *q = &pQuads[i];
-		
+
 		float r=1, g=1, b=1, a=1;
 
 		if(q->m_ColorEnv >= 0)
@@ -96,17 +96,17 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 			g = aChannels[1];
 			b = aChannels[2];
 			a = aChannels[3];
-		}		
-		
+		}
+
 		bool Opaque = false;
 		if(a < 0.01f || (q->m_aColors[0].a < 0.01f && q->m_aColors[1].a < 0.01f && q->m_aColors[2].a < 0.01f && q->m_aColors[3].a < 0.01f))
 			Opaque = true;
-			
+
 		if(Opaque && !(RenderFlags&LAYERRENDERFLAG_OPAQUE))
 			continue;
 		if(!Opaque && !(RenderFlags&LAYERRENDERFLAG_TRANSPARENT))
 			continue;
-		
+
 		Graphics()->QuadsSetSubsetFree(
 			fx2f(q->m_aTexcoords[0].x), fx2f(q->m_aTexcoords[0].y),
 			fx2f(q->m_aTexcoords[1].x), fx2f(q->m_aTexcoords[1].y),
@@ -117,7 +117,7 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 		float OffsetX = 0;
 		float OffsetY = 0;
 		float Rot = 0;
-		
+
 		// TODO: fix this
 		if(q->m_PosEnv >= 0)
 		{
@@ -127,7 +127,7 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 			OffsetY = aChannels[1];
 			Rot = aChannels[2]/360.0f*pi*2;
 		}
-		
+
 		IGraphics::CColorVertex Array[4] = {
 			IGraphics::CColorVertex(0, q->m_aColors[0].r*Conv*r, q->m_aColors[0].g*Conv*g, q->m_aColors[0].b*Conv*b, q->m_aColors[0].a*Conv*a),
 			IGraphics::CColorVertex(1, q->m_aColors[1].r*Conv*r, q->m_aColors[1].g*Conv*g, q->m_aColors[1].b*Conv*b, q->m_aColors[1].a*Conv*a),
@@ -136,7 +136,7 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 		Graphics()->SetColorVertex(Array, 4);
 
 		CPoint *pPoints = q->m_aPoints;
-	
+
 		if(Rot != 0)
 		{
 			static CPoint aRotated[4];
@@ -145,13 +145,13 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 			aRotated[2] = q->m_aPoints[2];
 			aRotated[3] = q->m_aPoints[3];
 			pPoints = aRotated;
-			
+
 			Rotate(&q->m_aPoints[4], &aRotated[0], Rot);
 			Rotate(&q->m_aPoints[4], &aRotated[1], Rot);
 			Rotate(&q->m_aPoints[4], &aRotated[2], Rot);
 			Rotate(&q->m_aPoints[4], &aRotated[3], Rot);
 		}
-		
+
 		IGraphics::CFreeformItem Freeform(
 			fx2f(pPoints[0].x)+OffsetX, fx2f(pPoints[0].y)+OffsetY,
 			fx2f(pPoints[1].x)+OffsetX, fx2f(pPoints[1].y)+OffsetY,
@@ -159,7 +159,7 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, voi
 			fx2f(pPoints[3].x)+OffsetX, fx2f(pPoints[3].y)+OffsetY);
 		Graphics()->QuadsDrawFreeform(&Freeform, 1);
 	}
-	Graphics()->QuadsEnd();	
+	Graphics()->QuadsEnd();
 }
 
 void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4 Color, int RenderFlags)
@@ -169,19 +169,19 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 	Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);
 	//Graphics()->MapScreen(screen_x0-50, screen_y0-50, screen_x1+50, screen_y1+50);
 
-	// calculate the final pixelsize for the tiles	
+	// calculate the final pixelsize for the tiles
 	float TilePixelSize = 1024/32.0f;
 	float FinalTileSize = Scale/(ScreenX1-ScreenX0) * Graphics()->ScreenWidth();
 	float FinalTilesetScale = FinalTileSize/TilePixelSize;
-	
+
 	Graphics()->QuadsBegin();
 	Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
-	
+
 	int StartY = (int)(ScreenY0/Scale)-1;
 	int StartX = (int)(ScreenX0/Scale)-1;
 	int EndY = (int)(ScreenY1/Scale)+1;
 	int EndX = (int)(ScreenX1/Scale)+1;
-	
+
 	// adjust the texture shift according to mipmap level
 	float TexSize = 1024.0f;
 	float Frac = (1.25f/TexSize) * (1/FinalTilesetScale);
@@ -192,7 +192,7 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 		{
 			int mx = x;
 			int my = y;
-			
+
 			if(RenderFlags&TILERENDERFLAG_EXTEND)
 			{
 				if(mx<0)
@@ -215,14 +215,14 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 				if(my>=h)
 					continue; // my = h-1;
 			}
-			
+
 			int c = mx + my*w;
-				
+
 			unsigned char Index = pTiles[c].m_Index;
 			if(Index)
 			{
 				unsigned char Flags = pTiles[c].m_Flags;
-				
+
 				bool Render = false;
 				if(Flags&TILEFLAG_OPAQUE)
 				{
@@ -234,17 +234,17 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 					if(RenderFlags&LAYERRENDERFLAG_TRANSPARENT)
 						Render = true;
 				}
-				
+
 				if(Render)
 				{
-					
+
 					int tx = Index%16;
 					int ty = Index/16;
 					int Px0 = tx*(1024/16);
 					int Py0 = ty*(1024/16);
 					int Px1 = Px0+(1024/16)-1;
 					int Py1 = Py0+(1024/16)-1;
-					
+
 					float x0 = Nudge + Px0/TexSize+Frac;
 					float y0 = Nudge + Py0/TexSize+Frac;
 					float x1 = Nudge + Px1/TexSize-Frac;
@@ -253,7 +253,7 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 					float y2 = Nudge + Py1/TexSize-Frac;
 					float x3 = Nudge + Px0/TexSize+Frac;
 					float y3 = Nudge + Py1/TexSize-Frac;
-					
+
 					if(Flags&TILEFLAG_VFLIP)
 					{
 						x0 = x2;
@@ -269,14 +269,14 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 						y3 = y1;
 						y1 = y0;
 					}
-					
+
 					if(Flags&TILEFLAG_ROTATE)
 					{
 						float Tmp = x0;
 						x0 = x3;
 						x3 = x2;
 						x2 = x1;
-						x1 = Tmp;		
+						x1 = Tmp;
 						Tmp = y0;
 						y0 = y3;
 						y3 = y2;
@@ -291,7 +291,7 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4
 			}
 			x += pTiles[c].m_Skip;
 		}
-	
+
 	Graphics()->QuadsEnd();
 	Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
 }