⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mlrsortbyorder.hpp

📁 机甲指挥官2源代码
💻 HPP
字号:
//===========================================================================//
// Copyright (C) Microsoft Corporation. All rights reserved.                 //
//===========================================================================//

#pragma once
#define MLR_MLRSORTBYORDER_HPP

#if !defined(MLR_MLR_HPP)
	#include <MLR\MLR.hpp>
#endif

#if !defined(MLR_MLRSTATE_HPP)
	#include <MLR\MLRState.hpp>
#endif

namespace MidLevelRenderer {

	struct SortAlpha {
		Stuff::Scalar distance;
 		MLRState *state;
		GOSVertex triangle[3];
	};

	//##########################################################################
	//######################    MLRSortByOrder    ##############################
	//##########################################################################

	class MLRSortByOrder :
		public MLRSorter
	{
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Initialization
	//
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();
		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Constructors/Destructors
	//
	public:
		MLRSortByOrder(MLRTexturePool*);
		~MLRSortByOrder();

		void AddPrimitive(MLRPrimitiveBase*, int=0);
		void AddEffect(MLREffect*, const MLRState&);
		void AddScreenQuads(GOSVertex*, const DrawScreenQuadsInformation*);

		virtual void AddSortRawData(SortData*);

	//	starts the action
		void RenderNow ();

	//	resets the sorting
		void Reset ();

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

	protected:
		int
			lastUsedInBucket[MLRState::PriorityCount];

		Stuff::DynamicArrayOf<SortData*>  //, Max_Number_Primitives_Per_Frame + Max_Number_ScreenQuads_Per_Frame
			priorityBuckets[MLRState::PriorityCount];

		Stuff::DynamicArrayOf<SortAlpha*>  //, Max_Number_Primitives_Per_Frame + Max_Number_ScreenQuads_Per_Frame
			alphaSort;
	};

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -