void tSpecialModes::keyPressEvent( QKeyEvent* ke ) { if ( m_IgnoreKeys ) { ke->ignore(); return; } int key = ke->key(); if ( key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_SpecialModes_Decrease ) || key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_Generic_Increase ) ) { DecrButton(); } else if ( key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_SpecialModes_Increase ) || key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_Generic_Decrease ) ) { IncrButton(); } else if ( key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_SpecialModes_Apply ) || key == tKeyMapping::PhysicalKeyOf( tKeyMapping::eKM_Generic_Tab ) ) { ApplyMode(); } else { ke->ignore(); } }
//---------------------------------------------------------------------------// // Draw // //---------------------------------------------------------------------------// void CFilterScanner::Draw(CDisplayDevice *pDD, TRenderTgt *pRenderTgt, float fAlphaGlobal) { D3DDEVICE *pD3D = pDD->GetD3DDevice(); int iTex = CEffects::GetTexture(CEffects::TEX_TARGET); pDD->SetRenderTarget(iTex); // Render el fondo y la capa de scanner pDD->ApplyBasicShader(); g_pGestorMateriales->SetTextura(pRenderTgt->iTexture, 0); DrawQuad(pDD); TVector2 v0, v1; TVector2 uv0, uv1; CalcScannerRect(TVector2(100,100), TVector2(420,340), 0.7f, &v0, &v1); uv0 = TVector2(100.f/pDD->Width(), 100.f/pDD->Height()); uv1 = TVector2(420.f/pDD->Width(), 340.f/pDD->Height()); DrawQuadUV(pDD, v0, v1, uv0, uv1); // Dibujar con el filtro y el modo seleccionados pDD->SetRenderTarget(-1); pDD->ApplyBasicShader(); g_pGestorMateriales->SetTextura(iTex, 0); ApplyMode(pDD, pRenderTgt, fAlphaGlobal); pD3D->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); pD3D->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR); pDD->SetBilinearFiltering(0, true); DrawQuad(pDD); }
void SetMode(CoreMode new_mode) { if (new_mode == s_mode) return; // We don't need to do anything. s_mode = new_mode; // If we're using an external CPU core implementation then don't do anything. if (s_cpu_core_base_is_injected) return; ApplyMode(); }
void InjectExternalCPUCore(CPUCoreBase* new_cpu) { // Previously injected. if (s_cpu_core_base_is_injected) s_cpu_core_base->Shutdown(); // nullptr means just remove if (!new_cpu) { if (s_cpu_core_base_is_injected) { s_cpu_core_base_is_injected = false; ApplyMode(); } return; } new_cpu->Init(); s_cpu_core_base = new_cpu; s_cpu_core_base_is_injected = true; }