void CExpensiveGiftCtrl::InsertGif(LPCTSTR szFilename,INT nNum) { CString sTmp; CPictureExEx* pPicture=(CPictureExEx *)m_pSkinConfContext->GetPictureExEx(szFilename); if(pPicture==NULL) { m_bPicIsOK=FALSE; return; } else m_bPicIsOK=TRUE; m_cx=pPicture->m_PictureSize.cx; m_cy=pPicture->m_PictureSize.cy; if (m_cy>61) m_cy = 58; m_pPicture=pPicture; m_nThreadCurrent=0; Clear(); HDC hWinDC =::GetDC(NULL); //////////////创建一个GIF的设备///////////////////// m_hMenDC=CreateCompatibleDC(hWinDC); m_hMemBM=CreateCompatibleBitmap(hWinDC,m_pPicture->m_PictureSize.cx,m_pPicture->m_PictureSize.cy); SelectObject(m_hMenDC,m_hMemBM); HBRUSH hBrush = CreateSolidBrush(RGB(232,243,255)); RECT rect = {0,0,m_pPicture->m_PictureSize.cx,m_pPicture->m_PictureSize.cy}; FillRect(m_hMenDC,&rect,hBrush); Animate(); ::ReleaseDC(NULL,hWinDC); ::DeleteObject(hBrush); SetTimer(1,70,NULL); }
void CXTPPopupControl::OnLButtonDown(UINT nFlags, CPoint point) { if ((GetPopupState() == xtpPopupStateExpanding) && !m_bSplashScreenMode) { m_nStep = 0; Animate(0); //kill timer event KillTimer(TID_EXPANDING); OnShow(); } //test point to pressed controll CXTPPopupItem* pPressed = HitTest(point); if (m_bAllowMove && (!pPressed || (!pPressed->GetID() && !pPressed->IsButton() && (pPressed->GetCaption().IsEmpty() || !pPressed->IsHyperLink())))) { TrackMove(); return; } //if success test if (pPressed) { m_pPressed = pPressed; //set capture SetCapture(); //redraw all valide controls RedrawControl(); } CWnd::OnLButtonDown(nFlags, point); }
void HangingLetterSign::LateUpdate() { if(mActive) Animate(); }
EXPORT_C TKeyResponse CEikButtonBase::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) { const TInt code=aKeyEvent.iCode; if (code==EKeyDownArrow || code ==EKeyUpArrow) return(EKeyWasNotConsumed); if (aType!=EEventKey) return(EKeyWasConsumed); CEikButtonBase::TState oldState=State(); switch (code) { case EKeyLeftArrow: case EKeyTab: case EKeyRightArrow: Animate(); default: ; } TKeyResponse ret=EKeyWasNotConsumed; if (State()!=oldState) { ReportEventL(MCoeControlObserver::EEventStateChanged); ret=EKeyWasConsumed; } return ret; }
void onIdle () /* pre: glut window is not doing anything else post: scene is updated and re-rendered if necessary */ { static int oldTime = 0; if (isAnimating) { int currentTime = glutGet((GLenum)(GLUT_ELAPSED_TIME)); /* Ensures fairly constant framerate */ if (currentTime - oldTime > ANIMATION_DELAY) { /* animate the scene */ Animate(); oldTime = currentTime; /* compute the frame rate */ computeFPS(); /* notify window it has to be repainted */ glutPostRedisplay(); } idle_tasks(); } }
// Keep the dart stationary relative to the dartboard (move with the dartboard), also allows dart to // scroll off the screen, hides any darts that are entirely off the screen void Dart::UpdateDart(int BGPos[]) { int actualloc[2]; bool wrapping[2] = {false, false}; actualloc[0] = loc[0] - BGPos[0]-2*8; actualloc[1] = loc[1] - BGPos[1]-2*8; if (actualloc[0] < 0) { actualloc[0] += 512; wrapping[0] = true; } if (actualloc[1] < 0) { actualloc[1] += 256; wrapping[1] = true; } Animate(); if ((wrapping[0] == true && actualloc[0]+8*8 < 512) || (wrapping[1] == true && actualloc[1]+8*8 < 256) || (wrapping[0] == false && actualloc[0] > SCREEN_WIDTH) || (wrapping[1] == false && actualloc[1] > SCREEN_HEIGHT)) { SetObject(dartnumber, ATTR0_SHAPE(0) | ATTR0_8BPP | ATTR0_REG | ATTR0_Y(0) | ATTR0_HIDE, ATTR1_SIZE(2) | ATTR1_X(0), ATTR2_ID8(64) | ATTR2_PRIO(2)); } else { SetObject(dartnumber, ATTR0_SHAPE(0) | ATTR0_8BPP | ATTR0_REG | ATTR0_Y(actualloc[1]) | ATTR0_AFF | ATTR0_AFF_DBL, ATTR1_SIZE(2) | ATTR1_X(actualloc[0]) | ATTR1_AFF(dartnumber-1), ATTR2_ID8(64) | ATTR2_PRIO(2)); } }
void CExpensiveGiftCtrl::OnTimer(UINT nIDEvent) { if (nIDEvent == 1) { if(!m_bTrackLeave) m_nPos+=m_nStep; //开始相对应长度 CRect ClientRect; GetClientRect(&ClientRect); if(m_nPos < ClientRect.Width()+m_cx*m_nItemNumber) { if(m_nAnimate==2) { m_nAnimate=0; Animate(); } else m_nAnimate++; } Invalidate(); //全部重刷 } if (nIDEvent == 1300) { KillTimer(1300); OnUpNewRoadItem(); } if (nIDEvent == 1301) { KillTimer(1301); m_bWaitRoadItem=FALSE; if(m_pRoadItem->GetCount()!=0) //后面有队列,直接推上 OnWaitNewRoadItem(TRUE); } CWnd::OnTimer(nIDEvent); }
void CSprite::AnimateThink( void ) { Animate( pev->framerate * (gpGlobals->time - m_lastTime) ); pev->nextthink = gpGlobals->time + 0.1; m_lastTime = gpGlobals->time; }
void TwoDRenderer::Update() { if (animate) { Animate(); } }
/* *----------------------------------------------------------------------------- * Called by the mainline code periodically to update the display. *----------------------------------------------------------------------------- */ ENTRYPOINT void draw_atlantis(ModeInfo * mi) { atlantisstruct *ap = &atlantis[MI_SCREEN(mi)]; Display *display = MI_DISPLAY(mi); Window window = MI_WINDOW(mi); MI_IS_DRAWN(mi) = True; if (!ap->glx_context) return; glXMakeCurrent(display, window, *(ap->glx_context)); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glRotatef(current_device_rotation(), 0, 0, 1); AllDisplay(ap); Animate(ap); glPopMatrix(); if (mi->fps_p) do_fps (mi); glXSwapBuffers(display, window); }
/**----------------------------------------------------------------------------- * 화면 그리기 *------------------------------------------------------------------------------ */ VOID Render() { /// 후면버퍼와 Z버퍼 초기화 g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(200,200,200), 1.0f, 0 ); /// 애니메이션 행렬설정 Animate(); /// 렌더링 시작 if( SUCCEEDED( g_pd3dDevice->BeginScene() ) ) { g_pd3dDevice->SetTexture( 0, g_pTexDiffuse ); /// 0번 텍스쳐 스테이지에 텍스쳐 고정(색깔맵) g_pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); /// 0번 텍스처 스테이지의 확대 필터 g_pd3dDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 ); /// 0번 텍스처 : 0번 텍스처 인덱스 사용 g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); DrawMesh( &g_matAni ); if ( !g_bHideFrustum ) { g_pFrustum->Draw( g_pd3dDevice ); } /// 렌더링 종료 g_pd3dDevice->EndScene(); } /// 후면버퍼를 보이는 화면으로! g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); }
void fnAlarm(void) { rt_uint32_t e; uint8_t buf,int_m,t=0; uint16_t delay1,delay2,strength; rt_thread_delay_hmsm(0,0,3,0); int_m = (clock_m+5)%60; rt_kprintf("It is %d:%d now\nAlarm Level %d\n",clock_h,clock_m,t); rt_event_send(reg_event,REG_ALARM_MSK); while (rt_mq_recv(key_mq,&buf,sizeof(uint8_t),0)!=RT_EOK) { if (clock_m==int_m) { t+=1; int_m = (int_m+5)%60; rt_kprintf("Alarm Level %d\n",t); } switch (t) { case 0: delay1 = 500; delay2 = 4500; strength = 400; break; case 1: delay1 = 1000; delay2 = 2000; strength = 600; break; case 2: delay1 = 500; delay2 = 500; strength = 800; break; default: delay1 = 500; delay2 = 250; strength = 1000; break; } SetAlarm(strength); rt_thread_delay_hmsm(0,0,0,delay1); SetAlarm(0); Animate(delay2); } rt_event_recv(reg_event,REG_ALARM_MSK,RT_EVENT_FLAG_OR|RT_EVENT_FLAG_CLEAR,0,&e); return; }
void XboxLightRing::Update(byte err_code, bool isOn){ if (err_code != 0){ if (Animation.IsAnimating() == false) Animate(2); // General Error cycle } if (isOn && err_code == 0 && Animation.IsAnimating() == false){ if (eColor == 0) { led1r_value = 0; led1g_value = 254; led2r_value = 0; led2g_value = 254;} if (eColor == 1) { led1r_value = 254; led1g_value = 254; led2r_value = 254; led2g_value = 254;} if (eColor == 2) { led1r_value = 254; led1g_value = 0; led2r_value = 254; led2g_value = 0;} if (eColor == 3) { led1r_value = 254; led1g_value = 0; led2r_value = 0; led2g_value = 254;} if (eColor == 4) { led1r_value = 0; led1g_value = 0; led2r_value = 0; led2g_value = 0;} } if (isOn == false && err_code == 0 && Animation.IsAnimating() == false){ led1r_value = 0; led1g_value = 0; led2r_value = 0; led2g_value = 0; } // Update animations Animation.Update(); // update leds analogWrite(led1g, led1g_value); analogWrite(led1r, led1r_value); analogWrite(led2g, led2g_value); analogWrite(led2r, led2r_value); if (bHddActive){ if (analogRead(hddPin) > 100) analogWrite(led1r, analogRead(hddPin)); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CSprite::AnimateThink( void ) { Animate( m_flSpriteFramerate * (gpGlobals->curtime - m_flLastTime) ); SetNextThink( gpGlobals->curtime ); m_flLastTime = gpGlobals->curtime; }
void CCyclerSprite::OnTakeDamage( const CTakeDamageInfo& info ) { if( m_maxFrame > 1.0 ) { Animate( 1.0 ); } }
int CCyclerSprite::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { if (m_maxFrame > 1) Animate(1); return 1; }
//------------------------------------------------------------- //- Render //- Renders the model in its position at time 0 //------------------------------------------------------------- void CMs3d::Render() { //Note: This function really isn't needed, as it preforms the same basic function // as the render function below. It is included to provide an implementation of the // Render() function put forth in the CModel class. Animate(1.0f, 0.0f, 0.0f, false); }
void CMemoryCardView::CRender::ThreadProc() { unsigned int nPixelFormat = ChoosePixelFormat(m_deviceContext, &m_PFD); SetPixelFormat(m_deviceContext, nPixelFormat, &m_PFD); m_hRC = wglCreateContext(m_deviceContext); wglMakeCurrent(m_deviceContext, m_hRC); glEnable(GL_TEXTURE_2D); glClearColor(1.0, 1.0, 1.0, 1.0); while(!m_threadOver) { while(m_mailBox.IsPending()) { m_mailBox.ReceiveCall(); } Animate(); DrawScene(); Sleep(16); } m_icons.clear(); wglMakeCurrent(NULL, NULL); wglDeleteContext(m_hRC); }
/**----------------------------------------------------------------------------- * 화면 그리기 *------------------------------------------------------------------------------ */ VOID Render() { UINT nPass; /// 후면버퍼와 Z버퍼 초기화 g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(200,200,200), 1.0f, 0 ); g_pd3dDevice->SetRenderState( D3DRS_FILLMODE, g_bWireframe ? D3DFILL_WIREFRAME : D3DFILL_SOLID ); /// 애니메이션 행렬설정 Animate(); /// 렌더링 시작 if( SUCCEEDED( g_pd3dDevice->BeginScene() ) ) { if( g_bUseVS ) // 정점 쉐이더를 사용하여 출력? { g_pEffect->SetFloat( "g_fTime", (float)(timeGetTime()) / 100 ); /// 정점선언값과 정점 설정 g_pd3dDevice->SetVertexDeclaration( g_pDecl ); g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(MYVERTEX) ); /// fx출력에 사용할 테크닉 선정 g_pEffect->SetTechnique( "MyShader" ); /// fx를 사용한 출력개시 g_pEffect->Begin( &nPass, D3DXFX_DONOTSAVESTATE ); /// PASS 개수만큼 출력 for( int i = 0; i < nPass ; i++ ) { g_pEffect->BeginPass( i ); g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 1 ); g_pEffect->EndPass(); } /// fx를 사용한 출력종료 g_pEffect->End(); } else { // fx를 사용한뒤에는 이 값을 NULL로 해야 D3D고정 파이프라인을 사용할 수 있다. g_pd3dDevice->SetVertexShader( NULL ); g_pd3dDevice->SetPixelShader( NULL ); g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(MYVERTEX) ); g_pd3dDevice->SetFVF( MYVERTEX::FVF ); g_pd3dDevice->SetTexture( 0, g_pTexture ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); /// MODULATE연산으로 색깔을 섞음 g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); /// 첫번째 섞을색은 텍스쳐 색 g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); /// 두번째 섞을색은 정점 색 g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); /// alpha연산은 사용하지 않음 g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 1 ); } g_pd3dDevice->EndScene(); } /// 후면버퍼를 보이는 화면으로! g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); }
MAS::Widget *MAS::Window::Popup(MAS::Dialog *p, int xx, int yy, MAS::Widget *f) { SetAnimationProperties(skin->winAnimationLength, skin->winAnimationType); Animate(); Widget *ret = Dialog::Popup(p, xx, yy, f); ResetAnimation(); return ret; }
void CCyclerSprite::Think( void ) { if ( ShouldAnimate() ) Animate( pev->framerate * (gpGlobals->time - m_lastTime) ); pev->nextthink = gpGlobals->time + 0.1; m_lastTime = gpGlobals->time; }
void CheckTileAnimation() { static char i; for (i=0; i<100; i++) { if ((vspanim[i].delay) && (vspanim[i].delay<vadelay[i])) Animate(i); vadelay[i]++; } }
void NPC::Handle(Layer_Class* Mask_Temp, float temp_x, float temp_y) { Mask = Mask_Temp; px = temp_x;py = temp_y; Timer(); Move(); Animate(); }
void CCyclerSprite::Think( void ) { if( ShouldAnimate() ) Animate( GetFrameRate() * ( gpGlobals->time - m_lastTime ) ); SetNextThink( gpGlobals->time + 0.1 ); m_lastTime = gpGlobals->time; }
void DrawParticle(Particle *p,int animationNum,int x, int y) { Animate(&p->sprite->animation[animationNum],p->sprite->animation[animationNum].startFrame); DrawSprite(p->sprite,x ,y,GetCurrentFrame(&p->sprite->animation[animationNum]), GetRenderer(),SDL_FLIP_NONE); p->frame++; p->position.y -=.5; }
void Enemy::UpdateAI(float deltaTime) { switch (m_currentState) { case Walking: //Move enemy in direction of target Animate(deltaTime); //If enemy is within range switch to attacking mode if (abs(m_position.Distance(Vector2D(m_targetPosition.GetX() - 25, m_targetPosition.GetY() - 25)) <= m_attackingRange)) { m_currentState = Attacking; } break; case Attacking: Animate(deltaTime); break; } }
/* <cd228> ../cstrike/dlls/h_cycler.cpp:322 */ int CCyclerSprite::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { if (m_maxFrame > 1.0) { Animate(1.0); } return 1; }
int CParticleImageManager::LoadAll (void) { for (int i = 0; i < PARTICLE_TYPES; i++) { if (!Load (i)) return 0; Animate (i); } return 1; }
void Barrier::Update(float deltaTime, sf::Event ev) { frameCount++; if (frameCount % 30 == 0) { Animate(); } }
void Action_update() { TurnLft( ACTIONS[ACTION_TURNLFT] ); TurnRgt( ACTIONS[ACTION_TURNRGT] ); MoveFwd( ACTIONS[ACTION_MOVEFWD] ); AutoDie( ACTIONS[ACTION_AUTODIE] ); Gravity( ACTIONS[ACTION_GRAVITY] ); Collide( ACTIONS[ACTION_COLLIDE] ); ShootIt( ACTIONS[ACTION_SHOOTIT] ); Animate( ACTIONS[ACTION_ANIMATE] ); }