changeset 35:4750819f465d

WIP
author koryspansel <koryspansel@bendbroadband.com>
date Wed, 21 Sep 2011 10:26:48 -0700
parents 7f5feeb3f604
children b60cbf3fa894
files LightClone/Source/World.cpp
diffstat 1 files changed, 2 insertions(+), 196 deletions(-) [+]
line wrap: on
line diff
--- a/LightClone/Source/World.cpp	Wed Sep 21 01:20:58 2011 -0700
+++ b/LightClone/Source/World.cpp	Wed Sep 21 10:26:48 2011 -0700
@@ -429,8 +429,6 @@
  */
 void World::ProcessInput(float fElapsed)
 {
-	//pInputManager->Update(fElapsed);
-
 	#if defined(_DEBUG)
 	if(pInputManager->IsKeyDown(DIK_LEFT))
 	{
@@ -465,200 +463,6 @@
 		kCameraController.Move(-0.1f);
 	}
 	#endif
-
-	//const float fMouseX = pInputManager->GetMouseX();
-	//const float fMouseY = pInputManager->GetMouseY();
-
-	/*
-	if(nGameState == GameState_Active)
-	{
-		if(pInputManager->IsButtonDown(0) && !pInputManager->WasButtonDown(0))
-		{
-			// pick against the toolbar
-			int32 nSelection = kToolbar.Pick(fMouseX, fMouseY);
-			if(nSelection >= 0)
-			{
-				kDragController.Begin(Action_Forward + nSelection);
-			}
-			else
-			{
-				// pick against the main pane
-				nSelection = kMain.Pick(fMouseX, fMouseY);
-				if(nSelection >= 0)
-				{
-					Code* pCode = pFunction;
-					if(!pCode->IsEmptySlot(nSelection))
-					{
-						kDragController.Begin(pCode->GetSlot(nSelection));
-						pCode->ClearSlot(nSelection);
-					}
-				}
-				else
-				{
-					// pick against the function pane
-					nSelection = kFunction.Pick(fMouseX, fMouseY);
-					if(nSelection >= 0)
-					{
-						Code* pCode = pFunction + nCurrentFunction + 1;
-						if(!pCode->IsEmptySlot(nSelection))
-						{
-							kDragController.Begin(pCode->GetSlot(nSelection));
-							pCode->ClearSlot(nSelection);
-						}
-					}
-					else
-					{
-						// pick against the function pane arrows
-						for(uint32 i = 0; i < sizeof(kArrowBounds) / sizeof(kArrowBounds[0]); ++i)
-						{
-							if(kArrowBounds[i].Contains(fMouseX, fMouseY))
-							{
-								const uint32 nCount = kLoader.GetFunctionCount();
-								nCurrentFunction = (nCurrentFunction + 2 * (int32)i - 1 + nCount) % nCount;
-							}
-						}
-					}
-				}
-			}
-		}
-		else
-
-		if(!pInputManager->IsButtonDown(0) && pInputManager->WasButtonDown(0))
-		{
-			if(kDragController.IsActive())
-			{
-				const uint32 nAction = kDragController.End();
-
-				int32 nSelection = kMain.Pick(fMouseX, fMouseY);
-				if(nSelection >= 0)
-				{
-					pFunction[0].SetSlot(nSelection, nAction);
-				}
-				else
-				{
-					nSelection = kFunction.Pick(fMouseX, fMouseY);
-					if(nSelection >= 0)
-					{
-						pFunction[nCurrentFunction + 1].SetSlot(nSelection, nAction);
-					}
-				}
-			}
-		}
-	}
-	else
-
-	if(nGameState == GameState_Complete)
-	{
-		if(pInputManager->IsButtonDown(0) && !pInputManager->WasButtonDown(0))
-		{
-			for(uint32 i = 0; i < sizeof(kDialog1Bounds) / sizeof(kDialog1Bounds[0]); ++i)
-			{
-				if(kDialog1Bounds[i].Contains(fMouseX, fMouseY))
-				{
-					if(i == 0)
-					{
-						if(nSimulationState == SimulationState_Active)
-						{
-							ResetEnvironment();
-							ResetBot();
-
-							nSimulationState = SimulationState_Idle;
-						}
-
-						nGameState = GameState_LoadMap;
-					}
-				}
-			}
-
-			#if 0
-			int32 nSelection = kDialog.Pick(fMouseX, fMouseY);
-
-			if(nSelection == DialogButton_A)
-			{
-				if(nSimulationState == SimulationState_Active)
-				{
-					ResetEnvironment();
-					ResetBot();
-
-					nSimulationState = SimulationState_Idle;
-				}
-
-				nGameState = GameState_LoadMap;
-			}
-			#endif
-		}
-	}
-	else
-
-	if(nGameState == GameState_Over)
-	{
-		// check to see if button was clicked
-		if(pInputManager->IsButtonDown(0) && !pInputManager->WasButtonDown(0))
-		{
-			for(uint32 i = 0; i < sizeof(kDialog1Bounds) / sizeof(kDialog1Bounds[0]); ++i)
-			{
-				if(kDialog1Bounds[i].Contains(fMouseX, fMouseY))
-				{
-					if(i == 0)
-					{
-						nCurrentLevel	= 0;
-						nGameState		= GameState_LoadMap;
-					}
-				}
-			}
-
-			#if 0
-			int32 nSelection = kDialog.Pick(fMouseX, fMouseY);
-
-			if(nSelection == DialogButton_A)
-			{
-				nCurrentLevel	= 0;
-				nGameState		= GameState_LoadMap;
-			}
-			#endif
-		}
-	}
-	else
-
-	if(nGameState == GameState_Confirm)
-	{
-		// check to see if button was clicked
-		if(pInputManager->IsButtonDown(0) && !pInputManager->WasButtonDown(0))
-		{
-			for(uint32 i = 0; i < sizeof(kDialog2Bounds) / sizeof(kDialog2Bounds[0]); ++i)
-			{
-				if(kDialog2Bounds[i].Contains(fMouseX, fMouseY))
-				{
-					if(i == 0)
-					{
-						nGameState = GameState_Exit;
-					}
-					else
-
-					if(i == 1)
-					{
-						nGameState = GameState_Active;
-					}
-				}
-			}
-
-			#if 0
-			int32 nSelection = kDialog.Pick(fMouseX, fMouseY);
-
-			if(nSelection == DialogButton_A)
-			{
-				nGameState = GameState_Exit;
-			}
-			else
-
-			if(nSelection == DialogButton_B)
-			{
-				nGameState = GameState_Active;
-			}
-			#endif
-		}
-	}
-	*/
 }
 
 /*
@@ -668,7 +472,9 @@
 {
 	if(nSimulationState == SimulationState_Idle)
 	{
+		ResetEnvironment();
 		ResetBot();
+
 		kBot.Upload(pFunction, kLoader.GetFunctionCount() + 1);
 
 		nSimulationState = SimulationState_Active;