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

📄 morect.h

📁 Blood 2全套源码
💻 H
字号:
//------------------------------------------------------------------
//
//	FILE	  : MoRect.h
//
//	PURPOSE	  : Defines the CMoRect class.
//
//	CREATED	  : November 7 1996
//
//	COPYRIGHT : Microsoft 1996 All Rights Reserved
//
//------------------------------------------------------------------

#ifndef __MORECT_H__
	#define __MORECT_H__


	#include "StdLithDefs.h"


	class CMoRect
	{
		public:
	
			BOOL	Init( int x1, int y1, int x2, int y2 );
			
			int		Width()		{ return right-left; }
			int		Height()	{ return bottom-top; }

			void	NormalizeRect();
					

			int		left, top, right, bottom;
			
	};


	inline BOOL CMoRect::Init( int x1, int y1, int x2, int y2 )
	{
		left = x1;
		top = y1;
		right = x2;
		bottom = y2;

		NormalizeRect();
		return TRUE;
	}


	inline void CMoRect::NormalizeRect()
	{
		int temp;

		if( top > bottom )
		{
			temp = top;
			top = bottom;
			bottom = temp;
		}

		if( left > right )
		{
			temp = left;
			left = right;
			right = temp;
		}
	}


#endif  // __MORECT_H__

⌨️ 快捷键说明

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