#pragma once
#define MLR_MLR_I_C_DT_TMESH_HPP

#include <MLR\MLR.hpp>
#include <MLR\MLR_I_TMesh.hpp>
#include <MLR\MLR_I_C_PMesh.hpp>

namespace MidLevelRenderer {

	//##########################################################################
	//###### MLRIndexedTriMesh with color no lighting two texture layer  #######
	//##########################################################################


	class MLR_I_C_DT_TMesh:
		public MLR_I_DT_TMesh
	{
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Initialization
	//
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

		static HGOSHEAP
			PrimitiveHeap;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Constructors/Destructors
	//
	protected:
		MLR_I_C_DT_TMesh(
			ClassData *class_data,
			Stuff::MemoryStream *stream,
			int version
		);
		~MLR_I_C_DT_TMesh();

	public:
		MLR_I_C_DT_TMesh(ClassData *class_data=MLR_I_C_DT_TMesh::DefaultData);

		static MLR_I_C_DT_TMesh*
			Make(
				Stuff::MemoryStream *stream,
				int version
			);

		void
			Save(Stuff::MemoryStream *stream);

	public:
		virtual void
			SetColorData(
				const ColorType *array,
				int point_count
			);
		virtual void
			GetColorData(
				const ColorType **array,
				int *point_count
			);

		virtual int	TransformAndClip(Stuff::Matrix4D *, MLRClippingState, GOSVertexPool*, FogData*, DWORD=0xffffffff, bool=false);

		virtual void
			TransformNoClip(Stuff::Matrix4D*, GOSVertexPool*, FogData*, DWORD=0xffffffff, bool=false);

		bool
			Copy(MLR_I_C_DT_PMesh*);

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data Support
	//
	public:
		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Testing
	//
	public:
		void
			TestInstance() const;

	protected:
		Stuff::ReadOnlyArrayOf<ColorType> colors;	// Base address of color list 
		Stuff::ReadOnlyArrayOf<ColorType> *actualColors;
	};

	MLR_I_C_DT_TMesh*
		CreateIndexedTriCube_Color_NoLit_2Tex(
			Scalar half, 
			MLRState *state,
			MLRState *state1
		);
	MLRShape*
		CreateIndexedTriIcosahedron_Color_NoLit_2Tex(
			IcoInfo& icoInfo,
			MLRState *state,
			MLRState *state2
		);

}
