当前位置: 首页>>代码示例>>C++>>正文


C++ SortItem::overlap方法代码示例

本文整理汇总了C++中SortItem::overlap方法的典型用法代码示例。如果您正苦于以下问题:C++ SortItem::overlap方法的具体用法?C++ SortItem::overlap怎么用?C++ SortItem::overlap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SortItem的用法示例。


在下文中一共展示了SortItem::overlap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

inline bool SortItem::operator<<(const SortItem& si2) const
{
	const SortItem& si1 = *this;
	
	if (si2.overlap(si1)) pout << "Overlaping" << std::endl;
	else 
	{
		 pout << "Not Overlaping" << std::endl;
		 return false;
	}

	// Specialist z flat handling
	pout << "if (si1.flat && si2.flat) -> if (" 
			<< si1.flat << " && " << si2.flat << ") -> " 
			<< (si1.flat && si2.flat) << std::endl;
	pout << "{" << std::endl;

	if (si1.flat && si2.flat)
	{
		// Differing z is easy for flats
		//if (si1.ztop != si2.ztop) return si1.ztop < si2.ztop;
		COMPARISON_RETURN(ztop,<,"\t");

		// Equal z

		// Animated always gets drawn after
		//if (si1.anim != si2.anim) return si1.anim < si2.anim;
		COMPARISON_RETURN(anim,<,"\t");

		// Trans always gets drawn after
		//if (si1.trans != si2.trans) return si1.trans < si2.trans;
		COMPARISON_RETURN(trans,<,"\t");

		// Draw always gets drawn first
		//if (si1.draw != si2.draw) return si1.draw > si2.draw;
		COMPARISON_RETURN(draw,>,"\t");

		// Solid always gets drawn first
		//if (si1.solid != si2.solid) return si1.solid > si2.solid;
		COMPARISON_RETURN(solid,>,"\t");

		// Occludes always get drawn first
		//if (si1.occl != si2.occl) return si1.occl > si2.occl;
		COMPARISON_RETURN(occl,>,"\t");

		// 32x32 flats get drawn first
		//if (si1.f32x32 != si2.f32x32) return si1.f32x32 > si2.f32x32;
		COMPARISON_RETURN(f32x32,>,"\t");
	}
开发者ID:amichaelt,项目名称:pentagram,代码行数:49,代码来源:ItemSorter.cpp


注:本文中的SortItem::overlap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。