shape.hpp

来自「机甲指挥官2源代码」· HPP 代码 · 共 121 行

HPP
121
字号
//==========================================================================//
// File:	 gosFX_Shape.hpp											    //
// Contents: Shape Component											    //
//---------------------------------------------------------------------------//
// Copyright (C) Microsoft Corporation. All rights reserved.                 //
//===========================================================================//
//
#pragma once

#include "gosFX.hpp"
#include "Singleton.hpp"
#include <MLR\MLR.hpp>

namespace MidLevelRenderer {class MLRShape;}

namespace gosFX
{
	//############################################################################
	//########################  Shape__Specification  #############################
	//############################################################################

	class Shape;

	class Shape__Specification:
		public Singleton__Specification
	{
		friend class Shape;

	//----------------------------------------------------------------------
	// Constructors/Destructors
	//
	protected:
		Shape__Specification(
			Stuff::MemoryStream *stream,
			int gfx_version
		);

	public:
		Shape__Specification(MidLevelRenderer::MLRShape *shape);
		~Shape__Specification();

		void
			Save(Stuff::MemoryStream *stream);

		static Shape__Specification*
			Make(
				Stuff::MemoryStream *stream,
				int gfx_version
			);

		void
			Copy(Shape__Specification *spec);

		void
			SetShape(MidLevelRenderer::MLRShape *shape);

	protected:
		MidLevelRenderer::MLRShape
			*m_shape;
		Stuff::Scalar
			m_radius;
	};

	//############################################################################
	//#############################  Shape  #################################
	//############################################################################

	class Shape : public Singleton
	{
	//----------------------------------------------------------------------------
	// Class Registration Support
	//
	public:
		static void InitializeClass();
		static void	TerminateClass();

		typedef Shape__Specification Specification;

	//----------------------------------------------------------------------------
	// Class Data Support
	//
	protected:
		Shape(
			Specification *spec,
			unsigned flags
		);

	public:
		static Shape*
			Make(
				Specification *spec,
				unsigned flags
			);

		Specification*
			GetSpecification()
				{
					Check_Object(this);
					return
						Cast_Object(Specification*, m_specification);
				}

		static ClassData
			*DefaultData;

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

	//----------------------------------------------------------------------------
	// API
	//
	public:
		void
			Draw(DrawInfo *info);
	};
}

⌨️ 快捷键说明

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