//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CHudMoneyClassic::OnThink(void) { C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); if (pPlayer) { m_iMoney = pPlayer->GetMoney(); SetDisplayValue(m_iMoney); } if (g_fr_classic.GetBool()) { if (g_fr_economy.GetBool()) { SetAlpha(255); } else { SetAlpha(0); } } else { SetAlpha(0); } }
//----------------------------------------------------------------------------- //! change alpha for each pixmap as they become enabled/ disabled. //----------------------------------------------------------------------------- void tThrusterPopup::UpdatePixmaps() { float percent = ( (float)m_Step / 100.0F ); float minAlpha = tSystemSettings::Instance()->NightMode() ? 40.0F : 100.0F; int alphaOn = static_cast<int> ( minAlpha + ( percent * (255.0F - minAlpha ) ) ); percent = (100.0F - float(m_Step)) / 100.0F; int alphaOff = static_cast<int> ( minAlpha + ( percent * (255.0F - minAlpha ) ) ); QPixmap pixmapOn = ( tSystemSettings::Instance()->NightMode() ? tPath::ResourceFile( "medusa/icons/thruster_night.png" ) : tPath::ResourceFile( "medusa/icons/thruster_day.png" ) ); QPixmap pixmapOff = ( tSystemSettings::Instance()->NightMode() ? tPath::ResourceFile( "medusa/icons/thruster_night_off.png" ) : tPath::ResourceFile( "medusa/icons/thruster_day_off.png" ) ); SetAlpha( pixmapOn, alphaOn ); SetAlpha( pixmapOff, alphaOff ); m_pThrusterOn->setPixmap( pixmapOn ); m_pThrusterOff->setPixmap( pixmapOff ); update(); }
// If we've just taken damage, deal with the invincibility animation void Player::HandleInvincibility(const jutil::GameTime& timespan) { m_TimerInvincibility += timespan; // Flash the player sprite if (m_TimerInvincibility.ElapsedMilliseconds() % 4 == 0) SetAlpha(1.f); else SetAlpha(0.f); // If just been hit, apply a force to the player if (m_TimerInvincibility.ElapsedMilliseconds() < INVINCIBILITY_TIME*0.2f) { jmath::vec3 f; GetRigidBody()->ClearVelocity(); if (m_TimerInvincibility.ElapsedMilliseconds() < 70) f.y = -0.6; if (m_TimerInvincibility.ElapsedMilliseconds() < 70) f.x = -0.3; if (m_Direction == Mega::Direction::LEFT) f.x = -f.x; GetRigidBody()->ApplyForce(f); m_PlayerState = TAKING_DAMAGE; } else m_PlayerState = UNKNOWN; }
void CGUIResizeControl::Render() { if (HasFocus()) { DWORD dwAlphaCounter = m_dwFrameCounter + 2; DWORD dwAlphaChannel; if ((dwAlphaCounter % 128) >= 64) dwAlphaChannel = dwAlphaCounter % 64; else dwAlphaChannel = 63 - (dwAlphaCounter % 64); dwAlphaChannel += 192; SetAlpha( (unsigned char)dwAlphaChannel ); m_imgFocus.SetVisible(true); m_imgNoFocus.SetVisible(false); m_dwFrameCounter++; } else { SetAlpha(0xff); m_imgFocus.SetVisible(false); m_imgNoFocus.SetVisible(true); } // render both so the visibility settings cause the frame counter to resetcorrectly m_imgFocus.Render(); m_imgNoFocus.Render(); CGUIControl::Render(); }
STDMETHODIMP CGfxSAMSUNG::Update() { if(m_bShow) SetAlpha(MAX_ALPHA_VAL); else SetAlpha(MIN_ALPHA_VAL); return S_OK; }
void GuiInfomsg::Update(GuiTrigger * t) { if(GetAlpha() == 0){ return; } if(difftime(time(NULL), timer) >= 2.0f){ SetAlpha(GetAlpha()-10); if(GetAlpha() < 0){ SetAlpha(0); } } }
void CAsteroid::Respawn() { int stochast = rand()%100; int sum = 0; bool isRepossed = false; CODEManager* ode = CODEManager::Instance(); for(unsigned int i = 0; i < ode->m_pUniverse->m_vRespawnAreas.size(); i++) { if(isRepossed) continue; sum += ode->m_pUniverse->m_vRespawnAreas[i].chance; if(stochast < sum) { ReposAtArea(ode->m_pUniverse->m_vRespawnAreas[i]); isRepossed = true; } } if(!isRepossed) ReposAtOrbit(); Vector n; m_oPhysicsData.m_pOwner->SetLinVelocity(n); m_oPhysicsData.m_pOwner->SetAngVelocity(n); SetForce(n); m_fThrowTime = 0; m_fTemperatureTime = 0.0f; m_iMilliSecsInOrbit = 0; m_iWallBounces = 0; m_pHoldingPlayer = NULL; m_pThrowingPlayer = NULL; SetDepth(-1.0); SetAlpha(1.0); }
void PauseMenu::DoGameOver() { state = GAME_OVER; auto global = Global::GetInstance(); black = Ptr<Sprite>::New(); black->SetTexture(global->texBlack); black->SetPosition(Vector3f(192, 224, 10)); black->SetAlpha(0); black->AddTween(Ptr<FadeTo>::New(0.75f, FADE_TIME, Tweener::EASE_OUT).Get()); AddChild(black.Get()); title = Ptr<PauseMenuItem>::New(PauseMenuItem::GAME_OVER); title->SetPosition(Vector3f(-140, 440, 5)); title->SetAlpha(0); title->AddTween(Ptr<MoveBy>::New(Vector3f(140, -235, 0), FADE_TIME, Tweener::EASE_OUT).Get()); title->AddTween(Ptr<FadeTo>::New(1.0f, FADE_TIME, Tweener::EASE_OUT).Get()); AddChild(title.Get()); AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::CONTINUE).Get()); AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::RETURN_TO_TITLE).Get()); AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::SAVE_REPLAY).Get()); AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::RETRY).Get()); for (int i = 0; i < GetItemCount(); i++) { auto menuItem = GetMenuItem(i); menuItem->SetPosition(Vector3f(-140, 440, 5)); menuItem->SetAlpha(0); menuItem->AddTween(Ptr<MoveBy>::New(Vector3f(150, -285 - 32 * i, 0), FADE_TIME, Tweener::EASE_OUT).Get()); menuItem->AddTween(Ptr<FadeTo>::New(1.0f, FADE_TIME, Tweener::EASE_OUT).Get()); } EventSystem::GetInstance()->RegisterKeyDownListener(this); }
void SetProfileProfileAlphabet(MSA &msa1, MSA &msa2) { ALPHA Alpha = ALPHA_Undefined; switch (g_SeqType.get()) { case SEQTYPE_Auto: Alpha = msa1.GuessAlpha(); break; case SEQTYPE_Protein: Alpha = ALPHA_Amino; break; case SEQTYPE_DNA: Alpha = ALPHA_DNA; break; case SEQTYPE_RNA: Alpha = ALPHA_RNA; break; default: Quit("Invalid SeqType"); } SetAlpha(Alpha); msa1.FixAlpha(); msa2.FixAlpha(); if (ALPHA_DNA == Alpha || ALPHA_RNA == Alpha) SetPPScore(PPSCORE_SPN); }
void CHUDMessage::Update() { // Sanity checks... if (!IsVisible()) return; if (m_fScale != g_pInterfaceResMgr->GetXRatio()) SetScale(g_pInterfaceResMgr->GetXRatio()); if (m_fInitTime < 0.0f) m_fInitTime = g_pLTClient->GetTime(); if (m_fDuration > 0.0f) { float fTime = GetLifetime(); if (fTime > m_fDuration) { fTime -= m_fDuration; float fAlpha = 1.0f - (fTime / m_fFadeDur); if (fAlpha <= 0.0f) { Show(LTFALSE); return; } else SetAlpha(fAlpha); } } else Show(LTFALSE); }
void Player::Update(const jutil::GameTime& timespan) { if (m_Health <= 0) { HandleDeath(timespan); return; } if (m_TimerInvincibility.ElapsedMilliseconds() < INVINCIBILITY_TIME) { HandleInvincibility(timespan); } else { SetAlpha(1.f); m_PlayerState = UNKNOWN; } HandleLevelCollisionResolution(timespan); // Jumping controls if (m_PlayerState != TAKING_DAMAGE) { HandleControls(timespan); } HandleBullets(timespan); SetAnimationFrame(); }
void PixelShaderManager::Dirty() { s_bFogRangeAdjustChanged = true; s_bViewPortChanged = true; nLightsChanged[0] = 0; nLightsChanged[1] = 0x80; SetColorChanged(0, 0); SetColorChanged(0, 1); SetColorChanged(0, 2); SetColorChanged(0, 3); SetColorChanged(1, 0); SetColorChanged(1, 1); SetColorChanged(1, 2); SetColorChanged(1, 3); SetAlpha(); SetDestAlpha(); SetZTextureBias(); SetViewportChanged(); SetIndTexScaleChanged(false); SetIndTexScaleChanged(true); SetIndMatrixChanged(0); SetIndMatrixChanged(1); SetIndMatrixChanged(2); SetZTextureTypeChanged(); SetTexCoordChanged(0); SetTexCoordChanged(1); SetTexCoordChanged(2); SetTexCoordChanged(3); SetTexCoordChanged(4); SetTexCoordChanged(5); SetTexCoordChanged(6); SetTexCoordChanged(7); SetFogColorChanged(); SetFogParamChanged(); }
void CNB_Vote_Panel::UpdateVisibility() { if ( m_VotePanelStatus == VPS_NONE ) { SetVisible( false ); return; } if ( !IsVisible() ) { const float flTransitionTime = 0.3f; int target_x = ( ScreenWidth() * 0.5f ) + YRES( 100 ); int y = YRES( 320 ); if ( m_VotePanelType == VPT_INGAME ) { target_x = ScreenWidth() - YRES( 180 ); y = YRES( 260 ); } SetPos( target_x + YRES( 100 ), y ); vgui::GetAnimationController()->RunAnimationCommand( this, "xpos", target_x, 0, flTransitionTime, vgui::AnimationController::INTERPOLATOR_DEACCEL ); SetAlpha( 1 ); vgui::GetAnimationController()->RunAnimationCommand( this, "Alpha", 255, 0, flTransitionTime, vgui::AnimationController::INTERPOLATOR_LINEAR ); } SetVisible( true ); }
CampaignFrame::CampaignFrame(Panel *parent, const char *panelName, bool showTaskbarIcon) : vgui::Frame(parent, panelName, showTaskbarIcon) { vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SwarmSchemeNew.res", "SwarmSchemeNew"); SetScheme(scheme); SetSize( ScreenWidth() + 1, ScreenHeight() + 1 ); SetTitle("Campaign", true ); SetPos(0,0); SetMoveable(false); SetSizeable(false); SetMenuButtonVisible(false); SetMaximizeButtonVisible(false); SetMinimizeToSysTrayButtonVisible(false); SetCloseButtonVisible(false); SetTitleBarVisible(false); SetAlpha(0.3f); SetPaintBackgroundEnabled(false); m_pCampaignPanel = new CampaignPanel( this, "CampaignPanel" ); RequestFocus(); SetVisible(true); SetEnabled(true); SetKeyBoardInputEnabled(false); if (GetClientModeASW() && GetClientModeASW()->m_bSpectator) { engine->ServerCmd("cl_spectating"); } }
int TBackgroundVuMeter::SetParameterValue(int nInd, std::string csNew) { int nErr = 0; int nNb; nNb = TBackground::GetParameterCount(); if(nInd >= nNb) { nInd -= nNb; switch(nInd) { case 0 : SetBinSize(atoi(csNew.c_str())); break; case 1 : SetAlpha(atof(csNew.c_str())); break; case 2 : SetThreshold(atof(csNew.c_str())); break; default : nErr = 1; } } else nErr = TBackground::SetParameterValue(nInd, csNew); return nErr; }
BOOL CGumpEntity::FromString( XML::Node* node ) { if (!CDiagramEntity::FromString(node)) return FALSE; std::string onclick, onclose, onmouseup, onmousedown, onkeypressed; int alpha=0,flags=0; node->lookupAttribute("alpha", alpha); node->lookupAttribute("flags", flags); XML::Node* event_node = node->findNode("event"); if (event_node) { event_node->lookupAttribute("onclick", onclick); event_node->lookupAttribute("onclose", onclose); event_node->lookupAttribute("onmouseup", onmouseup); event_node->lookupAttribute("onmousedown", onmousedown); event_node->lookupAttribute("onkeypressed", onkeypressed); } SetAlpha(alpha); SetFlags(flags); SetEventHandler(onclick.c_str(), onclose.c_str(), onmouseup.c_str(), onmousedown.c_str(), onkeypressed.c_str()); return TRUE; }
void CBaseHudChat::FadeChatHistory( void ) { float frac = ( m_flHistoryFadeTime - gpGlobals->curtime ) / CHAT_HISTORY_FADE_TIME; int alpha = frac * CHAT_HISTORY_ALPHA; alpha = clamp( alpha, 0, CHAT_HISTORY_ALPHA ); if ( alpha >= 0 ) { if ( GetChatHistory() ) { if ( IsMouseInputEnabled() ) { SetAlpha( 255 ); GetChatHistory()->SetBgColor( Color( 0, 0, 0, CHAT_HISTORY_ALPHA - alpha ) ); m_pChatInput->GetPrompt()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha ); m_pChatInput->GetInputPanel()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha ); SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), CHAT_HISTORY_ALPHA - alpha ) ); m_pFiltersButton->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha ); } else { GetChatHistory()->SetBgColor( Color( 0, 0, 0, alpha ) ); SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), alpha ) ); m_pChatInput->GetPrompt()->SetAlpha( alpha ); m_pChatInput->GetInputPanel()->SetAlpha( alpha ); m_pFiltersButton->SetAlpha( alpha ); } } } }
// ----------------------------------------------------------------------- // // // ROUTINE: CLTDialogueWnd::Init // // PURPOSE: Initialization // // ----------------------------------------------------------------------- // BOOL CLTDialogueWnd::Init(DIALOGUEWNDCREATESTRUCT* pcs) { // Sanity checks if(!pcs || m_bInitialized) return FALSE; // Gotta have a font if(!pcs->pFont) return FALSE; // Initialize the base class if(!CLTMaskedWnd::Init(pcs)) return FALSE; // Simple vars -- Ya gotta specify a width/height since this is scaleable, bunghole. :) m_nWidth = pcs->nWidth; m_nHeight = pcs->nHeight; m_pFont = pcs->pFont; m_bFrame = pcs->bFrame; // Init the frame if necessary if(!InitFrame(pcs->szFrame)) { Term(); return FALSE; } SetAlpha(pcs->fAlpha); // Decision window DECISIONWNDCREATESTRUCT dwcs; dwcs.nControlID = pcs->nControlID; dwcs.pParentWnd = pcs->pParentWnd; dwcs.szBitmap = pcs->szDecisionBitmap; dwcs.hSurf = pcs->hDecisionSurf; dwcs.pcollFrames = &m_collFrames; dwcs.prcFrame = &m_rcFrame; dwcs.prcTotal = &m_rcTotal; dwcs.pFont = g_pInterfaceResMgr->GetMediumFont(); dwcs.bFrame = pcs->bDecisionFrame; dwcs.fAlpha = pcs->fDecisionAlpha; dwcs.dwFlags = LTWF_SIZEABLE; dwcs.dwState = LTWS_CLOSED; if(!m_DecisionWnd.Init(&dwcs)) { Term(); return FALSE; } Reset(); // Center us MoveWindow((g_pGameClientShell->GetScreenWidth()-m_nWidth)/2,m_yPos); // All done! return TRUE; }
ColorRGBA::ColorRGBA(float red, float green, float blue, float alpha) { SetRed(red); SetGreen(green); SetBlue(blue); SetAlpha(alpha); }
CSpeedLine::CSpeedLine(const floatColor& color, float fThickness, float fAlpha) : CPolyLine(color, fThickness, DO_SPEEDLINE) { SetStyle(SL_TRANSPARENCY_DECREASE | SL_THICKNESS_CONST); SetAlpha(fAlpha, fAlpha/100); SetThicknessMin(fThickness/100); }
void CHudChatHistory::ApplySchemeSettings( vgui::IScheme *pScheme ) { BaseClass::ApplySchemeSettings( pScheme ); SetFont( pScheme->GetFont( "ChatFont" ) ); SetAlpha( 255 ); }
int Window_( lua_State* L ) { UIWindow* window = new UIWindow; SetName(L, window); SetTopLeftWidthHeight(L, window); SetTooltip(L, window); SetAnim(L, window, UIPanel::NORMAL_ANIM_, "normalAnim"); SetAnim(L, window, UIPanel::DISABLED_ANIM_, "disabledAnim"); SetTextUserData(L, window); AddWidget(L, window); // 配置关闭按钮 if (util::HasField(L, "closeBtn")) { lua_pushstring(L, "closeBtn"); lua_gettable(L, -2); if (lua_istable(L, -1)) SetButton(L, window->GetCloseButton()); lua_pop(L, 1); } SetAlpha(L, window); lua_pushlightuserdata(L, window); return 1; }
// Unarchive status_t TrackProperties::Unarchive(const BMessage* from) { if (from == NULL) return B_BAD_VALUE; // restore track, error is not acceptable uint32 track; if (from->FindUInt32("track", &track) < B_OK) return B_ERROR; SetTrack(track); // restore enabled bool enabled; if (from->FindBool("enabled", &enabled) != B_OK) enabled = true; SetEnabled(enabled); // restore name const char* name; if (from->FindString("name", &name) != B_OK) name = ""; SetName(name); // restore alpha uint8 alpha; if (from->FindUInt8("alpha", &alpha) != B_OK) alpha = 255; SetAlpha(alpha); return B_OK; }
void PixelShaderManager::Dirty() { s_bFogRangeAdjustChanged = true; s_bViewPortChanged = true; for (unsigned index = 0; index < s_tev_color.size(); ++index) { for (int comp = 0; comp < 4; ++comp) { SetTevColor(index, comp, s_tev_color[index][comp]); SetTevKonstColor(index, comp, s_tev_konst_color[index][comp]); } } SetAlpha(); SetDestAlpha(); SetZTextureBias(); SetViewportChanged(); SetIndTexScaleChanged(false); SetIndTexScaleChanged(true); SetIndMatrixChanged(0); SetIndMatrixChanged(1); SetIndMatrixChanged(2); SetZTextureTypeChanged(); SetTexCoordChanged(0); SetTexCoordChanged(1); SetTexCoordChanged(2); SetTexCoordChanged(3); SetTexCoordChanged(4); SetTexCoordChanged(5); SetTexCoordChanged(6); SetTexCoordChanged(7); SetFogColorChanged(); SetFogParamChanged(); }
void CASW_VGUI_Computer_Container::OnThink() { BaseClass::OnThink(); float fDeathCamInterp = ASWGameRules()->GetMarineDeathCamInterp(); if ( fDeathCamInterp > 0.0f && GetAlpha() >= 255 ) { SetAlpha( 254 ); vgui::GetAnimationController()->RunAnimationCommand(this, "Alpha", 0, 0, 0.5f, vgui::AnimationController::INTERPOLATOR_LINEAR); } else if ( fDeathCamInterp <= 0.0f && GetAlpha() <= 0 ) { SetAlpha( 1 ); vgui::GetAnimationController()->RunAnimationCommand(this, "Alpha", 255, 0, 0.5f, vgui::AnimationController::INTERPOLATOR_LINEAR); } }
void ActiveWindow::Draw() { int w = rect.w; int h = rect.h; if (w < 1 || h < 1 || !shown) return; float old_alpha = alpha; if (!enabled) SetAlpha(0.5); if (!transparent) { if (texture && texture->Width()) { DrawTextureGrid(); } else { FillRect(0, 0, w, h, ShadeColor(back_color, 1.0)); } } if (enabled && view_list.size()) { ListIter<View> v = view_list; while (++v) v->Refresh(); } if (!transparent) { DrawStyleRect(0, 0, w, h, style); } // draw text here: DrawTabbedText(); if (!enabled) SetAlpha(old_alpha); // update children windows: ListIter<ActiveWindow> iter = children; while (++iter) { ActiveWindow* child = iter.value(); child->Draw(); } }
void SEGZONE::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, const wxPoint& aOffset ) { DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions(); if( displ_opts->m_DisplayZonesMode != 0 ) return; BOARD * brd = GetBoard( ); EDA_COLOR_T color = brd->GetLayerColor(m_Layer); if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) ) return; #ifdef USE_WX_OVERLAY // If dragged not draw in OnPaint otherwise remains impressed in wxOverlay if( (m_Flags & IS_DRAGGED) && aDC->IsKindOf(wxCLASSINFO(wxPaintDC))) return; #endif if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts->m_ContrastModeDisplay ) { LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; if( !IsOnLayer( curr_layer ) ) ColorTurnToDarkDarkGray( &color ); } if( aDrawMode & GR_HIGHLIGHT ) ColorChangeHighlightFlag( &color, !(aDrawMode & GR_AND) ); ColorApplyHighlightFlag( &color ); SetAlpha( &color, 150 ); GRSetDrawMode( aDC, aDrawMode ); int l_trace = m_Width / 2; if( aDC->LogicalToDeviceXRel( l_trace ) <= MIN_DRAW_WIDTH ) { GRLine( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, 0, color ); return; } if( !displ_opts->m_DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) { GRCSegm( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, m_Width, color ); } else { GRFillCSegm( panel->GetClipBox(), aDC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color ); } // No clearance or netnames for zones }
void CASW_VGUI_Door_Tooltip::ApplySchemeSettings(vgui::IScheme *pScheme) { BaseClass::ApplySchemeSettings(pScheme); SetPaintBackgroundType(0); SetPaintBackgroundEnabled(true); SetBgColor( Color(16,16,16,192) ); if ( GetDoor() ) { SetAlpha(200); } else { SetAlpha(0); } SetMouseInputEnabled(false); }
CRenderingContext::CRenderingContext(CRenderer* pRenderer, bool bInherit) { m_pRenderer = pRenderer; m_clrRender = ::Color(255, 255, 255, 255); s_aContexts.push_back(); if (bInherit && s_aContexts.size() > 1) { CRenderContext& oLastContext = s_aContexts[s_aContexts.size()-2]; CRenderContext& oThisContext = GetContext(); oThisContext.m_mProjection = oLastContext.m_mProjection; oThisContext.m_mView = oLastContext.m_mView; oThisContext.m_mTransformations = oLastContext.m_mTransformations; oThisContext.m_hMaterial = oLastContext.m_hMaterial; oThisContext.m_pFrameBuffer = oLastContext.m_pFrameBuffer; tstrncpy(oThisContext.m_szProgram, PROGRAM_LEN, oLastContext.m_szProgram, PROGRAM_LEN); oThisContext.m_pShader = oLastContext.m_pShader; oThisContext.m_rViewport = oLastContext.m_rViewport; oThisContext.m_eBlend = oLastContext.m_eBlend; oThisContext.m_flAlpha = oLastContext.m_flAlpha; oThisContext.m_bDepthMask = oLastContext.m_bDepthMask; oThisContext.m_bDepthTest = oLastContext.m_bDepthTest; oThisContext.m_eDepthFunction = oLastContext.m_eDepthFunction; oThisContext.m_bCull = oLastContext.m_bCull; oThisContext.m_bWinding = oLastContext.m_bWinding; m_pShader = oThisContext.m_pShader; if (m_pShader) m_iProgram = m_pShader->m_iProgram; else m_iProgram = 0; } else { m_pShader = NULL; BindTexture(0); UseMaterial(CMaterialHandle()); UseFrameBuffer(NULL); UseProgram(""); SetViewport(Rect(0, 0, Application()->GetWindowWidth(), Application()->GetWindowHeight())); SetBlend(BLEND_NONE); SetAlpha(1); SetDepthMask(true); SetDepthTest(true); SetDepthFunction(DF_LESS); SetBackCulling(true); SetWinding(true); } }
void CHUDMessage::Render(LTBOOL bForceVisible) { LTBOOL bVis = m_bVisible; float fAlpha = m_fAlpha; if (bForceVisible) { m_bVisible = LTTRUE; SetAlpha(1.0f); } Render(); if (bForceVisible) { m_bVisible = bVis; SetAlpha(fAlpha); } }