Ejemplo n.º 1
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_waypoint
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description
//
//Inputs		if I.useexistingWP then evaluate that to get UID to link in!
//				no other vars will be filled in.
//
//Returns
//
//------------------------------------------------------------------------------
UniqueID	Persons4::make_waypoint(info_waypoint& I)
{
	if (!justscanning)
	{
		info_waypoint*	J=new info_waypoint;
		*J=I;
		int v=I.uid.Evaluate();
		if (v<=0)
			v=assignuid(WayPointBAND);
		J->uniqueID.count=UniqueID(v);
		J->bfieldindex=currbfindex;
		J->uniqueID.changed=FALSE;
		J->World.Y=ENABLE_COMPLEX_VAL;									//RDH 10/03/00
		logUID(J);
		if (J->prevwp && J->prevwp!=IllegalSepID)
		{
			info_waypoint* W=*ConvertPtrUID(J->prevwp);
			W->nextwp=UniqueID(v);
		}
		else
		{
			J->prevwp=UID_Null;
#ifndef	__BCPLUSPLUS__
			GR_lastroutefirstwaypoint=v;
#endif
		}
		J->World.Y=ENABLE_COMPLEX_VAL;
		J->nextwp=UID_Null;
		return UniqueID(v);
	}
	return UID_Null;

}
Ejemplo n.º 2
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_airgrp
//Author		Jim Taylor
//Date			Mon 16 Jun 1997
//
//Description
//
//Inputs
//
//Returns
//
//------------------------------------------------------------------------------
void	Persons2::make_airgrp(info_airgrp& I)
{
	if (!justscanning)
	{
		info_airgrp*	J=new info_airgrp;
		*J=I;
		int v1,v2,v3;
		if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
			v3=defaultside;
		if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
			if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
				if (v3==(int)NAT_RED)
					J->uniqueID.count=assignuid(RedAcBAND);
				else
					J->uniqueID.count=assignuid(BlueAcBAND);
			else
				J->uniqueID.count=assignuid((UniqueIDBand)v2);
		else
			if (ConvertPtrUID(UniqueID(v1)))
				J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
			else
				J->uniqueID.count=UniqueID(v1);
		J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
		J->position.EvalW(J->World);
  //		J->shape=ShapeNum(J->shape.Evaluate());
//		FixupRouteOwner(J->uniqueID.count,J->wpref);
  //		FixupRouteOwner(J->uniqueID.count,J->wpref);
//camp tmp		if (J->inform.Evaluate()==ENABLE_COMPLEX_VAL)
//			MissionEditor->ActiveCampaign.PlayerAcuid = J->uniqueID.count;
		logUID(J);
	}
	else
	{
		int	v3;
		if ((v3=I.nat.Evaluate())==ENABLE_COMPLEX_VAL)
			v3=defaultside;
        if (bfdesc)
			if (I.inwing.Evaluate()==ENABLE_COMPLEX_VAL)
				if (v3==NAT_RED)
					bfdesc->RAC+=12;
				else
					bfdesc->BAC+=12;
			else
				if (v3==NAT_RED)
					bfdesc->RAC+=I.inform.Evaluate();
				else
					bfdesc->BAC+=I.inform.Evaluate();
	}
}
Ejemplo n.º 3
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_waypoint
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description
//
//Inputs		if I.useexistingWP then evaluate that to get UID to link in!
//				no other vars will be filled in.
//
//Returns
//
//------------------------------------------------------------------------------
UniqueID	Persons2::make_waypoint(info_waypoint& I)
{
	if (!justscanning)
	{
		info_waypoint*	J=new info_waypoint;
		*J=I;
		int v=I.uid.Evaluate();
		if (v==ENABLE_COMPLEX_VAL)
			v=assignuid(WayPointBAND);
		J->uniqueID.count=UniqueID(v);
		J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
 //		J->uniqueID.deaded=FALSE;
		//Position calculated in FixupRouteOwner
		logUID(J);

		if (J->prevwp && J->prevwp!=IllegalSepID)
		{
			info_waypoint* W=*ConvertPtrUID(J->prevwp);
			W->nextwp=UniqueID(v);
			if (W->events
			&&	W->pos.complex
			&&	W->pos.complex->Arguments()==2
			&&  W->pos[1]->type==Expr::EXPR_ROT
			&&  W->pos[1][0]->type==Expr::EXPR_ICPT
			)
			{
			//if coords expr for pos[0] == prev wp == ICPT[0]
			//change to UID of prevwp
			//if coords expr for new wp == ICPT[1]
			//change to UID of new wp
			}
		}
		else
			J->prevwp=UID_Null;
		J->nextwp=UID_Null;
		return UniqueID(v);
	}
	else
		if (bfdesc && justscanning==SCANNAMES)
			bfdesc->WP++;
	return UID_Null;

}
Ejemplo n.º 4
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_gndgrp
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description
//
//Inputs
//
//Returns
//
//------------------------------------------------------------------------------
void	Persons4::make_gndgrp(info_grndgrp& I)
{
    if (!justscanning)
    {
        info_grndgrp*	J=new info_grndgrp;
        *J=I;
        int v1,v2,v3;
        if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
            v3=NAT_RED;//defaultside;
        if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
            if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
                if (v3==(int)NAT_RED)
                    J->uniqueID.count=assignuid(RedAcBAND);
                else
                    J->uniqueID.count=assignuid(BlueAcBAND);
            else
                J->uniqueID.count=assignuid((UniqueIDBand)v2);
        else if (ConvertPtrUID(UniqueID(v1)))
            J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
        else
            J->uniqueID.count=UniqueID(v1);
        J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
        J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
        J->position.EvalW(J->World);
//		J->shape=ShapeNum(J->shape.Evaluate());
        J->Item::shape=ShapeNum(J->shape.Evaluate());				  //JIM 16/04/99

        logUID(J);
//		FixupRouteOwner(J->uniqueID.count,J->wpref);
        //		FixupRouteOwner(J->uniqueID.count,J->wpref);
    }
    else if (justscanning==SCANNAMES)
    {
        int	v3;
        if ((v3=I.nat.Evaluate())==ENABLE_COMPLEX_VAL)
            v3=NAT_RED;//defaultside;
        if (bfdesc)
            if (v3==NAT_RED)
                ;//ME 					bfdesc->RGR+=I.inform.Evaluate();
            else
                ;//ME 					bfdesc->BGR+=I.inform.Evaluate();
    }
}
Ejemplo n.º 5
0
void	Persons4::make_itemS(info_itemS& I,bool enabled)
{
//  if ((int)I.uid.Evaluate() != (int)UID_Varneville)				//this is in wrong band so don't load!
//  {
	if (!justscanning)
	{
		info_itemS* J=new info_itemS;
		*J=I;
		int v1,v2;
																	//	if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
																	  //		v3=defaultside;
		if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
			if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
				J->uniqueID.count=assignuid(CivilianBAND);
			else
				J->uniqueID.count=assignuid((UniqueIDBand)v2);
		else
			if (&ConvertPtrUID(UniqueID(v1)))
            {
				J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
            	PleaseWarnUser("This battlfield has been damaged because of the above error. Do not save it!","Aircraft with named UID already loaded.");
            }
			else
				J->uniqueID.count=UniqueID(v1);
		J->bfieldindex=currbfindex;
//DeadCode RDH 11Feb98 		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
		J->position.EvalW(J->World);
		J->Item::shape=ShapeNum(J->shape.Evaluate());
		logUID(J);
	}
//DEADCODE JIM 16/11/99 	else
//DEADCODE JIM 16/11/99 		if (bfdesc && justscanning==SCANNAMES)
//DEADCODE JIM 16/11/99 ;//ME 			bfdesc->ST++;
//  }
//  else
//  {
//
//
//  }
}
Ejemplo n.º 6
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_itemS
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description	Makes object J, a copy of temp object I
//				Fills in item UID and coords
//				Adds item to UID table.
//
//Inputs
//
//Returns
//
//------------------------------------------------------------------------------
void	Persons2::make_itemS(info_itemS& I)
{
//  if ((int)I.uid.Evaluate() != (int)UID_Varneville)				//this is in wrong band so don't load!
//  {
	if (!justscanning)
	{
		info_itemS* J=new info_itemS;
		*J=I;
		int v1,v2;
																	//	if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
																	  //		v3=defaultside;
		if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
			if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
				J->uniqueID.count=assignuid(RedVetoedBAND);
			else
				J->uniqueID.count=assignuid((UniqueIDBand)v2);
		else
			if (ConvertPtrUID(UniqueID(v1)))
				J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
			else
				J->uniqueID.count=UniqueID(v1);
		J->bfieldindex=currbfindex;
//DeadCode RDH 11Feb98 		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
		J->position.EvalW(J->World);
		J->shape=ShapeNum(J->shape.Evaluate());
		logUID(J);
	}
	else
		if (bfdesc && justscanning==SCANNAMES)
			bfdesc->ST++;
//  }
//  else
//  {
//
//
//  }
}
Ejemplo n.º 7
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_gndgrp
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description
//
//Inputs
//
//Returns
//
//------------------------------------------------------------------------------
void	Persons4::make_gndgrp(info_grndgrp& I)
{
	if (!justscanning)
	{
		info_grndgrp*	J=new info_grndgrp;
		*J=I;
		bool	gotGRoverride=false;
		int v1,v2,v3;
		if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
			v3=NAT_RED;//defaultside;
		if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
			if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
					J->uniqueID.count=assignuid(BritBoatBAND);	//JIM 22Feb100
			else
				J->uniqueID.count=assignuid((UniqueIDBand)v2);
		else
			if (&ConvertPtrUID(UniqueID(v1)))
            {
            	PleaseWarnUser("This battlfield has been damaged because of the above error. Do not save it!","Mobile with named UID already loaded.");
				J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
            }
			else
			{
				J->uniqueID.count=UniqueID(v1);
#ifndef	__BCPLUSPLUS__
				if (v1==+GR_ItemInfoOverride)
					gotGRoverride=true;
#endif
			}
		J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
		J->position.EvalW(J->World);
#ifndef	__BCPLUSPLUS__
		if (gotGRoverride)
		{
//DeadCode JIM 22Oct00 			J->World.X=GR_ItemXOverride;
//DeadCode JIM 22Oct00 			J->World.Z=GR_ItemZOverride;
			for (int wpcount=GR_ItemWpOverride;wpcount;wpcount--)
				if (info_waypointPtr(Persons2::ConvertPtrUID(J->wpref))->nextwp)
					J->wpref=info_waypointPtr(Persons2::ConvertPtrUID(J->wpref))->nextwp;
		}
#endif
//		J->shape=ShapeNum(J->shape.Evaluate());
		J->Item::shape=ShapeNum(J->shape.Evaluate());				  //JIM 16/04/99

		logUID(J);
//		FixupRouteOwner(J->uniqueID.count,J->wpref);
  //		FixupRouteOwner(J->uniqueID.count,J->wpref);
	}
	else
		if (justscanning==SCANNAMES)
		{
			int	v3;
			if ((v3=I.nat.Evaluate())==ENABLE_COMPLEX_VAL)
				v3=NAT_RED;//defaultside;
            if (bfdesc)
				if (v3==NAT_RED)
;//ME 					bfdesc->RGR+=I.inform.Evaluate();
				else
;//ME 					bfdesc->BGR+=I.inform.Evaluate();
		}
}
Ejemplo n.º 8
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_airgrp
//Author		Jim Taylor
//Date			Mon 16 Jun 1997
//
//Description
//
//Inputs
//
//Returns
//
//------------------------------------------------------------------------------
void	Persons4::make_airgrp(info_airgrp& I)
{
	if (!justscanning)
	{
		info_airgrp*	J=new info_airgrp;
		*J=I;
		int v1,v2,v3;
		if ((v3=J->nat.Evaluate())==ENABLE_COMPLEX_VAL)
			v3=NAT_RED;//defaultside;
		if ((v1=J->uid.Evaluate())==ENABLE_COMPLEX_VAL)
			if ((v2=J->band.Evaluate())==ENABLE_COMPLEX_VAL)
//DEADCODE DAW 24/11/99 				if (v3==(int)NAT_RED)
//DEADCODE DAW 24/11/99 					J->uniqueID.count=assignuid(RedAcBAND);
//DEADCODE DAW 24/11/99 				else
				J->uniqueID.count=assignuid(RealAcBAND);
			else
				J->uniqueID.count=assignuid((UniqueIDBand)v2);
		else
			if (&ConvertPtrUID(UniqueID(v1)))
            {
            	PleaseWarnUser("This battlfield has been damaged because of the above error. Do not save it!","Aircraft with named UID already loaded.");
				J->uniqueID.count=assignuid(getbandfromUID(UniqueID(v1)));
            }
			else
				J->uniqueID.count=UniqueID(v1);
#ifndef	__BCPLUSPLUS__
		if (J->wpref==UID_NULL)
			J->wpref=UniqueID(GR_lastroutefirstwaypoint);
#endif
		if ((v3=J->wpnum.Evaluate())!=ENABLE_COMPLEX_VAL)
			while (--v3>=0)
			{
				info_waypointPtr w=ConvertPtrUID(J->wpref);
				J->wpref=w->nextwp;
			}
//DeadCode MS 26Sep00 #ifndef NDEBUG
//DeadCode MS 26Sep00 			{	//Homebase never filled in...
//DeadCode MS 26Sep00  				info_waypointPtr w=ConvertPtrUID(J->wpref);
//DeadCode MS 26Sep00 				if (w->applygroup!=ENABLE_COMPLEX_VAL)
//DeadCode MS 26Sep00 					assert(	w->target.Evaluate()==J->homebase.Evaluate());
//DeadCode MS 26Sep00 			}
//DeadCode MS 26Sep00 #endif
		//NOTE:
			//Coming back from the 3d, the information represented here
			//is not up to date.
			//We need to have recorded the new position, waypoint and strength
			//of each aircraft.
			//This note is repeated in mapcode.cpp
			//
#ifndef NDEBUG
		bobassert (loadedSAGcount<MAX_LOADEDSAG,": Too many sags loaded!");
		loadedSAG[loadedSAGcount++]=J->uniqueID.count;
#endif
		J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
		J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
		J->position.EvalW(J->World);
  //		J->shape=ShapeNum(J->shape.Evaluate());
//		FixupRouteOwner(J->uniqueID.count,J->wpref);
  //		FixupRouteOwner(J->uniqueID.count,J->wpref);
//camp tmp		if (J->inform.Evaluate()==ENABLE_COMPLEX_VAL)
//			MissionEditor->ActiveCampaign.PlayerAcuid = J->uniqueID.count;
		logUID(J);
	}
	else
	{
		int	v3;
		if ((v3=I.nat.Evaluate())==ENABLE_COMPLEX_VAL)
			v3=NAT_RED;//defaultside;
        if (bfdesc)
			if (I.inwing.Evaluate()==ENABLE_COMPLEX_VAL)
				if (v3==NAT_RED)
;//ME 					bfdesc->RAC+=12;
				else
;//ME 					bfdesc->BAC+=12;
			else
				if (v3==NAT_RED)
;//ME 					bfdesc->RAC+=I.inform.Evaluate();
				else
;//ME 					bfdesc->BAC+=I.inform.Evaluate();
	}
}
Ejemplo n.º 9
0
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		make_waypoint
//Author		Jim Taylor
//Date			Wed 18 Jun 1997
//
//Description
//
//Inputs		if I.useexistingWP then evaluate that to get UID to link in!
//				no other vars will be filled in.
//
//Returns
//
//------------------------------------------------------------------------------
UniqueID	Persons4::make_waypoint(info_waypoint& I)
{
    if (!justscanning)
    {
        info_waypoint*	J=new info_waypoint;
        *J=I;
        int v=I.uid.Evaluate();
        if (v<=0)
            v=assignuid(WayPointBAND);
        J->uniqueID.count=UniqueID(v);
        J->bfieldindex=currbfindex;
//		J->uniqueID.sector=loadingmainworld;
        J->uniqueID.changed=FALSE;
//		J->uniqueID.deaded=FALSE;
        //Position calculated in FixupRouteOwner
        logUID(J);
#ifndef __BCPLUSPLUS__
#ifndef NDEBUG													//DAW 29Jun99
        if (	J->target.complex	&& J->target->type==Expr::EXPR_GLOB
                &&	J->position.complex && J->position->type==Expr::EXPR_WORLD)
        {
            WorldExpr* W=(WorldExpr*)J->position.complex;
            GlobRefExpr* G=(GlobRefExpr*)J->target.complex;
            if (!W->rotate.complex && W->delta.complex)
                if (G->globrefind==SGR_WPP_Target || G->globrefind==SGR_WPC_Target)
                {   //reconstruct coordinates.
                    //were based on XYZ delta.
                    //Switch to Hdg&range plus Y absolute
                    XyzExpr* XYZ=(XyzExpr*)W->delta.complex;
                    EventVal newpos;
                    newpos.MakeAngWorldPos(SavedGlobrefs(G->globrefind),XYZ->Y.Evaluate());
                    RotExpr* R=(RotExpr*)( ((WorldExpr*)newpos.complex)->rotate.complex );
                    int deltax=XYZ->X.Evaluate();
                    int deltaz=XYZ->Z.Evaluate();
                    R->hdg=Math_Lib.HighArcTan(deltax,deltaz);
                    R->range=Math_Lib.distance3d(deltax,deltaz,0);

                    J->target=GOT_UNDEFINED_VAL;
                    J->position=newpos;
                }
        }
#endif
#endif
        if (J->prevwp && J->prevwp!=IllegalSepID)
        {
            info_waypoint* W=*ConvertPtrUID(J->prevwp);
            W->nextwp=UniqueID(v);
            if (W->events
                    &&	W->position.complex
                    &&	W->position.complex->Arguments()==2
                    &&  W->position[1]->type==Expr::EXPR_ROT
                    &&  W->position[1][0]->type==Expr::EXPR_ICPT
               )
            {
                //if coords expr for pos[0] == prev wp == ICPT[0]
                //change to UID of prevwp
                //if coords expr for new wp == ICPT[1]
                //change to UID of new wp
            }
        }
        else
            J->prevwp=UID_Null;
        J->nextwp=UID_Null;
        return UniqueID(v);
    }
    else if (bfdesc && justscanning==SCANNAMES)
        ;//ME 			bfdesc->WP++;
    return UID_Null;

}