Esempio n. 1
0
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");
	}