// Handles the Minimap.
// Worthless Bums 2012.


// NOTE: No minimap at this time!

// Update minimap.
function updateMinimap ()
{//echo("updateMinimap()");
return;
	// If active character is alive, mount the minimap to it.
	if (isObject($playerSquad[$activeCharacter]))
	{
		minimapMountPoint.dismount();
		//minimapMountPoint.mount($playerSquad[$activeCharacter]);
		minimapMountPoint.mount($playerSquad[$activeCharacter], 0 SPC 0, $cameraMountForce, false);
	}
}

// Start the minimap.
// Use whenever loading a new level (e.g. taking off/jumping).
function startMinimap ()
{//echo("startMinimap()");
return;
	// Minimap initialization.
	minimap.setSceneGraph(SceneWindow2D.getSceneGraph());
	
	// Calculate minimap position to upper right hand corner of the map.
	%currentWidth = getWord($Game::Resolution, 0);
	%currentHeight = getWord($Game::Resolution, 1);
	if (%currentWidth / %currentHeight > 1.34)
	{
		%xPos = %currentWidth * 0.75;		// 0.75 is to avoid left and right bars in widescreen resolutions!
	}
	else
	{
		%xPos = %currentWidth * 0.8;
	}
	%yPos = 0.0;//%currentHeights;
	
	// Make transparent mount point for the minimap.
	new Sprite(minimapMountPoint)
	{
		scenegraph = levelSceneGraph;
		imagemap = "Sprites:blank_1x1";
		Visible = "0";
		Position = "0.332 3.470";
		size = "0.500 0.500";
		SceneLayer = "1";
		CollisionMaxIterations = "1";
	};
	addObjectToScene(minimapMountPoint);
	
	// Mount the invisible sprite to the player's ship.
	minimapMountPoint.mount($playerSquad[$activeCharacter]);
	
	// Mount the minimap to the active squad member.
	minimap.mount(minimapMountPoint);
	
	// Set minimap extent.
	//%minimapRatio = 6.0;
	//minimap.Extent = %currentWidth / %minimapRatio SPC %currentHeight / %minimapRatio;
	
	// Set minimap zoom.
	%zoomLevel = 0.5;
	minimap.setCurrentCameraZoom(%zoomLevel);
	
	
	if ($sceneWindowMountParent != $playerSquad[$activeCharacter])
	{//echo("MOUNTING!");
		//echo("3");
		// It is important that we mount the main camera to the ship AFTER we mount the thrusters and minimap camera to the player ship.
		// Create and attach player camera to the player ship.
		sceneWindow2D.mount($playerSquad[$activeCharacter]);	// Mount the scene window to the player ship.
		$sceneWindowMountParent = $playerSquad[$activeCharacter];
	}
	
	// Set minimap position.
	minimap.setPosition(%xPos, %yPos);
	//echo("%xPos =" SPC %xPos);
}