//===========================================================================//
// File:	munga.hpp                                                           //
// Project: Adept           Brick: ???                                       //
// Contents: ???                                                             //
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 00/00/00  XXX  Initial coding.                                            //
//---------------------------------------------------------------------------//
// Copyright (C) 1995-1996, Virtual World Entertainment, Inc.                //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//

#pragma once

#include <ElementRenderer\ElementRenderer.hpp>
#include "GlobalPointerManager.hpp"

namespace Adept {

	//
	//--------------
	// Adept classes
	//--------------
	//
	enum
	{
		//
		//---------------------
		// Registered class IDs
		//---------------------
		//
		StateEngineClassID = Stuff::FirstAdeptClassID,

		ReceiverClassID,
		EventClassID,
		NetworkEventClassID,
		GeneralEventQueueClassID,
		EventQueueClassID,
		EventStatisticsManagerClassID,

		//
		//---------------
		// basic entities
		//---------------
		//
		ReplicatorClassID,
		Entity__ExecutionStateEngineClassID,
		EntityClassID,
		Mover__ExecutionStateEngineClassID,
		MoverClassID,

		InterfaceClassID,
		ScoreKeeperClassID,
		DriverClassID,
		PlayerClassID,
		GUIEntityClassID,
		GUITextEntityClassID,
		Effect__ExecutionStateEngineClassID,
		EffectClassID,
		DamageObjectClassID,
		DropZoneClassID,

		//
		//---------------
		// basic managers
		//---------------
		//
		InBoxClassID,
		NetworkClassID,
		ConnectionClassID,

		EntityManagerClassID,
		EntityGroupClassID,

		ControlsInstanceClassID,
		DirectControlsInstanceClassID,
		EventControlsInstanceClassID,
		ControlsMappingGroupClassID,
		ControlsManagerClassID,
		EasterEggClassID,
		EasterEggManagerClassID,

		RendererClassID,
		RendererManagerClassID,
		AudioRendererClassID,
		ScreenPolyManagerClassID,

		MissionClassID,
		MapClassID,
		ApplicationStateEngineClassID,
		ApplicationClassID,
		ApplicationTaskClassID,

		//
		//-----------
		// components
		//-----------
		//
		ComponentClassID,
		EntityComponentWebClassID,
		RendererComponentWebClassID,
		ComponentWebClassID,

		ChannelClassID,
		ChannelOfScalarClassID,
		ChannelOfIntClassID,
		ChannelOfRadianClassID,
		ChannelOfVector3DClassID,
		ChannelOfPoint3DClassID,
		ChannelOfNormal3DClassID,
		ChannelOfUnitQuaternionClassID,
		ChannelOfEulerAnglesClassID,
		ChannelOfMotion3DClassID,
		ChannelOfOrigin3DClassID,
		ChannelOfLinearMatrix4DClassID,

		AttributeWatcherOfScalarClassID,
		AttributeWatcherOfIntClassID,
		AttributeWatcherOfRadianClassID,
		AttributeWatcherOfVector3DClassID,
		AttributeWatcherOfPoint3DClassID,
		AttributeWatcherOfNormal3DClassID,
		AttributeWatcherOfUnitQuaternionClassID,
		AttributeWatcherOfEulerAnglesClassID,
		AttributeWatcherOfMotion3DClassID,
		AttributeWatcherOfOrigin3DClassID,
		AttributeWatcherOfLinearMatrix4DClassID,

		StateWatcherClassID,

		MessageWatcherClassID,
		ButtonChannelClassID,

		AdderOfScalarClassID,
		MultiplierOfScalarClassID,

		RandomizerOfScalarClassID,
		RandomizerOfIntClassID,

		SmootherOfScalarClassID,

		MatcherOfIntClassID,

		LFOChannelClassID,
		QuantizerClassID,

		//
		//-----------------
		// GUI components
		//-----------------
		//
		GUIComponentClassID,
		GUITextComponentClassID,
		GUIObjectClassID,
		GUITextObjectClassID,
		GUITextManagerClassID,
		GUIStatBarClassID,

		//
		//-----------------
		// Element renderer
		//-----------------
		//
		VideoRendererClassID,
		VideoComponentWebClassID,
		VideoComponentClassID,
		GroupComponentClassID,
		CameraComponentClassID,
		LightComponentClassID,
		LODComponentClassID,
		ShapeComponentClassID,
		ScalableShapeComponentClassID,
		SwitchComponentClassID,
		gosFXComponentClassID,
		gosFXControllerClassID,
		EffectControllerClassID,
		BeamComponentClassID,
		SlidingShapeComponentClassID,
		MultiLODComponentClassID,
		ConeComponentClassID,

		//
		//-----------------
		// Audio renderer
		//-----------------
		//
		AudioSampleClassID,
		AudioChannelClassID,
		AudioCommandClassID,
		SpatializedChannelClassID,
		SpatializedCommandClassID,
		AudioComponentWebClassID,
		EarComponentClassID,
		AudioFXComponentClassID,
		AudioBeamComponentClassID,

		ResourceIDClassID,

		NameTableClassID,

		ZoneClassID,
		TileClassID,
		CollisionGridClassID,

		InternalDamageObjectClassID,
		FirstFreeAdeptClassID
	};

// MSL 5.03 Lava
	enum {
		NoMaterial,
		GrassMaterial,
		WaterMaterial,
		ConcreteMaterial,
		GreyDirtMaterial,
		BrownDirtMaterial,
		RockMaterial,
		DarkConcreteMaterial,
		DarkGreyDirtMaterial,
		DarkBrownDirtMaterial,
		DarkRockMaterial,
		BlacktopMaterial,
		SnowMaterial,
		WoodMaterial,
		LavaMaterial,
		GlassMaterial,
		SteelMaterial,
		UsMaterial,
		ThemMaterial,
		LightMineralMaterial,
		DarkMineralMaterial,
		AshMaterial,
		CrackedLavaMaterial,
		OpenLavaMaterial,		

		MaterialCount,

		FakeShallowWaterMaterial,
		FakeMidWaterMaterial,
		FakeOceanicWaterMaterial
	};

	enum {
		DefaultExecutionSlot,
		EffectExecutionSlot,
		NavPointExecutionSlot,
		ExecutionSlotCount
	};
	

	enum {
		EntityManagerGlobalPointerIndex = 0,
		GUIManagerGlobalPointerIndex,
		GUITextManagerGlobalPointerIndex,
		ApplicationGlobalPointerIndex,
		NameTableGlobalPointerIndex,
		NetworkGlobalPointerIndex,
		PlayerGlobalPointerIndex,
		MapGlobalPointerIndex,
		MissionGlobalPointerIndex,
		FirstFreeAdeptGlobalPointerIndex
	};

	int MaterialTypeTextToAscii(const char *mode_name);
	const char* MaterialTypeAsciiToText(int material);

	void InitializeClasses(Stuff::NotationFile *startup_ini=NULL);
	void TerminateClasses(Stuff::NotationFile *startup_ini=NULL);

	extern HGOSHEAP g_Heap;
	extern HGOSHEAP g_LibraryHeap;
}

#define GROUP_ADEPT "Adept::"
#define GROUP_ADEPT_AUDIO "Adept::Audio"
#define GROUP_ADEPT_ENTITY "Adept::Entity"
#define GROUP_ADEPT_EVENT "Adept::Event"
#define GROUP_ADEPT_RESOURCE "Adept::Resource"
#define GROUP_ADEPT_TOOL "Adept::Tool"
#define GROUP_ADEPT_VIDEO "Adept::Video"
#define GROUP_ADEPT_GUI "Adept::GUI"
#define GROUP_ADEPT_NETWORK "Adept::Network"


#if 1
#define PRECOLLISION_LOGIC(string) LOGIC("Pre-Collision::" string)
#else
#define PRECOLLISION_LOGIC(string)
#endif

#if 1
#define POSTCOLLISION_LOGIC(string) LOGIC("Post-Collision::" string)
#else
#define POSTCOLLISION_LOGIC(string)
#endif

#if 0
#define SYNC_LOGIC(string) LOGIC("Sync::" string)
#else
#define SYNC_LOGIC(string)
#endif

#include "Event.hpp"


