Пример #1
0
void CJaw::PostSerialize()
{
	BaseClass::PostSerialize();

	if(m_auxSlotUsed)
	{
		SetViewMode(0);
		DrawSlot(eIGS_ThirdPersonAux,true);
	}
	else if (GetOwner() != 0 && !IsAttachedToBack() && !IsAttachedToHand())
	{
		Hide(true);
	}
	else if (!IsOwnerFP())
	{
		SetViewMode(eIVM_ThirdPerson);
		DrawSlot(eIGS_ThirdPerson, true);
		DrawSlot(eIGS_ThirdPersonAux,false);
	}

	if (m_smokeActive)
	{
		Pickalize(false, true);
	}

	if (GetOwner() != 0)
	{
		CActor* pOwner = GetOwnerActor();
		IInventory* pInventory = pOwner ? pOwner->GetInventory() : 0;
		UnregisterUsedAmmoWithInventory(pInventory);
		RegisterUsedAmmoWithInventory(pInventory);
	}
}
Пример #2
0
//========================================
void CRocketLauncher::OnReset()
{
	if(m_stats.backAttachment==eIBA_Unknown)
		m_auxSlotUsed = true;

	CWeapon::OnReset();

	if(m_stats.backAttachment==eIBA_Unknown)
	{
		SetViewMode(0);
		DrawSlot(eIGS_ThirdPersonAux,true);
	}
	else
		m_stats.first_selection = false;

	if(m_smokeEffectSlot!=-1)
	{
		GetEntity()->FreeSlot(m_smokeEffectSlot);
		m_smokeEffectSlot = -1;
	}

	ActivateTPLaser(false);
	m_laserFPOn = m_laserTPOn = false;

	m_lastLaserHitPt.Set(0.0f,0.0f,0.0f);
	m_lastLaserHitSolid = false;
	m_smoothLaserLength = -1.0f;
	m_firedRockets = 0;

	m_listeners.clear();
}
Пример #3
0
bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation)
{
  CSingleLock lock(m_sharedSection);
  ReleaseBuffers();

  m_sourceWidth  = width;
  m_sourceHeight = height;
  m_renderOrientation = orientation;

  m_fps = fps;
  m_iFlags = flags;

  // cause SetVideoRect to trigger - needed after a hdmi mode change
  m_src_rect.SetRect(0, 0, 0, 0);
  m_dst_rect.SetRect(0, 0, 0, 0);

  CLog::Log(LOGDEBUG, "%s::%s - %dx%d->%dx%d@%.2f flags:%x format:%d ext:%x orient:%d", CLASSNAME, __func__, width, height, d_width, d_height, fps, flags, format, extended_format, orientation);
  if (format != RENDER_FMT_BYPASS && format != RENDER_FMT_MMAL)
  {
    CLog::Log(LOGERROR, "%s::%s - format:%d not supported", CLASSNAME, __func__, format);
    return false;
  }

  // calculate the input frame aspect ratio
  CalculateFrameAspectRatio(d_width, d_height);
  SetViewMode(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_ViewMode);
  ManageRenderArea();

  m_bMMALConfigured = init_vout(format, m_opaque);
  m_bConfigured = m_bMMALConfigured;
  assert(m_bConfigured);
  return m_bConfigured;
}
bool CWinRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags)
{
  if(m_sourceWidth  != width
  || m_sourceHeight != height)
  {
    m_sourceWidth       = width;
    m_sourceHeight      = height;
    // need to recreate textures
    m_NumYV12Buffers    = 0;
    m_iYV12RenderBuffer = 0;
  }

  m_flags = flags;

  // calculate the input frame aspect ratio
  CalculateFrameAspectRatio(d_width, d_height);
  ChooseBestResolution(fps);
  SetViewMode(g_settings.m_currentVideoSettings.m_ViewMode);
  ManageDisplay();

  m_bConfigured = true;

  SelectRenderMethod();
  UpdateRenderMethod();

  return true;
}
Пример #5
0
bool CWinRenderer::Configure(const VideoPicture &picture, float fps, unsigned flags, unsigned int orientation)
{
  m_sourceWidth       = picture.iWidth;
  m_sourceHeight      = picture.iHeight;
  m_renderOrientation = orientation;
  // need to recreate textures
  m_NumYV12Buffers    = 0;
  m_iYV12RenderBuffer = 0;
  // reinitialize the filters/shaders
  m_bFilterInitialized = false;

  m_fps = fps;
  m_iFlags = flags;
  m_format = picture.videoBuffer->GetFormat();
  if (m_format == AV_PIX_FMT_D3D11VA_VLD)
  {
    DXVA::CDXVAOutputBuffer *dxvaBuf = static_cast<DXVA::CDXVAOutputBuffer*>(picture.videoBuffer);
    m_dxva_format = dxvaBuf->format;
  }

  // calculate the input frame aspect ratio
  CalculateFrameAspectRatio(picture.iDisplayWidth, picture.iDisplayHeight);
  SetViewMode(m_videoSettings.m_ViewMode);
  ManageRenderArea();

  SelectRenderMethod();
  m_bConfigured = true;

  // load 3DLUT
  ColorManagmentUpdate();

  return true;
}
Пример #6
0
bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation)
{
  CSingleLock lock(m_sharedSection);
  ReleaseBuffers();

  m_sourceWidth  = width;
  m_sourceHeight = height;
  m_renderOrientation = orientation;

  m_fps = fps;
  m_iFlags = flags;

  CLog::Log(LOGDEBUG, "%s::%s - %dx%d->%dx%d@%.2f flags:%x format:%d ext:%x orient:%d", CLASSNAME, __func__, width, height, d_width, d_height, fps, flags, format, extended_format, orientation);

  m_RenderUpdateCallBackFn = NULL;
  m_RenderUpdateCallBackCtx = NULL;

  // calculate the input frame aspect ratio
  CalculateFrameAspectRatio(d_width, d_height);
  SetViewMode(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_ViewMode);
  ManageDisplay();

  m_bMMALConfigured = init_vout(format);
  m_bConfigured = m_bMMALConfigured;
  assert(m_bConfigured);
  return m_bConfigured;
}
Пример #7
0
void FProfilerManager::LoadProfilerCapture( const FString& ProfilerCaptureFilepath, const bool bAdd /*= false*/ )
{
	// deselect the active session
	if (ActiveSession.IsValid())
	{
		SessionManager->SelectSession(NULL);
	}

	if( bAdd == false )
	{
		ClearStatsAndInstances();
	}

	FProfilerSessionRef ProfilerSession = MakeShareable( new FProfilerSession( ProfilerCaptureFilepath ) );
	auto Var = ProfilerSession->AsShared();
	const FGuid ProfilerInstanceID = ProfilerSession->GetInstanceID();

	ProfilerSession->
		SetOnCaptureFileProcessed( FProfilerSession::FCaptureFileProcessedDelegate::CreateSP( this, &FProfilerManager::ProfilerSession_OnCaptureFileProcessed ) )
		.SetOnAddThreadTime( FProfilerSession::FAddThreadTimeDelegate::CreateSP( this, &FProfilerManager::ProfilerSession_OnAddThreadTime ) );

	ProfilerSessionInstances.Add( ProfilerInstanceID, ProfilerSession );
	{
		PROFILER_SCOPE_LOG_TIME( TEXT( "ProfilerClient->LoadCapture" ), );
		ProfilerClient->LoadCapture( ProfilerCaptureFilepath, ProfilerInstanceID );
	}

	SessionInstancesUpdatedEvent.Broadcast();
	ProfilerType = EProfilerSessionTypes::StatsFile;
	
	GetProfilerWindow()->ManageEventGraphTab( ProfilerInstanceID, true, ProfilerSession->GetName() );
	SetViewMode( EProfilerViewMode::LineIndexBased );
}
Пример #8
0
void FProfilerManager::LoadRawStatsFile( const FString& RawStatsFileFileath )
{
	if( ActiveSession.IsValid() )
	{
		SessionManager->SelectSession( NULL );
	}
	ClearStatsAndInstances();

	TSharedRef<FRawProfilerSession> ProfilerSession = MakeShareable( new FRawProfilerSession( RawStatsFileFileath ) );
	const FGuid ProfilerInstanceID = ProfilerSession->GetInstanceID();
	ProfilerSessionInstances.Add( ProfilerInstanceID, ProfilerSession );

	ProfilerSession->
		//SetOnCaptureFileProcessed( FProfilerSession::FCaptureFileProcessedDelegate::CreateSP( this, /&FProfilerManager::ProfilerSession_OnCaptureFileProcessed ) )
		SetOnAddThreadTime( FProfilerSession::FAddThreadTimeDelegate::CreateSP( this, &FProfilerManager::ProfilerSession_OnAddThreadTime ) );

	ProfilerSessionInstances.Add( ProfilerInstanceID, ProfilerSession );

	ProfilerSession->PrepareLoading();
	RequestFilterAndPresetsUpdateEvent.Broadcast();
	//ProfilerSession_OnCaptureFileProcessed( ProfilerInstanceID );
	bHasCaptureFileFullyProcessed = true;
	//TrackDefaultStats();

	SessionInstancesUpdatedEvent.Broadcast();
	ProfilerType = EProfilerSessionTypes::StatsFileRaw;
	
	GetProfilerWindow()->ManageEventGraphTab( ProfilerInstanceID, true, ProfilerSession->GetName() );
	SetViewMode( EProfilerViewMode::ThreadViewTimeBased );

	GetProfilerWindow()->GraphPanel->ThreadView->AttachProfilerStream( ProfilerSession->GetStream() );
}
Пример #9
0
FMaterialEditorViewportClient::FMaterialEditorViewportClient(TWeakPtr<IMaterialEditor> InMaterialEditor, FPreviewScene& InPreviewScene, const TSharedRef<SMaterialEditorViewport>& InMaterialEditorViewport)
	: FEditorViewportClient(nullptr, &InPreviewScene, StaticCastSharedRef<SEditorViewport>(InMaterialEditorViewport))
	, MaterialEditorPtr(InMaterialEditor)
{
	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = false;
	DrawHelper.GridColorAxis = FColor(80,80,80);
	DrawHelper.GridColorMajor = FColor(72,72,72);
	DrawHelper.GridColorMinor = FColor(64,64,64);
	DrawHelper.PerspectiveGridSize = HALF_WORLD_MAX1;
	
	SetViewMode(VMI_Lit);
	
	EngineShowFlags.DisableAdvancedFeatures();
	EngineShowFlags.SetSnap(0);

	OverrideNearClipPlane(1.0f);
	bUsingOrbitCamera = true;

	// Don't want to display the widget in this viewport
	Widget->SetDefaultVisibility(false);
}
Пример #10
0
void FProfilerManager::SessionManager_OnInstanceSelectionChanged()
{
	const ISessionInfoPtr& SelectedSession = SessionManager->GetSelectedSession();
	const bool SessionIsValid = SelectedSession.IsValid() && (SelectedSession->GetSessionOwner() == FPlatformProcess::UserName(true));

	if( ActiveSession != SelectedSession || FProfilerManager::GetSettings().bSingleInstanceMode )
	{
		ClearStatsAndInstances();

		if (SessionIsValid)
		{
			ActiveSession = SelectedSession;
			ProfilerClient->Subscribe( ActiveSession->GetSessionId() );
			ProfilerType = EProfilerSessionTypes::Live;
			SetViewMode( EProfilerViewMode::LineIndexBased );
		}
		else
		{
			ActiveSession = nullptr;
			ProfilerType = EProfilerSessionTypes::InvalidOrMax;
		}
	}

	if( ActiveSession.IsValid() )
	{
		// Track all selected session instances.
		SessionManager->GetSelectedInstances( SelectedSessionInstances );
		const int32 NumSelectedInstances = SelectedSessionInstances.Num();
		const int32 NumInstances = FMath::Min( NumSelectedInstances, FProfilerManager::GetSettings().bSingleInstanceMode ? 1 : NumSelectedInstances );

		for( int32 Index = 0; Index < NumInstances; ++Index )
		{
			const ISessionInstanceInfoPtr SessionInstanceInfo = SelectedSessionInstances[Index];
			const FGuid ProfilerInstanceID = SessionInstanceInfo->GetInstanceId();
			const bool bAlreadyAdded = ProfilerSessionInstances.Contains( ProfilerInstanceID );

			if( !bAlreadyAdded )
			{
				FProfilerSessionRef ProfilerSession = MakeShareable( new FProfilerSession( SessionInstanceInfo ) );
				ProfilerSession->SetOnAddThreadTime( FProfilerSession::FAddThreadTimeDelegate::CreateSP( this, &FProfilerManager::ProfilerSession_OnAddThreadTime ) );

				ProfilerSessionInstances.Add( ProfilerSession->GetInstanceID(), ProfilerSession );
				ProfilerClient->Track( ProfilerInstanceID );
				TSharedPtr<SProfilerWindow> ProfilerWindow = GetProfilerWindow();
				if (ProfilerWindow.IsValid())
				{
					ProfilerWindow->ManageEventGraphTab(ProfilerInstanceID, true, ProfilerSession->GetName());
				}
			}
		}
	}

	SessionInstancesUpdatedEvent.Broadcast();
}
Пример #11
0
//----------------------------------------------------------------------
void CVehicleMountedWeapon::PostSerialize()
{
	CHeavyMountedWeapon::PostSerialize();
	if (m_vehicleId)
		MountAtEntity(m_vehicleId, Vec3(ZERO), Ang3(ZERO));

	CActor* pActor = GetOwnerActor();
	if((pActor != NULL) && (pActor->IsClient()))
	{
		SetViewMode( eIVM_FirstPerson );
		DrawSlot( eIGS_FirstPerson, true, true );
	}
}
Пример #12
0
//------------------------------------------------------------------------
void CItem::OnEnterThirdPerson()
{
    EnableHiddenSkinning(false);
    AttachToHand(true);
    AttachArms(false, false);
    SetViewMode(eIVM_ThirdPerson);
    /*
    	if(m_stats.mounted)
    	{
    		ICharacterInstance* pChar = GetOwnerActor()?GetOwnerActor()->GetEntity()->GetCharacter(0):NULL;
    		if(pChar)
    			pChar->HideMaster(0);
    	}*/
}
Пример #13
0
bool CWinRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags)
{
  m_fps = fps;
  m_iSourceWidth = width;
  m_iSourceHeight = height;

  // calculate the input frame aspect ratio
  CalculateFrameAspectRatio(d_width, d_height);
  ChooseBestResolution(m_fps);
  SetViewMode(g_stSettings.m_currentVideoSettings.m_ViewMode);

  ManageDisplay();

  return true;
}
Пример #14
0
bool CRendererMediaCodecSurface::Configure(const VideoPicture &picture, float fps, unsigned flags, unsigned int orientation)
{
  CLog::Log(LOGNOTICE, "CRendererMediaCodecSurface::Configure");

  m_sourceWidth = picture.iWidth;
  m_sourceHeight = picture.iHeight;
  m_renderOrientation = orientation;

  // Save the flags.
  m_iFlags = flags;

  // Calculate the input frame aspect ratio.
  CalculateFrameAspectRatio(picture.iDisplayWidth, picture.iDisplayHeight);
  SetViewMode(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_ViewMode);

  return true;
}
Пример #15
0
//=========================================
void CRocketLauncher::PostSerialize()
{
	CWeapon::PostSerialize();

	if(m_auxSlotUsed)
	{
		SetViewMode(0);
		DrawSlot( eIGS_ThirdPersonAux,true);
		ActivateTPLaser(false);
	}
	else
		DrawSlot( eIGS_ThirdPersonAux,false);

	if(m_smokeEffectSlot>-1)
		Pickalize(false,true);

}
Пример #16
0
bool CRendererMediaCodecSurface::Configure(const VideoPicture &picture, float fps, unsigned int orientation)
{
  CLog::Log(LOGNOTICE, "CRendererMediaCodecSurface::Configure");

  m_sourceWidth = picture.iWidth;
  m_sourceHeight = picture.iHeight;
  m_renderOrientation = orientation;

  m_iFlags = GetFlagsChromaPosition(picture.chroma_position) |
             GetFlagsColorMatrix(picture.color_space, picture.iWidth, picture.iHeight) |
             GetFlagsColorPrimaries(picture.color_primaries) |
             GetFlagsStereoMode(picture.stereoMode);

  // Calculate the input frame aspect ratio.
  CalculateFrameAspectRatio(picture.iDisplayWidth, picture.iDisplayHeight);
  SetViewMode(m_videoSettings.m_ViewMode);

  return true;
}
Пример #17
0
void CHeavyMountedWeapon::StopUse(EntityId userId)
{
	UnRegisterAsUser();

	if (m_rippedOff || m_rippingOff)
	{
		CActor *pActor = GetOwnerActor();

		m_rippedOff = true;
		m_rippingOff = false;
		RemoveViewLimits();
		BaseClass::StopUse(userId);

		if(pActor)
		{
			pActor->LockInteractor(GetEntityId(), false);
		}
	}
	else
	{
		CActor *pActor = GetOwnerActor();
		if (!pActor)
		{
			return;
		}

		if (m_isFiring)
		{
			StopFire();
		}
		DoRipOffPrompt(GetOwnerId(), false);
		SetViewMode(eIVM_ThirdPerson);
		DrawSlot(eIGS_ThirdPerson, true);

		if(gEnv->bMultiplayer)
		{
			HighlightWeapon(true);
		}

		//The use of CWeapon::StopUse() here and not BaseClass::StopUse() is deliberate; it avoids the '::Drop()' call that CHeavyWeapon makes
		CWeapon::StopUse(userId);
	}
}
FStaticMeshEditorViewportClient::FStaticMeshEditorViewportClient(TWeakPtr<IStaticMeshEditor> InStaticMeshEditor, TWeakPtr<SStaticMeshEditorViewport> InStaticMeshEditorViewport, FPreviewScene& InPreviewScene, UStaticMesh* InPreviewStaticMesh, UStaticMeshComponent* InPreviewStaticMeshComponent)
	: FEditorViewportClient(GLevelEditorModeTools(), &InPreviewScene)
	, StaticMeshEditorPtr(InStaticMeshEditor)
	, StaticMeshEditorViewportPtr(InStaticMeshEditorViewport)
{
	SimplygonLogo = LoadObject<UTexture2D>(NULL, TEXT("/Engine/EditorResources/SimplygonLogo.SimplygonLogo"), NULL, LOAD_None, NULL);

	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = true;
	DrawHelper.GridColorAxis = FColor(160,160,160);
	DrawHelper.GridColorMajor = FColor(144,144,144);
	DrawHelper.GridColorMinor = FColor(128,128,128);
	DrawHelper.PerspectiveGridSize = GridSize;
	DrawHelper.NumCells = DrawHelper.PerspectiveGridSize / (CellSize * 2);

	SetViewMode(VMI_Lit);

	WidgetMode = FWidget::WM_None;

	EngineShowFlags.DisableAdvancedFeatures();
	EngineShowFlags.SetSnap(0);
	EngineShowFlags.CompositeEditorPrimitives = true;
	OverrideNearClipPlane(1.0f);
	bUsingOrbitCamera = true;

	bShowCollision = true;
	bShowSockets = true;
	bDrawUVs = false;
	bDrawNormals = false;
	bDrawTangents = false;
	bDrawBinormals = false;
	bShowPivot = false;
	bDrawAdditionalData = true;

	bManipulating = false;

	SetPreviewMesh(InPreviewStaticMesh, InPreviewStaticMeshComponent);
}
Пример #19
0
GamePadDialog::GamePadDialog(InputState* state, QWidget *parent) :
	QDialog(parent),
	ui(new Ui::GamePadDialog),
	m_inputState(state),
#if QT_HAS_SDL
	m_joystick(0),
#endif
	m_isInit(false)
{
	ui->setupUi(this);
	SetViewMode();

#if QT_HAS_SDL
	SDL_Init(SDL_INIT_JOYSTICK);
#endif
	m_isInit = true;

	data_timer = new QTimer();
	data_timer->setInterval(50);
	connect(data_timer,SIGNAL(timeout()),this,SLOT(pollJoystick()));
	data_timer->start();

	for(int i=0;i<18;i++)
	{
		QLabel* labelPreview = findChild<QLabel*>(GamepadPadMapping[i].ViewLabelName);
		if(labelPreview)
		{
			labelPreview->setVisible(false);
		}

		if(g_Config.iMappingMap.find(i+configOffset) != g_Config.iMappingMap.end())
		{
			GetMappingFromInt(g_Config.iMappingMap[i+configOffset],
							  GamepadPadMapping[i].mapping_in,
							  GamepadPadMapping[i].mapping_type,
							  GamepadPadMapping[i].mapping_sign);
		}
	}

	on_refreshListBtn_clicked();
}
FAnimationSegmentViewportClient::FAnimationSegmentViewportClient(FPreviewScene& InPreviewScene, const TWeakPtr<SEditorViewport>& InEditorViewportWidget)
	: FEditorViewportClient(nullptr, &InPreviewScene, InEditorViewportWidget)
{
	SetViewMode(VMI_Lit);

	// Always composite editor objects after post processing in the editor
	EngineShowFlags.SetCompositeEditorPrimitives(true);
	EngineShowFlags.DisableAdvancedFeatures();
	
	UpdateLighting();

	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = true;
	DrawHelper.GridColorAxis = FColor(70, 70, 70);
	DrawHelper.GridColorMajor = FColor(40, 40, 40);
	DrawHelper.GridColorMinor =  FColor(20, 20, 20);
	DrawHelper.PerspectiveGridSize = HALF_WORLD_MAX1;
}
FDestructibleMeshEditorViewportClient::FDestructibleMeshEditorViewportClient(TWeakPtr<IDestructibleMeshEditor> InDestructibleMeshEditor, FPreviewScene& InPreviewScene, const TSharedRef<SDestructibleMeshEditorViewport>& InDestructibleMeshEditorViewport)
	: FEditorViewportClient(nullptr, &InPreviewScene, StaticCastSharedRef<SEditorViewport>(InDestructibleMeshEditorViewport))
	, DestructibleMeshEditorPtr(InDestructibleMeshEditor)
{
	SetViewMode(VMI_Lit);

	OverrideNearClipPlane(1.0f);
	bUsingOrbitCamera = true;

	UpdateLighting();

	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = true;
	DrawHelper.GridColorAxis = FColor(70, 70, 70);
	DrawHelper.GridColorMajor = FColor(40, 40, 40);
	DrawHelper.GridColorMinor =  FColor(20, 20, 20);
	DrawHelper.PerspectiveGridSize = HALF_WORLD_MAX1;
}
Пример #22
0
//------------------------------------------------------------------------
void CItem::OnReset()
{
    //Hidden entities must have physics disabled
    if(!GetEntity()->IsHidden())
        GetEntity()->EnablePhysics(true);

    DestroyedGeometry(false);
    m_stats.health = (float)m_properties.hitpoints;

    UpdateDamageLevel();

    if(m_sharedparams->params.scopeAttachment)
        DrawSlot(eIGS_Aux1,false); //Hide secondary FP scope

    if (m_properties.mounted && m_sharedparams->params.mountable)
    {
        MountAt(GetEntity()->GetWorldPos());

        SEntityPhysicalizeParams params;
        params.mass = 0;
        params.nSlot = -1; // todo: -1 doesn't work for characters
        params.type = PE_STATIC;
        GetEntity()->Physicalize(params);
    }
    else
    {
        SetViewMode(eIVM_ThirdPerson);

        if (m_properties.pickable)
        {
            const bool hasOwner = (GetOwnerId() != 0);
            Physicalize(hasOwner ? false : true, m_properties.physics);
            Pickalize(true, false);
        }
        else
            Physicalize(m_properties.physics, true);
    }

    GetEntity()->InvalidateTM();
}
Пример #23
0
bool CRendererDRMPRIME::Configure(const VideoPicture& picture, float fps, unsigned int orientation)
{
  m_format = picture.videoBuffer->GetFormat();
  m_sourceWidth = picture.iWidth;
  m_sourceHeight = picture.iHeight;
  m_renderOrientation = orientation;

  m_iFlags = GetFlagsChromaPosition(picture.chroma_position) |
             GetFlagsColorMatrix(picture.color_space, picture.iWidth, picture.iHeight) |
             GetFlagsColorPrimaries(picture.color_primaries) |
             GetFlagsStereoMode(picture.stereoMode);

  // Calculate the input frame aspect ratio.
  CalculateFrameAspectRatio(picture.iDisplayWidth, picture.iDisplayHeight);
  SetViewMode(m_videoSettings.m_ViewMode);
  ManageRenderArea();

  Reset();

  m_bConfigured = true;
  return true;
}
FNiagaraEffectEditorViewportClient::FNiagaraEffectEditorViewportClient(TWeakPtr<INiagaraEffectEditor> InEffectEditor, FPreviewScene& InPreviewScene, const TSharedRef<SNiagaraEffectEditorViewport>& InNiagaraEditorViewport)
	: FEditorViewportClient(nullptr, &InPreviewScene, StaticCastSharedRef<SEditorViewport>(InNiagaraEditorViewport))
	, EffectEditorPtr(InEffectEditor)
{
	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = false;
	DrawHelper.GridColorAxis = FColor(80,80,80);
	DrawHelper.GridColorMajor = FColor(72,72,72);
	DrawHelper.GridColorMinor = FColor(64,64,64);
	DrawHelper.PerspectiveGridSize = HALF_WORLD_MAX1;
	
	SetViewMode(VMI_Lit);
	
	EngineShowFlags.DisableAdvancedFeatures();
	EngineShowFlags.SetSnap(0);
	
	OverrideNearClipPlane(1.0f);
	bUsingOrbitCamera = true;
}
Пример #25
0
//------------------------------------------------------------------------
void CItem::OnEnterFirstPerson()
{
    //Prevent FP model to show up when activating AI/Physics in editor
    if(gEnv->IsEditor() && gEnv->IsEditing())
        return;

    EnableUpdate(true, eIUS_General);
    EnableHiddenSkinning(true);
    SetViewMode(eIVM_FirstPerson);
    AttachToHand(false);
    AttachArms(true, true);
    RestoreLayers();

    /*
    	if(m_stats.mounted)
    	{
    		ICharacterInstance* pChar = GetOwnerActor()?GetOwnerActor()->GetEntity()->GetCharacter(0):NULL;
    		if(pChar)
    			pChar->HideMaster(1);
    	}*/

}
Пример #26
0
void FileList::SetPluginMode(HANDLE hPlugin,const wchar_t *PluginFile,bool SendOnFocus)
{
	if (PanelMode!=PLUGIN_PANEL)
	{
		CtrlObject->FolderHistory->AddToHistory(strCurDir);
	}

	PushPlugin(hPlugin,PluginFile);
	FileList::hPlugin=hPlugin;
	PanelMode=PLUGIN_PANEL;

	if (SendOnFocus)
		SetFocus();

	OpenPanelInfo Info;
	CtrlObject->Plugins->GetOpenPanelInfo(hPlugin,&Info);

	if (Info.StartPanelMode)
		SetViewMode(VIEW_0+Info.StartPanelMode-L'0');

	CtrlObject->Cp()->RedrawKeyBar();

	if (Info.StartSortMode)
	{
		SortMode=Info.StartSortMode-(SM_UNSORTED-UNSORTED);
		SortOrder=Info.StartSortOrder ? -1:1;
	}

	Panel *AnotherPanel=CtrlObject->Cp()->GetAnotherPanel(this);

	if (AnotherPanel->GetType()!=FILE_PANEL)
	{
		AnotherPanel->Update(UPDATE_KEEP_SELECTION);
		AnotherPanel->Redraw();
	}
}
Пример #27
0
void CJaw::OnReset()
{
	bool attachedToBack = IsAttachedToBack();

	if(!attachedToBack)
		m_auxSlotUsed = false;

	BaseClass::OnReset();

	if(!attachedToBack)
	{
		SetViewMode(eIVM_ThirdPerson);
		DrawSlot(eIGS_ThirdPerson, true);
		DrawSlot(eIGS_ThirdPersonAux, false);
	}
	else
		m_stats.first_selection = false;

	m_forcedTargetId = 0;
	m_firedRockets = 0;
	m_dropped = false;
	m_dropTime = 0.0f;
	m_zoomTriggerDown = false;
	m_fireTriggerDown = false;
	m_firePending = false;
	m_playedDropAction = false;
	m_fired = false;
	m_zoomAlreadyToggled = false;
	Hide(false);

	SetFiringLocator(this);

	m_listeners.Clear();

	m_laserGuider.TurnOffLaser();
}
Пример #28
0
void CAccessory::PickUp(EntityId pickerId, bool sound, bool select/* =true */, bool keepHistory/* =true */, const char *setup /*= NULL*/)
{
    CActor *pActor=GetActor(pickerId);
    if (!pActor)
        return;

    TriggerRespawn();

    GetEntity()->EnablePhysics(false);
    Physicalize(false, false);

    bool soundEnabled = IsSoundEnabled();
    EnableSound(sound);

    SetViewMode(0);
    SetOwnerId(pickerId);

    CopyRenderFlags(GetOwner());

    Hide(true);
    m_stats.dropped = false;
    m_stats.detached = false;
    m_stats.brandnew = false;


    IInventory *pInventory = pActor->GetInventory();
    if (!pInventory)
        {
            GameWarning("Actor '%s' has no inventory, when trying to pickup '%s'!",pActor->GetEntity()->GetName(),GetEntity()->GetName());
            return;
        }

    if (!pActor->IsPlayer() || pActor->IsClient() || gEnv->bMultiplayer)
        {
            bool hasAccessory = pInventory->HasAccessory(GetEntity()->GetClass());
            bool hasAccessoryForThisWeapon = pInventory->HasAccessory(GetEntity()->GetClass());

            if (!hasAccessoryForThisWeapon)
                pInventory->AddAccessory(GetEntity()->GetClass());
            if (!hasAccessory)
                ProcessAccessoryAmmoCapacities(pInventory, true);
            if (!hasAccessoryForThisWeapon)
                ProcessAccessoryAmmo(pInventory);
        }

    OnPickedUp(pickerId, m_sharedparams->params.unique);

    if (select)
        {
            PlayAction(GetFragmentIds().pickedup);
        }

    EnableSound(soundEnabled);

    bool isLocalEntity = GetEntity()->GetFlags()&(ENTITY_FLAG_CLIENT_ONLY|ENTITY_FLAG_SERVER_ONLY) ? true : false;

    if (IsServer() && !IsDemoPlayback())
        {
            if(!gEnv->bMultiplayer || isLocalEntity)
                RemoveEntity();
            else if(g_pGame->GetGameRules())
                g_pGame->GetGameRules()->ScheduleEntityRemoval(GetEntityId(),10.0f,false); //Give some time to the clients to pick the msg
        }

    if (IsServer())
        {
            GetGameObject()->SetNetworkParent(pickerId);
            if (!isLocalEntity)
                {
                    pActor->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClPickUp(), CActor::PickItemParams(GetEntityId(), m_stats.selected, sound), eRMI_ToAllClients|eRMI_NoLocalCalls, GetEntityId());
                }
        }
}
Пример #29
0
void CAccessory::PickUp(EntityId pickerId, bool sound, bool select, bool keepHistory, const char *setup)
{
	CActor *pActor=GetActor(pickerId);
	if (!pActor)
		return;

	if(!CheckAmmoRestrictions(pickerId))
	{
		if (IsServer())
			g_pGame->GetGameRules()->SendTextMessage(eTextMessageCenter, "@ammo_maxed_out", eRMI_ToClientChannel, pActor->GetChannelId(), (string("@")+GetEntity()->GetClass()->GetName()).c_str());
		return;
	}

	TriggerRespawn();

	GetEntity()->EnablePhysics(false);
	Physicalize(false, false);

	bool soundEnabled = IsSoundEnabled();
	EnableSound(sound);

	SetViewMode(0);		
	SetOwnerId(pickerId);

	CopyRenderFlags(GetOwner());

	Hide(true);
	m_stats.dropped = false;
	m_stats.brandnew = false;


	IInventory *pInventory = pActor->GetInventory();
	if (!pInventory)
	{
		GameWarning("Actor '%s' has no inventory, when trying to pickup '%s'!",pActor->GetEntity()->GetName(),GetEntity()->GetName());
		return;
	}

	if(!pInventory->HasAccessory(GetEntity()->GetClass()))
	{
		pInventory->AddAccessory(GetEntity()->GetClass());
	}

	OnPickedUp(pickerId, m_sharedparams->params.unique);	

	PlayAction(g_pItemStrings->pickedup);

	EnableSound(soundEnabled);

	if (IsServer() && !IsDemoPlayback())
	{
		if(!gEnv->bMultiplayer)
			RemoveEntity();
		else if(g_pGame->GetGameRules())
			g_pGame->GetGameRules()->ScheduleEntityRemoval(GetEntityId(),10.0f,false); //Give some time to the clients to pick the msg
	}

	if (IsServer())
	{
		GetGameObject()->SetNetworkParent(pickerId);
		if ((GetEntity()->GetFlags()&(ENTITY_FLAG_CLIENT_ONLY|ENTITY_FLAG_SERVER_ONLY)) == 0)
		{
			pActor->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClPickUp(), CActor::PickItemParams(GetEntityId(), m_stats.selected, sound), eRMI_ToAllClients|eRMI_NoLocalCalls, GetEntityId());

			const char *displayName=GetDisplayName();
}
	}
}
Пример #30
0
int FileList::PopPlugin(int EnableRestoreViewMode)
{
	OpenPanelInfo Info={};

	if (PluginsList.Empty())
	{
		PanelMode=NORMAL_PANEL;
		return FALSE;
	}

	// указатель на плагин, с которого уходим
	PluginsListItem *PStack=*PluginsList.Last();

	// закрываем текущий плагин.
	PluginsList.Delete(PluginsList.Last());

	--PluginPanelsCount;

	CtrlObject->Plugins->ClosePanel(hPlugin);

	if (!PluginsList.Empty())
	{
		hPlugin=(*PluginsList.Last())->hPlugin;
		strOriginalCurDir=PStack->strPrevOriginalCurDir;

		if (EnableRestoreViewMode)
		{
			SetViewMode(PStack->PrevViewMode);
			SortMode=PStack->PrevSortMode;
			NumericSort=PStack->PrevNumericSort;
			CaseSensitiveSort=PStack->PrevCaseSensitiveSort;
			SortOrder=PStack->PrevSortOrder;
			DirectoriesFirst=PStack->PrevDirectoriesFirst;
		}

		if (PStack->Modified)
		{
			PluginPanelItem PanelItem={};
			string strSaveDir;
			apiGetCurrentDirectory(strSaveDir);

			if (FileNameToPluginItem(PStack->strHostFile,&PanelItem))
			{
				CtrlObject->Plugins->PutFiles(hPlugin,&PanelItem,1,FALSE,0);
			}
			else
			{
				PanelItem.FileName = xf_wcsdup(PointToName(PStack->strHostFile));
				CtrlObject->Plugins->DeleteFiles(hPlugin,&PanelItem,1,0);
				xf_free(PanelItem.FileName);
			}

			FarChDir(strSaveDir);
		}


		CtrlObject->Plugins->GetOpenPanelInfo(hPlugin,&Info);

		if (!(Info.Flags & OPIF_REALNAMES))
		{
			DeleteFileWithFolder(PStack->strHostFile);  // удаление файла от предыдущего плагина
		}
	}
	else
	{
		PanelMode=NORMAL_PANEL;
		hPlugin = nullptr;

		if (EnableRestoreViewMode)
		{
			SetViewMode(PStack->PrevViewMode);
			SortMode=PStack->PrevSortMode;
			NumericSort=PStack->PrevNumericSort;
			CaseSensitiveSort=PStack->PrevCaseSensitiveSort;
			SortOrder=PStack->PrevSortOrder;
			DirectoriesFirst=PStack->PrevDirectoriesFirst;
		}
	}

	delete PStack;

	if (EnableRestoreViewMode)
		CtrlObject->Cp()->RedrawKeyBar();

	return TRUE;
}