CVX_FRegion::CVX_FRegion(const CVX_FRegion& iFRegion) //copy constructor
{
	Box = NULL;
	Cylinder = NULL;
	Sphere = NULL;
	Mesh = NULL;

	ClearRegion(); //clear everything out...
	DofFixed = iFRegion.DofFixed;
//	Fixed = iFRegion.Fixed;
	Force = iFRegion.Force;
	Torque = iFRegion.Torque;
	Displace = iFRegion.Displace;
	AngDisplace = iFRegion.AngDisplace;

	if (iFRegion.IsBox()) //if a box...
		CreateBoxRegion(Vec3D<>(iFRegion.Box->X, iFRegion.Box->Y, iFRegion.Box->Z), Vec3D<>(iFRegion.Box->dX, iFRegion.Box->dY, iFRegion.Box->dZ));
	else if (iFRegion.IsCylinder()) //if a box...
		CreateCylRegion(Vec3D<>(iFRegion.Cylinder->X, iFRegion.Cylinder->Y, iFRegion.Cylinder->Z), Vec3D<>(iFRegion.Cylinder->dX, iFRegion.Cylinder->dY, iFRegion.Cylinder->dZ), iFRegion.Cylinder->Radius);
	else if (iFRegion.IsSphere()) //if a box...
		CreateSphRegion(Vec3D<>(iFRegion.Sphere->X, iFRegion.Sphere->Y, iFRegion.Sphere->Z), iFRegion.Sphere->Radius);
	else if (iFRegion.IsMesh()) //if a mesh...
		CreateMeshRegion(&iFRegion.Mesh->ThisMesh, Vec3D<>(iFRegion.Mesh->X, iFRegion.Mesh->Y, iFRegion.Mesh->Z), Vec3D<>(iFRegion.Mesh->dX, iFRegion.Mesh->dY, iFRegion.Mesh->dZ));

	SetColor(iFRegion.pRegion->R, iFRegion.pRegion->G, iFRegion.pRegion->B, iFRegion.pRegion->alpha);
}
CVX_FRegion::CVX_FRegion(void)
{
	Box = NULL;
	Cylinder = NULL;
	Sphere = NULL;
	Mesh = NULL;

	ClearRegion();
}
Example #3
0
void Console::PushBackLines(ui32 amount)
{
  memcpy(m_Buffer, m_Buffer + (amount * m_ConsoleWidth), m_ConsoleWidth * (m_FullBufferHeight-amount));
  ClearRegion(0, m_FullBufferHeight-amount, m_ConsoleWidth, amount);
  m_Cursor -= m_ConsoleWidth*amount;

  m_ActiveFrame.cursorX = GetCursorX();
  m_ActiveFrame.cursorY = GetCursorY();
}
//战斗结束
void  CServerVillageRegion::OnWarEnd(long lWarNum)
{
	if( GetWarNum() != lWarNum)	return;

	if(GetCityState() == CIS_NO)	return;
	//清除申请帮会列表
	CServerWarRegion::OnWarEnd(lWarNum);
	ClearRegion();
	//设置无国家
	SetCountry(0);
	//设置无拥有者
	SetOwnedCityOrg(NULL_GUID, NULL_GUID);
	m_FlagOwnerFacID = NULL_GUID;
}
CVX_FRegion& CVX_FRegion::SetEqual(const CVX_FRegion& iFRegion) //function do do the equal-izing
{
	ClearRegion(); //clear everything out...
	DofFixed = iFRegion.DofFixed;
//	Fixed = iFRegion.Fixed;
	Force = iFRegion.Force;
	Torque = iFRegion.Torque;
	Displace = iFRegion.Displace;
	AngDisplace = iFRegion.AngDisplace;

	if (iFRegion.Box != NULL) //if a box...
		CreateBoxRegion(Vec3D<>(iFRegion.Box->X, iFRegion.Box->Y, iFRegion.Box->Z), Vec3D<>(iFRegion.Box->dX, iFRegion.Box->dY, iFRegion.Box->dZ));
	else if (iFRegion.Cylinder != NULL) //if a box...
		CreateCylRegion(Vec3D<>(iFRegion.Cylinder->X, iFRegion.Cylinder->Y, iFRegion.Cylinder->Z), Vec3D<>(iFRegion.Cylinder->dX, iFRegion.Cylinder->dY, iFRegion.Cylinder->dZ), iFRegion.Cylinder->Radius);
	else if (iFRegion.Sphere != NULL) //if a box...
		CreateSphRegion(Vec3D<>(iFRegion.Sphere->X, iFRegion.Sphere->Y, iFRegion.Sphere->Z), iFRegion.Sphere->Radius);
	else if (iFRegion.IsMesh()) //if a mesh...
		CreateMeshRegion(&iFRegion.Mesh->ThisMesh, Vec3D<>(iFRegion.Mesh->X, iFRegion.Mesh->Y, iFRegion.Mesh->Z), Vec3D<>(iFRegion.Mesh->dX, iFRegion.Mesh->dY, iFRegion.Mesh->dZ));

	SetColor(iFRegion.pRegion->R, iFRegion.pRegion->G, iFRegion.pRegion->B, iFRegion.pRegion->alpha);

	return *this;

}
// Scroll the icons
void backdrop_scroll_objects(BackdropInfo *info,short off_x,short off_y)
{
	// Lock window
	GetSemaphore(&info->window_lock,SEMF_EXCLUSIVE,0);

	// Window open?
	if (info->window)
	{
		short damage=0,clear=0;

		// Bounds-check the deltas
		if (off_x<0 && off_x<-RECTWIDTH(&info->size))
			clear=1;
		else
		if (off_x>0 && off_x>RECTWIDTH(&info->size))
			clear=1;
		else
		if (off_y<0 && off_y<-RECTHEIGHT(&info->size))
			clear=1;
		else
		if (off_y>0 && off_y>RECTHEIGHT(&info->size))
			clear=1;

		// Clear instead of scrolling?
		if (clear)
		{
			// Clear the whole window
			EraseRect(
				info->window->RPort,
				info->size.MinX,
				info->size.MinY,
				info->size.MaxX,
				info->size.MaxY);
		}

		// Scroll
		else
		{
			// Check for 39
			if(((struct Library *)GfxBase)->lib_Version>=39) 
			{
				// Scroll backdrop window
				ScrollRasterBF(
					info->window->RPort,
					off_x,off_y,
					info->size.MinX,
					info->size.MinY,
					info->size.MaxX,
					info->size.MaxY);
			}

			// No backfills
			else
			{
				// Scroll backdrop window
				ScrollRaster(
					info->window->RPort,
					off_x,off_y,
					info->size.MinX,
					info->size.MinY,
					info->size.MaxX,
					info->size.MaxY);
			}

			// Damaged simple-refresh?
			if (info->window->Flags&WFLG_SIMPLE_REFRESH &&
				info->window->WLayer->Flags&LAYERREFRESH)
			{
				// Forbid
#ifdef LOCKLAYER_OK
				LockScreenLayer(info->window->WScreen);
#else
				Forbid();
#endif

				// Begin refreshing
				BeginRefresh(info->window);

				// Clear the new bits
				EraseRect(
					info->window->RPort,
					info->size.MinX,
					info->size.MinY,
					info->size.MaxX,
					info->size.MaxY);

				// End refreshing for the moment
				EndRefresh(info->window,FALSE);
				damage=1;
			}
		}

		// Got temporary region?
		if (info->temp_region)
		{
			struct Rectangle rect;

			// Get refresh region
			rect.MinX=(off_x==0)?info->size.MinX:((off_x>0)?info->size.MaxX-off_x:info->size.MinX);
			rect.MaxX=(off_x==0)?info->size.MaxX:((off_x>0)?info->size.MaxX:info->size.MinX-off_x);
			rect.MinY=(off_y==0)?info->size.MinY:((off_y>0)?info->size.MaxY-off_y:info->size.MinY);
			rect.MaxY=(off_y==0)?info->size.MaxY:((off_y>0)?info->size.MaxY:info->size.MinY-off_y);

			// Bounds check region
			if (rect.MinX<info->size.MinX) rect.MinX=info->size.MinX;
			if (rect.MinY<info->size.MinY) rect.MinY=info->size.MinY;
			if (rect.MaxX>info->size.MaxX) rect.MaxX=info->size.MaxX;
			if (rect.MaxY>info->size.MaxY) rect.MaxY=info->size.MaxY;

			// Add to damage list?
			if (damage)
			{
				// Or rectangle in
				OrRectRegion(info->window->WLayer->DamageList,&rect);
			}

			// Manually refresh
			else
			{
				// Set refresh region
				ClearRegion(info->temp_region);
				OrRectRegion(info->temp_region,&rect);

				// Install region
				InstallClipRegion(info->window->WLayer,info->temp_region);
			}
		}

		// Manual refresh?
		if (!damage)
		{
			// Refresh
			backdrop_show_objects(info,BDSF_NO_CLIP);

			// Remove clip region
			InstallClipRegion(info->window->WLayer,0);
		}

		// Automatic refresh
		else
		{
			// Lister?
			if (info->lister)
				lister_refresh_callback(IDCMP_REFRESHWINDOW,info->window,info->lister);

			// Other type
			else
			{
				struct IntuiMessage msg;

				// Fake IntuiMessage
				msg.Class=IDCMP_REFRESHWINDOW;

				// Handle refresh
				backdrop_idcmp(info,&msg,0);
			}

			// Enable multi-tasking
#ifdef LOCKLAYER_OK
			UnlockScreenLayer(info->window->WScreen);
#else
			Permit();
#endif
		}
	}

	// Unlock window
	FreeSemaphore(&info->window_lock);
}