src/genericunits.cpp
// isUnitInsideTheScreen
// This function tells whether a given unit is inside the screen (visible)
// or not.

isUnitInsideTheScreen
This function tells whether a given unit is inside the screen (visible)
or not.
isUnitInsideTheScreen This function tells whether a given unit is inside the screen ( visible ) or not .
bool isUnitInsideTheScreen(genericUnitStruct* unit)
{
	frameDataStruct combFrame;
	if (!constructSlaverFullFrame(unit, &combFrame)) return false;
	return INTERSECTINGRECTANGLES(
		unit->x-(combFrame.handlerX),
		unit->y-(combFrame.handlerY),
		unit->x+(combFrame.w)-(combFrame.handlerX)-1,
		unit->y+(combFrame.h)-(combFrame.handlerY)-1,
		gameWorld.xCamera, gameWorld.yCamera,
		gameWorld.xCamera+gameWorld.wCamera-1,
		gameWorld.yCamera+gameWorld.hCamera-1);
}
bool isUnitInsideTheScreen ( genericUnitStruct * unit ) { frameDataStruct combFrame ; if ( ! constructSlaverFullFrame ( unit , & combFrame ) ) return false ; return INTERSECTINGRECTANGLES ( unit -> x - ( combFrame . handlerX ) , unit -> y - ( combFrame . handlerY ) , unit -> x + ( combFrame . w ) - ( combFrame . handlerX ) - 1 , unit -> y + ( combFrame . h ) - ( combFrame . handlerY ) - 1 , gameWorld . xCamera , gameWorld . yCamera , gameWorld . xCamera + gameWorld . wCamera - 1 , gameWorld . yCamera + gameWorld . hCamera - 1 ) ; }
isUnitInsideTheScreen
This function tells whether a given unit is inside the screen (visible)
or not.
isUnitInsideTheScreen This function tells whether a given unit is inside the screen ( visible ) or not .
// calculate the intersection of the biggest frame with the
 // screen rectangle
