//////////////////////////////////////////////////////////////////////////////
//
// Asura_Platform_Shadow_System.cpp
//
// Copyright (c) 2006 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

#include "Core/Asura.h"

// Engine independent.
#include "Shadows/Asura_Shadow_System.h"

#include "ChunkSystem/Asura_Chunk_Stream.h"

// C L A S S   I M P L E M E N T A T I O N S /////////////////////////////////

void Asura_ShadowParameters::ReadFromChunkStream( Asura_Chunk_Stream& xStream )
{
	uint32 uVersion;

	xStream >> uVersion;
	Asura_Assert( uVersion <= CURRENT_VERSION, "Unknown chunk version!" );

	// JAT 11/04/07 - don't need to check if a u_int is +ve it always is!
	//if ( uVersion >= 0 )
	{
		xStream >> m_uFlags;
		xStream >> m_fShadowStrength;
		xStream >> m_fVerticalOffset;		
	}

	if ( uVersion >= 1 )
	{
		xStream >> m_fShadowSoftness;
	}
	else
	{
		m_fShadowSoftness = 1.0f;
	}
}


void Asura_ShadowParameters::WriteToChunkStream( Asura_Chunk_Stream& xStream ) const
{
	uint32 uVersion = CURRENT_VERSION;
	xStream << uVersion;
	xStream << m_uFlags;
	xStream << m_fShadowStrength;	
	xStream << m_fVerticalOffset;	
	xStream << m_fShadowSoftness;	
}

//
// Asura_Shadow_System.
//

Asura_Shadow_System_Config Asura_Shadow_System::s_xConfig;


void Asura_Shadow_System::Initialise( void ) {}
void Asura_Shadow_System::Reset( void ) {}
void Asura_Shadow_System::Shutdown( void ) {}
bool Asura_Shadow_System::AddShadowInstance(Asura_Shadow_Instance* pxInstance)
{
	return true;
}
void Asura_Shadow_System::AddShadowInstances(const Asura_Vector_3 &xPos, void *pxUserData, AddShadowInstanceCallback pfnCallback) {}

void Asura_Shadow_System::RenderInstances(void) {}
void Asura_Shadow_System::RenderOnToScene(void)	{}
void Asura_Shadow_System::FinishedRenderingShadows(void) {}



void Asura_Shadow_System::Platform_Initialise(void)			{}
void Asura_Shadow_System::Platform_Reset(void)				{}
void Asura_Shadow_System::Platform_Shutdown(void)			{}
void Asura_Shadow_System::Platform_RenderOnToScene(ASURA_SHADOW_LIGHTSOURCE eLightSource, uint32 uLightSourceHandle)	{}
void Asura_Shadow_System::Platform_EndCreateShadows(void)	{}
void Asura_Shadow_System::Platform_BeginCreateShadows(void)	{}


#if defined(ASURA_TARGET_SM3)
void Asura_Shadow_System::Platform_RenderEnvironmentShadowMap( Asura_Shadow &xShadow) {}
#endif	//defined(ASURA_TARGET_SM3)
