Esempio 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;

}
Esempio n. 2
0
/*!
  The constructor sets the verbosity level to report results,
  function progress messages, clock output messages and RNG seed
  information by default.
*/
static void vrb_printf(const char *cname,const char *fname,const char *str){
#if TARGET == BGL || TARGET == BGP || (defined USE_QMP )
  if (!UniqueID()) printf("Node %d: %s::%s: %s",UniqueID(),cname,fname,str);
#else
  printf("%s::%s: %s",cname,fname,str);
#endif
}
Esempio n. 3
0
void	CDamage::FillList()
{
//DeadCode JIM 20Oct00 	int setindex=-1;
//DeadCode JIM 20Oct00 	int listlen=0;
	CRListBox*	l=GETDLGITEM(IDC_LIST_ELEMENTS);
	l->Clear();
	//Find damage info for group
	int de=numdamagedelts;
	while(de-->0)
		breakif (damagedelements[de].loadedid==groupnum);

	if (de>=0)
	{
		int specificeltdamage=de;
		UniqueID startpoint=UID_NULL;
		UniqueID findpoint=(UniqueID)wavenum;
		if (wavenum!=groupnum)
		{
			if (!DeadStream::MainWorldBand(UniqueID(groupnum)))
				startpoint=findpoint;
			findpoint=damagedelements[specificeltdamage].memberid;
		}
		DeadStream::DeadBlockItterator itt(Dead_Stream.firstblock,startpoint);
		itt.SkipToItem(findpoint);
		//list elements
		l->AddColumn(TARGETFIELDWIDTH+50);
		l->AddColumn(50);
		for (GroupItterator si(damagedelements[specificeltdamage].shape,&itt);si;si++)
		{
			if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS && si.shape!=CTRPTC && si.shape!=CRKPTC)
			{
				l->AddString(GetShapeName(si.shape)+" "+GetEltDeltaName(si.delta),0);
				l->AddString(RESLIST(DAMAGESTAT_ALIVE,((MinAnimData&)si.AnimDataByte()).itemstate),1);
			}
		}
	}
	else
	{
		l->AddColumn(TARGETFIELDWIDTH+100);
		info_itemS* p = *Persons2::SlowConvertPtrUID(UniqueID(groupnum));
		if (p)
			if (p->Status.size>=MOBILESIZE)
			{
				EventVal& type=p->shape;
				int max=(info_grndgrpPtr(*p)->inform);
				for (int i=0;i<max;i++)
					l->AddString(GetShapeName(ShapeNum(type.Evaluate(i))),0);
			}
			else
				for (GroupItterator si(ShapeNum(p->shape.Evaluate()));si;si++)
				{
					if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS && si.shape!=CTRPTC && si.shape!=CRKPTC)
					{
						l->AddString(GetShapeName(si.shape)+" "+GetEltDeltaName(si.delta),0);
					}
				}

	}
}
Esempio n. 4
0
void Dossier::OnClickedPhoto() 
{
#ifndef	BOB_DEMO_VER

	if (LUF_FighterLF2BAND==Persons2::GetBandFromUID(uid) && RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
	{
// launch fighters dialog

		int i=0;
		while (Node_Data.gruppe[i].squadron != SQ_ZERO)
		{
			if (Node_Data.gruppe[i].homeairfield == uid)
			{
				if (Node_Data.gruppe[i].AcType()<PT_LW_BOMBERS)
				{
					MainToolBar().OpenACDossier(Node_Data.gruppe[i].wadernum,
						Node_Data.gruppe[i].gruppennum);

					break;
				}
			}
			i++;
		}
	}
	else	
	{
 		if (ReconnRequired())
		{
			int packnum=Todays_Packages_NewPackage(uid,MMC.directives.lw.userprofiles[Directives::LW::RECON]);
			if (packnum < 0)
				RDialog::RMessageBox(IDS_WARNING, IDS_NOAIRCRAFTAVAIL,NULL,NULL,IDS_CONTINUE);
			else
			{
				Todays_Packages[packnum].CalcRoutePositionsAndTime();
				MainToolBar().OnClickedMissionfolder();
				Todays_Packages.InvalidateRoute(&Todays_Packages[packnum],true,true);

			}
		}else
		{
	#ifndef NDEBUG
	#define PLACEMENT	CRect(0,0,512,384)
	#else
	#define	PLACEMENT	Place(POSN_CENTRE,POSN_CENTRE, 0, 0)
	#endif
	//	#define PLACEMENT	CRect(0,0,512,384)
			UniqueID targID=UniqueID(uid);
			CString tname=GetTargName(targID);
			OverLay.SetTargName((char*)LPCTSTR(tname));
			OverLay.loader_art=FIL_LOADING;									//RJS 16Aug00
			LogChild(0,MakeTopDialog(PLACEMENT,DialBox(OverLay.loader_art,new Rtestsh1(UniqueID(uid)),EDGES_NOSCROLLBARS)));
			Rtestsh1::Start3d(Rtestsh1::S3D_DONEBACK);
		}
	}
#endif
}
Esempio n. 5
0
UniqueID Persons2::GetNthSGTMember(UniqueID SGT,UniqueIDBand uidband,int count)
{
	info_itemS *p;
	for (int i=uidband;i<IllegalSepID;i++)
		if ((p=*ConvertPtrUID(UniqueID(i)))!=NULL)
			if (p->SGT==SGT)
				if (!count--)
					return UniqueID(i);
	return SGT;
}
Esempio n. 6
0
Bool __fastcall TMissionEditor::OverStatic( int X, int Y,UniqueID& currUID)
{

	int	tlx=X-ICONW/2,	//The icons are centred on the world position already,
		tly=Y-ICONW/2,	//
		brx=X+ICONW/2,	//I am considering a box around the mouse to be equivalent
		bry=Y+ICONW/2;	//to a box around the icon

		WorldPosition(brx,bry);
		WorldPosition(tlx,tly);

	int	uid=currobj;
	info_base* i=*Persons2::ConvertPtrUID(UniqueID(uid));
	if (!i
		||	brx<i->World.X || bry>i->World.Z
		||	tlx>i->World.X || tly<i->World.Z)
	for(SWord b = 0; b < (int)MaxBANDNum;b++)
	{
		i=NULL;
		if (b!=WayPointBANDNum && staticbands[b].visible)
		{
			for(uid = staticbands [b].startband;
				uid < (int)staticbands [b].endband;
				uid ++)
			{
				i=*Persons2::ConvertPtrUID(UniqueID(uid));
				if (i
					&&	brx>i->World.X && bry<i->World.Z
					&&	tlx<i->World.X && tly>i->World.Z)
				{
					if (	(MissionEditor->loadedbfs[i->bfieldindex].viewable)
						&&  (SuperGroupViewable(uid))
						)

//						if (	(i->bfieldindex || canmodifymainworld)
 //							||	(displayworldtemplateitems)
  //							)
							{
								b=MaxBANDNum;
								break;
							}
				}
				i=NULL;
			}
		}
	}
	if (i)
	{
		currUID=uid;
		return(true);
	}
	else
		return(false);
}
Esempio n. 7
0
UniqueID		UIDExpr::EvalW(Coords3D& c)
{
	ItemBasePtr p=Persons2::ConvertPtrUID(UniqueID(val.Evaluate(0)));
	if (p)
	{
		c=p->World;
		return UID_Null;
	}
	else
		return	UniqueID(val.Evaluate(0));
}
Esempio n. 8
0
UniqueID		UIDExpr::EvalA(HP& c)
{
	ItemBasePtr p=Persons2::ConvertPtrUID(UniqueID(val.Evaluate(0)));
	if (p && (int)p->Status.size>=(int)HPSIZE)
	{
		hpitem* q=*p;
		c.H=q->hdg;
		c.P=q->pitch;
		return UID_Null;
	}
	return UniqueID(val.Evaluate(0));
}
Esempio n. 9
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();
	}
}
Esempio n. 10
0
//------------------------------------------------------------------
void Verbose::Flow(const char *class_name, const char *func_name,
		   const char *format, ...){
    
    if(!active[VERBOSE_FLOW_LEVEL]) return;
    char vrb_string[MAX_STRING];
    
//    printf("%s::%s :", class_name, func_name);
    va_list args;
    va_start(args, format);
//    vprintf(format, args);
    vsnprintf(vrb_string, MAX_STRING,format, args);
    vrb_printf(class_name,func_name,vrb_string);
    if(active[VERBOSE_FLOW_CLOCK_LEVEL]){
#ifdef _TARTAN
	printf(" Clock (12.5 MHz) = %d\n\t", (int)clock());
#else
	int cps = CLOCKS_PER_SEC;
      if (!UniqueID())
	printf(" Clock (%2.1f MHz) = %d\n\t", cps/1.e+06, (int)clock());
#endif
    }
    else {
//	printf("\n\t");
    }
    
}
Esempio n. 11
0
CMacro* CMacroList::AddMacroAt(int nIndex, LPCSTR pName, LPCSTR pValue)
{
	CMacro* pMacro = FindMacro(pName);
	
	if (pMacro == NULL)
	{
	// Safe 'new'...
		TRY
			pMacro = new CMacro;
		END_TRY
	
		WORD wID;
	
		if ((wID = UniqueID()) == 0)
		{
		/* Should never happen, but who knows? */
			return NULL;
		}
	
		if (pMacro != NULL)
		{
			pMacro->Id(wID);
			pMacro->Name(pName);
			pMacro->Value(pValue);
	
			InsertAt(nIndex, pMacro);
		}
	}
	return pMacro;			// And return it in case anybody cares.
}
Esempio n. 12
0
void CDamage::OnTextChangedComboElements(LPCTSTR text, short index) 
{
	// TODO: Add your control notification handler code here
  	CRCombo* combo;
	combo=GETDLGITEM(IDC_COMBO_ELEMENTS);
	int comboindex = combo->GetIndex();	
//DEADCODE RDH 16/05/00 	if (comboindex==0)
		groupnum=internalUIDList[comboindex];
//DEADCODE RDH 16/05/00 	else
//DEADCODE RDH 16/05/00 	{
//DEADCODE RDH 16/05/00 		internalUIDList
//DEADCODE RDH 16/05/00 		info_itemS*	p;
//DEADCODE RDH 16/05/00 		UniqueIDBand band;
//DEADCODE RDH 16/05/00 		for (int i=BritAAASiteBAND;i<WorldStuff::PITEMTABLESIZE;i++)
//DEADCODE RDH 16/05/00 			if (	((p=Persons2::ConvertPtrUID(UniqueID(i)))!=NULL)
//DEADCODE RDH 16/05/00 				&&	(p->SGT==wavenum && p->shape.Evaluate()!=EMPTY)
//DEADCODE RDH 16/05/00 				&&	(band=Persons2::getbandfromUID(UniqueID(i)))!=0
//DEADCODE RDH 16/05/00 				&&	band!=LandscapeBAND
//DEADCODE RDH 16/05/00 				)
//DEADCODE RDH 16/05/00 				if (--comboindex==0)
//DEADCODE RDH 16/05/00 					groupnum=i;
//DEADCODE RDH 16/05/00 	}
	m_pView->m_mapdlg.ResetIcon(UniqueID(groupnum));
	FillList();
}
Esempio n. 13
0
//---------------------------------------------------------------------------
void __fastcall TGroundGroupForm::SuperGroupComboChange(TObject *Sender)
{
	info_itemS*	I= *Persons2::ConvertPtrUID(MissionEditor->currobj);
    I->SGT=UniqueID(GetSGListEntry(SuperGroupCombo->ItemIndex));
	RefreshText();
	MissionEditor->Invalidate();
}
Esempio n. 14
0
/////////////////////////////////////////////////////////////////////////////
// HostilesList message handlers
bool NodeData::Response(int pack, int firstsq)
{
 	bool	response = false;
	if (pack != -1)
	{
		Profile& pk = Todays_Packages.pack[pack];
		int rafpack = 0;

		
		UniqueID checkid=pk[firstsq].instance;
		if (checkid==UID_NULL)
		 	checkid=UniqueID(UID_BIT14+((pack)<<5));

		while	(		(rafpack < Profile::MAX_PACKS)
					&&	(!response)
				)
		{
			Profile* rafpk = &Todays_Packages.pack[rafpack];
			if  (	(Todays_Packages.pack[rafpack].packagestatus!=Profile::PS_SPARE)
				&&	(	(rafpk->packagetarget[0] == checkid)
					||	(rafpk->packagetarget[1] == checkid)
				)	)
				response = true;
			rafpack++;
		}
	}
	return (response);

}
Esempio n. 15
0
CDamage::CDamage(int sgt,int uid,CWnd* pParent /*=NULL*/)
	: RowanDialog(CDamage::IDD, pParent)
{
	//{{AFX_DATA_INIT
//	info_base* i=*Persons2::ConvertPtrUID(UniqueID(uid));
//	if (i->SGT)
//	{
		specificelt=UniqueID(uid);
//		uid=i->SGT;
//	}
	//}}AFX_DATA_INIT
	SetProjSpecific(-1,sgt,uid);  
	Node_Data.CheckTargetLoaded(UniqueID(sgt));
	damagedelements=new DamageDef[100];
	numdamagedelts=Dead_Stream.DecodeDamage(UniqueID(sgt),damagedelements);
}
Esempio n. 16
0
RenderLayerRule::RenderLayerRule(
    const char*         name,
    const ParamArray&   params)
  : Entity(g_class_uid, params)
  , impl(new Impl())
{
    set_name(name);

    const EntityDefMessageContext context("render layer rule", this);

    impl->m_render_layer = params.get_required<string>("render_layer", "", context);
    impl->m_order = params.get_required<int>("order", 0, context);

    const string entity_type = params.get_optional<string>("entity_type", "");

    if (entity_type == "")
        impl->m_entity_type_uid = UniqueID(~0);
    else if (entity_type == "assembly")
        impl->m_entity_type_uid = Assembly::get_class_uid();
    else if (entity_type == "assembly_instance")
        impl->m_entity_type_uid = AssemblyInstance::get_class_uid();
    else if (entity_type == "edf")
        impl->m_entity_type_uid = EDF::get_class_uid();
    else if (entity_type == "environment_edf")
        impl->m_entity_type_uid = EnvironmentEDF::get_class_uid();
    else if (entity_type == "environment_shader")
        impl->m_entity_type_uid = EnvironmentShader::get_class_uid();
    else if (entity_type == "light")
        impl->m_entity_type_uid = Light::get_class_uid();
    else if (entity_type == "material")
        impl->m_entity_type_uid = Material::get_class_uid();
    else if (entity_type == "object")
        impl->m_entity_type_uid = Object::get_class_uid();
    else if (entity_type == "object_instance")
        impl->m_entity_type_uid = ObjectInstance::get_class_uid();
    else if (entity_type == "surface_shader")
        impl->m_entity_type_uid = SurfaceShader::get_class_uid();
    else
    {
        RENDERER_LOG_ERROR(
            "%s: invalid value \"%s\" for parameter \"%s\", using default value \"\".",
            context.get(),
            entity_type.c_str(),
            "entity_type");
        impl->m_entity_type_uid = UniqueID(~0);
    }
}
Esempio n. 17
0
void	PackageList::BuildReorderTable(bool doreorder)
{
//	UniqueID	*ReorderLookup;
	for (int i=0;i<MAX_REORDERLOOKUP;i++)
		ReorderLookup[i]=UniqueID(SagBAND+i);
	int reorder=SagBAND;
	int	reorderempty=RealAcBAND-1;
	if (doreorder)
		for (int p=0;p<Profile::MAX_PACKS;p++)
			if (pack[p].packagestatus>Profile::PS_PLANNING && pack[p].packagestatus<Profile::PS_COMPLETE)
				for (int s=0,smax=pack[p].squadlist;s<smax;s++)
					if (pack[p][s].numacleft)
						ReorderLookup[pack[p][s].instance-SagBAND]=UniqueID(reorder++);
					else
						ReorderLookup[pack[p][s].instance-SagBAND]=UniqueID(reorderempty--);
	debugmaxcount=reorder;
}
Esempio n. 18
0
// nsIAccessNode
NS_IMETHODIMP
nsAccessNode::GetUniqueID(void **aUniqueID)
{
  NS_ENSURE_ARG_POINTER(aUniqueID);

  *aUniqueID = UniqueID();
  return NS_OK;
}
Esempio n. 19
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;

}
Esempio n. 20
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();
    }
}
Esempio n. 21
0
int Persons2::GetNOfSGTMember(UniqueID SGT,UniqueIDBand uidband,UniqueID member)
{
	info_itemS *p;
	int count=0;
	for (int i=uidband;i<member;i++)
		if ((p=*ConvertPtrUID(UniqueID(i)))!=NULL)
			if (p->SGT==SGT)
				count++;
	return count;
}
Esempio n. 22
0
const char *FileName(const char* stem, long d)
{
   NTL_TLS_LOCAL(string, sbuf);

   stringstream ss;
   ss << "tmp-ntl-" << stem;
   ss << "-" << setfill('0') << setw(5) << d << "-";
   sbuf = ss.str() + UniqueID();
   return sbuf.c_str();
}
Esempio n. 23
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
//  {
//
//
//  }
}
Esempio n. 24
0
//------------------------------------------------------------------
void Verbose::FuncEnd(const char *class_name, const char *func_name){
    
    if(!active[VERBOSE_FUNC_LEVEL]) return;

//    printf("%s::%s : Exiting :", class_name, func_name);
    vrb_printf(class_name,func_name,"Exiting :");
    if(active[VERBOSE_FUNC_CLOCK_LEVEL]){
#ifdef _TARTAN
	printf("  Clock (12.5 MHz) = %d\n", (int)clock());
#else
	int cps = CLOCKS_PER_SEC;
     if(!UniqueID())
	printf("  Clock (%2.1f MHz) = %d\n", cps/1.e+06, (int)clock());
#endif
    }
    else {
	if (!UniqueID()) printf("\n");
    }
    
}
Esempio n. 25
0
void AirfieldDetails::OnClickedPhoto() 
{
#ifndef	BOB_DEMO_VER

 	{
#ifndef NDEBUG
#define PLACEMENT	CRect(0,0,512,384)
#else
#define	PLACEMENT	Place(POSN_CENTRE,POSN_CENTRE, 0, 0)
#endif
//	#define PLACEMENT	CRect(0,0,512,384)
		UniqueID targID=UniqueID(afuid);
		CString tname=GetTargName(targID);
		OverLay.SetTargName((char*)LPCTSTR(tname));
		OverLay.loader_art=FIL_LOADING;									//RJS 16Aug00
		LogChild(0,MakeTopDialog(PLACEMENT,DialBox(OverLay.loader_art,new Rtestsh1(UniqueID(afuid)),EDGES_NOSCROLLBARS)));
		Rtestsh1::Start3d(Rtestsh1::S3D_DONEBACK);
	}
#endif
	
}
Esempio n. 26
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
//  {
//
//
//  }
}
bool ChunkBinding::load( DataSectionPtr pSection )
{
	std::string idStr = pSection->readString( "fromID", "" );
	if (idStr.empty())
        return false;

	fromID_ = UniqueID(idStr);

	idStr = pSection->readString( "toID", "" );
	if (idStr.empty())
		return false;

	toID_ = UniqueID(idStr);

	from_ = ChunkItemTreeNode::nodeCache_.find(fromID_);
	if (from_)
	{
		from_->addBindingFromMe(this);
	}
	else
	{
		ChunkItemTreeNode::bindingCache_.addBindingFrom_OnLoad(this);
	}

	to_ = ChunkItemTreeNode::nodeCache_.find(toID_);
	if (to_)
	{
		to_->addBindingToMe(this);
	}
	else
	{
		ChunkItemTreeNode::bindingCache_.addBindingTo_OnLoad(this);
	}

	// add to cache
	ChunkItemTreeNode::bindingCache_.add(this);

	return true;
}
Esempio n. 28
0
void LWRouteMain::OnClickedRbuttonapplyalt() 
{
	if (Todays_Packages.pack[Todays_Packages.hipack].packagestatus!=Profile::PS_SPARE)
	{
		Profile& pack = Todays_Packages.pack[Todays_Packages.hipack];

		UniqueID wpuid = pack.route;
//DeadCode JIM 20Oct00 		int i=1;
		info_waypoint* cwp=*Persons2::ConvertPtrUID(Todays_Packages.hiwp);
		int worldY=cwp->World.Y;
		if (cwp->uid==-SGR_WPP_BombRendezvous || cwp->uid==-SGR_WPP_BombDisperse)
			worldY+=worldY;

		Todays_Packages[Todays_Packages.hipack].SetTargetGlobrefs();						//CSB 27Jun00
		Todays_Packages[Todays_Packages.hipack].RecalcPrimaryPositions();					//CSB 27Jun00

		while (wpuid)
		{
			info_waypoint* wp=*Persons2::ConvertPtrUID(wpuid);

			if (wp->applygroup.Evaluate()==ENABLE_COMPLEX_VAL)	//Not TO or land		//JIM 28Jun00
			{
				if (wp->uid==-SGR_WPP_BombRendezvous || wp->uid==-SGR_WPP_BombDisperse)
					wp->World.Y = worldY/2;
				else
					wp->World.Y = worldY;
				Coords3D	pos=wp->World;
				if (wp->target.Evaluate()!=ENABLE_COMPLEX_VAL)
					pos-=Persons2::ConvertPtrUID(UniqueID(wp->target.Evaluate()));
				wp->position.RecalcDeltasToMatch(pos);					//CSB 27Jun00
			}


			wpuid = wp->nextwp;
		}
		if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
		{
			Directives::LW::MissTypes misstype = LWDirectivesResults::LWMissType();
			MMC.directives.lw.userprofiles[misstype].mainalt = cwp->World.Y;
		}else
		{
  			Directives::RAF::MissTypes misstype = RAFDirectivesResults::RAFMissType(Todays_Packages.hipack);
			MMC.directives.raf.userprofiles[misstype].mainalt = cwp->World.Y;
		}

	}
    while (!Todays_Packages[Todays_Packages.hipack].CalcWPTimes())
		Todays_Packages[Todays_Packages.hipack].primarytargetETA+=10;
	RefreshList();
	RefreshButtons();
}
Esempio n. 29
0
void Package::FireLoadEvent(const IRI &url) const
{
    if ( _loadEventHandler == nullptr )
        throw std::runtime_error(_Str("No load event handler installed to load '", url.URIString(), "'"));
    
    if ( url.Path().find(_pathBase) == 0 )
    {
        _loadEventHandler(url);
        return;
    }
    
    IRI fixed(IRI::gEPUBScheme, UniqueID(), _pathBase, url.Query(), url.Fragment());
    fixed.AddPathComponent(url.Path());
    IRI::IRICredentials creds(url.Credentials());
    fixed.SetCredentials(creds.first, creds.second);
    
    _loadEventHandler(fixed);
}
Esempio n. 30
0
//------------------------------------------------------------------
void Verbose::Clock(const char *class_name, const char *func_name,
		    const char *format, ...){
    
    if(!active[VERBOSE_CLOCK_LEVEL]) return;
    char vrb_string[MAX_STRING];

//    printf("%s::%s :", class_name, func_name);
    va_list args;
    va_start(args, format);
//    vprintf(format, args);
    vsnprintf(vrb_string, MAX_STRING,format, args);
    vrb_printf(class_name,func_name,vrb_string);
    int cps = CLOCKS_PER_SEC;
#if TARGET == BGL
  if(!UniqueID())
#endif
    printf(" Clock (%2.1f MHz) = %d\n\t", cps/1.e+06, (int)clock());
    
}