src/genericunits.cpp
// constructContainerFrame ******
// Create a frame structure whose information is such that the created
// frame is bigger than any other frame used by the unit (that is, that
// a frame with such dimensions would cover any other frame, so ensuring
// that pixels won't ever be written outside these coordinates in a
// given unit)
// Only the handle coordinates and the frame size are set up in this
// fake frame
// Big collision coordinates aren't calculated.

constructContainerFrame
Create a frame structure whose information is such that the created
frame is bigger than any other frame used by the unit (that is, that
a frame with such dimensions would cover any other frame, so ensuring
that pixels won't ever be written outside these coordinates in a
given unit)
Only the handle coordinates and the frame size are set up in this
fake frame
Big collision coordinates aren't calculated.
constructContainerFrame Create a frame structure whose information is such that the created frame is bigger than any other frame used by the unit ( that is that a frame with such dimensions would cover any other frame so ensuring that pixels won ' t ever be written outside these coordinates in a given unit ) Only the handle coordinates and the frame size are set up in this fake frame Big collision coordinates aren ' t calculated .
bool constructContainerFrame(
	genericUnitStruct* unit,
	frameDataStruct* frameToWrite)
{
	frameDataStruct* frames;
	int framesCount;
	frameDataStruct* thisFrame;
	int wToLeft=0, wToRight=0, hToTop=0, hToBottom=0;
	int tempWToLeft, tempWToRight, tempHToTop, tempHToBottom;
	frames=getUnitFramesList(unit);
	if (frames==NULL || frameToWrite==NULL)
		return false;
	framesCount=getFramesCount(frames);
	if (framesCount<=0) return false;
	for (thisFrame=frames; thisFrame-frames<framesCount; thisFrame++) {
		tempWToLeft=thisFrame->handlerX;
		tempWToRight=thisFrame->w-thisFrame->handlerX;
		tempHToTop=thisFrame->handlerY;
		tempHToBottom=thisFrame->h-thisFrame->handlerY;
		wToLeft=(wToLeft>tempWToLeft?wToLeft:tempWToLeft);
		wToRight=(wToRight>tempWToRight?wToRight:tempWToRight);
		hToTop=(hToTop>tempHToTop?hToTop:tempHToTop);
		hToBottom=(hToBottom>tempHToBottom?hToBottom:tempHToBottom);
	}
	frameToWrite->handlerX=wToLeft;
	frameToWrite->handlerY=hToTop;
	frameToWrite->w=wToLeft+wToRight;
	frameToWrite->h=hToTop+hToBottom;
	return true;
}
bool constructContainerFrame ( genericUnitStruct * unit , frameDataStruct * frameToWrite ) { frameDataStruct * frames ; int framesCount ; frameDataStruct * thisFrame ; int wToLeft = 0 , wToRight = 0 , hToTop = 0 , hToBottom = 0 ; int tempWToLeft , tempWToRight , tempHToTop , tempHToBottom ; frames = getUnitFramesList ( unit ) ; if ( frames == NULL || frameToWrite == NULL ) return false ; framesCount = getFramesCount ( frames ) ; if ( framesCount <= 0 ) return false ; for ( thisFrame = frames ; thisFrame - frames < framesCount ; thisFrame ++ ) { tempWToLeft = thisFrame -> handlerX ; tempWToRight = thisFrame -> w - thisFrame -> handlerX ; tempHToTop = thisFrame -> handlerY ; tempHToBottom = thisFrame -> h - thisFrame -> handlerY ; wToLeft = ( wToLeft > tempWToLeft ? wToLeft : tempWToLeft ) ; wToRight = ( wToRight > tempWToRight ? wToRight : tempWToRight ) ; hToTop = ( hToTop > tempHToTop ? hToTop : tempHToTop ) ; hToBottom = ( hToBottom > tempHToBottom ? hToBottom : tempHToBottom ) ; } frameToWrite -> handlerX = wToLeft ; frameToWrite -> handlerY = hToTop ; frameToWrite -> w = wToLeft + wToRight ; frameToWrite -> h = hToTop + hToBottom ; return true ; }
constructContainerFrame 
Create a frame structure whose information is such that the created
frame is bigger than any other frame used by the unit (that is, that
a frame with such dimensions would cover any other frame, so ensuring
that pixels won't ever be written outside these coordinates in a
given unit)
Only the handle coordinates and the frame size are set up in this
fake frame
Big collision coordinates aren't calculated.
constructContainerFrame Create a frame structure whose information is such that the created frame is bigger than any other frame used by the unit ( that is that a frame with such dimensions would cover any other frame so ensuring that pixels won ' t ever be written outside these coordinates in a given unit ) Only the handle coordinates and the frame size are set up in this fake frame Big collision coordinates aren ' t calculated .
// enemy unit to obtain the current frame from
 // frame struct to write to
 // these are: distance from the x handle to the left and right border,
 // and distance to the y handle to the top and bottom border. These
 // four values will be maximized.
 // calculate some things
 // error!
 // we don't like zero frames!
 // now go set up the fields according to the data of all the forms
 // calculate the new four values
 // obtain the most important values of those
 // write the final frame data
 // all ok...
