void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CFX_FloatPoint& ptHead, const CFX_FloatPoint& ptFoot) { if (bVisible) { if (IsVisible()) { if (m_ptHead != ptHead || m_ptFoot != ptFoot) { m_ptHead = ptHead; m_ptFoot = ptFoot; m_bFlash = TRUE; Move(m_rcInvalid, FALSE, TRUE); } } else { m_ptHead = ptHead; m_ptFoot = ptFoot; EndTimer(); BeginTimer(PWL_CARET_FLASHINTERVAL); CPWL_Wnd::SetVisible(TRUE); m_bFlash = TRUE; Move(m_rcInvalid, FALSE, TRUE); } } else { m_ptHead = CFX_FloatPoint(); m_ptFoot = CFX_FloatPoint(); m_bFlash = FALSE; if (IsVisible()) { EndTimer(); CPWL_Wnd::SetVisible(FALSE); } } }
int acquisitionPassFramesToTarget(ModuleIdentifier moduleID,DeviceIdentifier devID,unsigned int frameNumber) { //fprintf(stderr,"acquisitionPassFramesToTarget not fully implemented yet! Module %u , Device %u = %s \n",moduleID,devID, module[moduleID].device[devID].outputString); if (module[moduleID].device[devID].dryRunOutput) { fprintf(stderr,"Grabber Running on Dry Run mode , ,grabbing frames and doing nothing\n"); //Lets access the frames like we want to use them but not use them.. StartTimer(FRAME_PASS_TO_TARGET_DELAY); unsigned int width, height , channels , bitsperpixel; acquisitionGetColorFrameDimensions(moduleID,devID,&width,&height,&channels,&bitsperpixel); acquisitionGetColorFrame(moduleID,devID); acquisitionGetDepthFrameDimensions(moduleID,devID,&width,&height,&channels,&bitsperpixel); acquisitionGetDepthFrame(moduleID,devID); //Done doing nothing with our input..! EndTimer(FRAME_PASS_TO_TARGET_DELAY); } else if (module[moduleID].device[devID].fileOutput) { StartTimer(FRAME_PASS_TO_TARGET_DELAY); char outfilename[2048]={0}; sprintf(outfilename,"%s/colorFrame_%u_%05u",module[moduleID].device[devID].outputString,devID,frameNumber); acquisitionSaveColorFrame(moduleID,devID,outfilename); sprintf(outfilename,"%s/depthFrame_%u_%05u",module[moduleID].device[devID].outputString,devID,frameNumber); acquisitionSaveDepthFrame(moduleID,devID,outfilename); EndTimer(FRAME_PASS_TO_TARGET_DELAY); } else if (module[moduleID].device[devID].networkOutput) { StartTimer(FRAME_PASS_TO_TARGET_DELAY); unsigned int width, height , channels , bitsperpixel; acquisitionGetColorFrameDimensions(moduleID,devID,&width,&height,&channels,&bitsperpixel); pushImageToRemoteNetwork(module[moduleID].device[devID].frameServerID , 0 , (void*) acquisitionGetColorFrame(moduleID,devID) , width , height , channels , bitsperpixel); acquisitionGetDepthFrameDimensions(moduleID,devID,&width,&height,&channels,&bitsperpixel); pushImageToRemoteNetwork(module[moduleID].device[devID].frameServerID , 1 , (void*) acquisitionGetDepthFrame(moduleID,devID) , width , height , channels , bitsperpixel); EndTimer(FRAME_PASS_TO_TARGET_DELAY); } else { fprintf(stderr,RED "acquisitionPassFramesToTarget cannot find a method to use for module %u , device %u , has acquisitionInitiateTargetForFrames been called?\n" NORMAL , moduleID , devID ); return 0; } return 1; }
void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { m_bMouseIn = false; InvalidateRect(GetViewBBox(pPageView, pAnnot)); EndTimer(); ASSERT(m_pWidget); }
void CRUAuditRefreshTaskExecutor::Epilogue() { RUASSERT(FALSE == IsTransactionOpen()); EndTimer(); BeginTransaction(); // if this is the first refresh, the MV status can be // changed to initialized if( TRUE == GetRefreshTask()->NeedToExecuteInternalRefresh() ) { if (CDDObject::eON_STATEMENT == GetRootMVType()) { EpilogueHandleOnStatementMV(); } ResetObjectsAvailable(); } FinalMetadataUpdate(); CommitTransaction(); TESTPOINT2(CRUGlobals::TESTPOINT131, GetRootMVName()); LogClosureMessage(); SetState(EX_COMPLETE); }
void CRUUnAuditRefreshTaskExecutor::Epilogue() { EndTimer(); BeginTransaction(); if (TRUE == GetRefreshTask()->NeedToExecuteInternalRefresh()) { if (CDDObject::eON_STATEMENT == GetRootMVType()) { EpilogueHandleOnStatementMV(); } // Set the MV(s)/indexes back available ResetObjectsAvailable(); } FinalMetadataUpdate(); CommitTransaction(); TESTPOINT2(CRUGlobals::TESTPOINT107, GetRootMVName()); LogClosureMessage(); SetState(EX_COMPLETE); }
EXPORT_C void AknListBoxShortCuts::RunL() { TShortcutEvent event = EIdle; EndTimer(); ChangeStateL(event); DoProcedureL(); }
int main(int argc, char *argv[]) { if (argc<3) { fprintf(stderr,"Not enough arguments\n"); return 1; } #if TIME_OPERATIONS StartTimer(0); #endif // TIME_OPERATIONS fprintf(stdout,"Image Processing %s -> %s !\n",argv[1],argv[2]); runFilter(argc,argv); #if TIME_OPERATIONS EndTimer(0); fprintf(stdout,"took %u milliseconds !\n",GetLastTimerMilliseconds(0)); #endif // TIME_OPERATIONS return 0; }
EXPORT_C void AknListBoxShortCuts::ChangeStateL(TShortcutEvent aEvent) { switch(aEvent) { case EIdle: iState = iIdleNextState; break; case ENavi: iState = iNaviKeyNextState; break; case ENumber: iState = iNumKeyNextState; break; case EStateToOne: EndTimer(); iState=EState1; iIdleNextState=EStateNone; iNaviKeyNextState=EStateNone; iNumKeyNextState=EStateNone; DoProcedureL(); break; case EStateToFive: iState = EState5; break; default: break; }; }
int acquisitionSnapFrames(ModuleIdentifier moduleID,DeviceIdentifier devID) { printCall(moduleID,devID,"acquisitionSnapFrames", __FILE__, __LINE__); int retres=0; StartTimer(FRAME_SNAP_DELAY); if (*plugins[moduleID].snapFrames!=0) { EndTimer(FRAME_SNAP_DELAY); return (*plugins[moduleID].snapFrames) (devID); } EndTimer(FRAME_SNAP_DELAY); MeaningfullWarningMessage(moduleID,devID,"acquisitionSnapFrames"); return 0; }
void Lineout2D::EndLeftButtonAction() { EndRubberBand(); Lineout(); EndTimer(); doAlign = false; }
void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot) { if (bVisible) { if (IsVisible()) { if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y || m_ptFoot.x != ptFoot.x || m_ptFoot.y != ptFoot.y) { m_ptHead = ptHead; m_ptFoot = ptFoot; m_bFlash = TRUE; //Move(GetCaretRect(),FALSE,TRUE); Move(m_rcInvalid, FALSE, TRUE); } } else { m_ptHead = ptHead; m_ptFoot = ptFoot; EndTimer(); BeginTimer(PWL_CARET_FLASHINTERVAL); CPWL_Wnd::SetVisible(TRUE); m_bFlash = TRUE; //Move(GetCaretRect(),FALSE,TRUE); Move(m_rcInvalid, FALSE, TRUE); } } else { m_ptHead = CPDF_Point(0, 0); m_ptFoot = CPDF_Point(0, 0); m_bFlash = FALSE; if (IsVisible()) { EndTimer(); CPWL_Wnd::SetVisible(FALSE); } } }
void Zoom3D::DisableSpinMode(void) { if (shouldSpin) { EndTimer(); shouldSpin = false; } }
void SortDescending(const vector<float> &Values, vector<unsigned> &Order) { StartTimer(Sort); const unsigned N = SIZE(Values); Range(Order, N); g_SortVecFloat = &Values; sort(Order.begin(), Order.end(), CmpDescVecFloat); EndTimer(Sort); }
void FlyThrough::DisableSpinMode(void) { if (shouldSpin) { EndTimer(); shouldSpin = false; } }
void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { m_bMouseIn = FALSE; FX_RECT rect = GetViewBBox(pPageView, pAnnot); InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); EndTimer(); ASSERT(m_pWidget != NULL); }
AngelFight::~AngelFight() { for( uint32_t i = 0; i < PLAYER_COUNT; ++i ) { delete m_pTeam[i]; m_pPlayers[i] = NULL; m_pTeam[i] = NULL; } EndTimer(true); }
void CMScrollLabel::EndScroll() { if ( m_nScrollCount > 0 ) { m_nScrollCount = 0; m_nMoveLength = 0; m_nCurCount = 0; Invalide(); EndTimer(); PumpCommand(m_nWndID, AWS_SysCmd_ScrollLabelEndScroll); } }
int AngelFight::OnQuickGame( Player* p, const uint8_t buf[], int len ) { DEBUG_LOG("Quick Game Begin"); #ifndef TW_VER { //统计使用闪电战的人次 uint32_t msgbuff[2]= { p->GetUserID(), 1 }; msglog( statistic_file, 0x0409B43B, get_now_tv()->tv_sec, &msgbuff, sizeof(msgbuff) ); } #endif EndTimer(true); m_bQuickGame = true; return ActionAndNotify(); }
int AngelFight::OnAniOK( Player* p, const uint8_t buf[], int len ) { if( !p ) { ERROR_LOG( "AngelFight::OnAniOK Invalid Player Ptr" ); return GER_game_system_err; } p->SetValidCmd( p->GetValidCmd() & ~AFC_ANI_OK ); if( EndTimer() ) { CheckGameOver(); } return 0; }
int AngelFight::OnLoadDataOK( Player* p, const uint8_t buf[], int len ) { if( !p ) { ERROR_LOG( "AngelFight::OnLoadDataOK Invalid Player Ptr" ); return GER_game_system_err; } p->SetValidCmd( p->GetValidCmd() & ~AFC_DATA_OK ); if( EndTimer() ) { return RoundBegin(); } return 0; }
void CBEdit::HideCaret() { if ( m_bCaretIsShow ) { m_bCaretIsShow = false; EndTimer(); m_bCaretIsVisible = false; CEspRect rt; rt.m_ptLT = m_oCaretPos; rt.m_ptRB.m_nX = rt.m_ptLT.m_nX + m_oCaretSize.m_nWidth; rt.m_ptRB.m_nY = rt.m_ptLT.m_nY + m_oCaretSize.m_nHeight; InvalideRect(rt); } }
int AngelFight::OnAction( Player* p, const uint8_t buf[], int len ) { if( !p ) { ERROR_LOG( "AngelFight::OnAction Invalid Player Ptr" ); return GER_game_system_err; } if( !buf ) { ERROR_LOG( "AngelFight::OnAction Invalid Buf Info" ); return GER_game_system_err; } if( m_bQuickGame ) { DEBUG_LOG("It's in Quick Game"); return 0; } int j = 0; int32_t action; int32_t param; int expectLen = sizeof(action) + sizeof(param); CHECK_BODY_LEN( len, expectLen ); ant::unpack( buf, action, j ); ant::unpack( buf, param, j ); //DEBUG_LOG("Action:[%d], Param:[%d]", action, param ); int ret = p->SetActionState( ACTION_STATE(action), param ); if( 0 != ret ) { DEBUG_LOG("SetActionState Failed"); return send_to_player_err( p->GetSprite(),p->GetSprite()->waitcmd, -ret ); } else { if( action == AS_AUTO && !m_bAuto ) { m_bAuto = true; #ifndef TW_VER //统计使用自动游戏的人次 uint32_t msgbuff[2]= { p->GetUserID(), 1 }; msglog( statistic_file, 0x0409B43C, get_now_tv()->tv_sec, msgbuff, sizeof(msgbuff) ); #endif } DEBUG_LOG("SetActionState OK"); EndTimer(); return ActionAndNotify(); } }
int AngelFight::handle_timeout( void* data ) { EndTimer(true); m_nTimerID = 0; DEBUG_LOG( "AngelFight Timer Out, TimerEvent:[%d]", int32_t(m_nTimerEvent) ); switch(m_nTimerEvent) { case TE_OPERATION: { for( uint32_t i = 0; i < m_nPlayerCount; ++i ) { if( m_pPlayers[i]->GetActionState() == AS_WAIT ) { m_pPlayers[i]->AutoAct(); ActionAndNotify(); } } } break; case TE_SELECT_MONSTER: { return GER_end_of_game; } case TE_WAIT_ANI: { return CheckGameOver(); } break; case TE_LOAD_DATA: { return GER_end_of_game; } case TE_CHANGE_PLAYER: { return RoundBegin(); } break; default: break; } return 0; }
int AngelFight::OnQuit( Player* p, const uint8_t buf[], int len ) { if( !p ) { ERROR_LOG( "AngelFight::OnQuit Invalid Player Ptr" ); return GER_game_system_err; } p->Leave(); m_nWinnerTeam = p->GetTar()->GetTeamID(); if( m_nPlayerCount > 0 ) { int len = sizeof(protocol_t); init_proto_head( pkg, AFP_PLAYER_LEAVE, len ); send_to_player( p->GetTar()->GetSprite(), pkg, len ); } EndTimer( true ); return NotifyGameOver(); }
void StartMissionChronoSequence(PMISSIONCHRONO mchrono) { COORD mcdrawcoords; TIMER timer; char mctimebuf[80]; int i; mchrono->countdown = TRUE; sprintf(mctimebuf, "%2.2d:%2.2d.%2.2d", mchrono->minutes, mchrono->seconds, mchrono->split); mcdrawcoords = retrieveTextCenter(mctimebuf); GREEN; setcursor(mcdrawcoords.X, mcdrawcoords.Y); printf(mctimebuf); Sleep(80); LGREEN; setcursor(mcdrawcoords.X, mcdrawcoords.Y); printf(mctimebuf); Sleep(1000); LRED; setcursor(mcdrawcoords.X, mcdrawcoords.Y); printf(mctimebuf); Sleep(500); for (i = 0; i < 150; i++){ if(i == 148){ RED; } StartTimer(&timer); sprintf(mctimebuf, "%2.2d:%2.2d.%2.2d", mchrono->minutes, mchrono->seconds, mchrono->split); setcursor(mcdrawcoords.X, mcdrawcoords.Y); printf(mctimebuf); Sleep(50); EndTimer(&timer); mchrono->split -= SplitElapsed(&timer); calibratemissionchrono(mchrono); } cls(); }
int CopyRegister(struct VideoRegister * source,struct VideoRegister * target,unsigned int copy_features,unsigned int copy_faces) { if ( (source==0) || (target==0) ) { fprintf(stderr,"CopyRegister Called with incorrect registers as parameters\n"); return 0; } StartTimer(COPY_REGISTER_DELAY); // STATISTICS KEEPER FOR HYPERVISOR | START unsigned int image_size=metrics[RESOLUTION_MEMORY_LIMIT_3BYTE]; if ( source->depth == 1 ) { image_size=metrics[RESOLUTION_MEMORY_LIMIT_1BYTE]; } else if ( source->depth == 3 ) { image_size=metrics[RESOLUTION_MEMORY_LIMIT_3BYTE]; } else { fprintf(stderr,"assuming 3byte size , although we got %u \n",source->depth); } register BYTE *start_px = (BYTE *) source->pixels; register BYTE *px = (BYTE *) source->pixels; register BYTE *tpx = (BYTE *) target->pixels; while ( px < start_px+image_size) { *tpx = *px; ++tpx; ++px; } target->size_x=source->size_x; target->size_y=source->size_y; target->depth=source->depth; target->lock=source->lock; target->time=source->time; target->used=source->used; if (copy_features) { CopyFeatureList(source->features,target->features); } if (copy_faces) { CopyFeatureList(source->faces,target->faces); } EndTimer(COPY_REGISTER_DELAY); // STATISTICS KEEPER FOR HYPERVISOR | END return 1; }
EXPORT_C void AknListBoxShortCuts::StartTimerL(TShortcutTimerType aTimer) { TInt timeout = 0; EndTimer(); iCurrentTimerType = aTimer; switch(iCurrentTimerType) { case ENoUserActionTimeout: timeout = 20; break; case EIndexDisplayTimeout: timeout = 30; break; case EShortcutActiveTimeout: // Softkeys are disabled during shortcutactivetimeout. DoActionL(EDisableSoftkeys); timeout = 20; break; default: break; }; After(timeout); }
/** * Event callback (player_death) * The player is about to die. * * @param iVictim The victim index. * @param iAttacker The attacker index. **/ void DeathOnClientDeath(int iVictim, int iAttacker) { // Get real player index from event key CBasePlayer* cBaseVictim = view_as<CBasePlayer>(iVictim); CBasePlayer* cBaseAttacker = view_as<CBasePlayer>(iAttacker); // Remove glowing cBaseVictim->m_bSetGlow(false); // Remove night vision cBaseVictim->m_bNightVisionOn = 0; // Clear any existing overlay from screen if(RoundEndGetRoundValidate()) { ToolsSwitchLevel(cBaseVictim, UNVALID_MESSAGE_ID); } // Emit scream sound cBaseVictim->InputEmitAISound(SNDCHAN_VOICE, SNDLEVEL_SCREAMING, (ZombieIsFemale(cBaseVictim->m_nZombieClass)) ? "ZOMBIE_FEMALE_DEATH_SOUNDS" : "ZOMBIE_DEATH_SOUNDS", true); // Player was killed by other ? if(cBaseVictim != cBaseAttacker) { // If respawn amount more, than limit, stop if(cBaseVictim->m_nRespawnTimes > GetConVarInt(gCvarList[CVAR_RESPAWN_AMOUNT])) { return; } // Verify that the attacker is connected and alive if(IsPlayerExist(view_as<int>(cBaseAttacker))) { // Give ammopacks for kill cBaseAttacker->m_nAmmoPacks += GetConVarInt(gCvarList[CVAR_BONUS_KILL]); // Level system work only for humans and zombies if(!cBaseAttacker->m_bNemesis && !cBaseAttacker->m_bSurvivor) { if(GetConVarBool(gCvarList[CVAR_LVL_SYSTEM]) && cBaseAttacker->m_iLevel < 10) { // Increment level cBaseAttacker->m_iLevel++; // Update overlays and speed ToolsSwitchLevel(cBaseAttacker, cBaseAttacker->m_iLevel); ToolsIncreaseSpeed(cBaseAttacker, cBaseAttacker->m_iLevel); } } } } // If player was killed by world, respawn on suicide? else if (!GetConVarBool(gCvarList[CVAR_RESPAWN_WORLD])) { return; } // Respawn if human/zombie/nemesis/survivor? if ((cBaseVictim->m_bZombie && !cBaseVictim->m_bNemesis && !GetConVarBool(gCvarList[CVAR_RESPAWN_ZOMBIE])) || (!cBaseVictim->m_bZombie && !cBaseVictim->m_bSurvivor && !GetConVarBool(gCvarList[CVAR_RESPAWN_HUMAN])) || (cBaseVictim->m_bNemesis && !GetConVarBool(gCvarList[CVAR_RESPAWN_NEMESIS])) || (cBaseVictim->m_bSurvivor && !GetConVarBool(gCvarList[CVAR_RESPAWN_SURVIVOR]))) { return; } // Increment count cBaseVictim->m_nRespawnTimes++; // Set timer for respawn player EndTimer(Task_ZombieRespawn[view_as<int>(cBaseVictim)]); Task_ZombieRespawn[view_as<int>(cBaseVictim)] = CreateTimer(GetConVarFloat(gCvarList[CVAR_RESPAWN_TIME]), EventRespawnZombie, view_as<int>(cBaseVictim)); }
void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { EndTimer(); ASSERT(m_pWidget != NULL); }
unsigned int CompressRegister1Byte(struct VideoRegister * input,struct ExtraLargeVideoRegister * output) { if ( ( input==0 ) || ( output==0 ) ) { fprintf(stderr,"Compress Register called with incorrect registers\n"); return 0; } // if (!VideoRegisterRequestIsOk(input,metrics[RESOLUTION_X],metrics[RESOLUTION_Y],3)) { return 0; } // if (!ExtraLargeVideoRegisterRequestIsOk(output,metrics[RESOLUTION_X],metrics[RESOLUTION_Y],3)) { return 0; } //This code will add up all the pixels to every other pixel , in order to speed up access //Patch procedures when each pixel must be added to the others..! if ( !ThisIsA1ByteRegister(input) ) { fprintf(stderr,"CompressRegister1Byte called with 3byte image\n"); return 0; } StartTimer(COMPRESS_IMAGE_DELAY); // STATISTICS KEEPER FOR HYPERVISOR | START ClearExtraLargeVideoRegister(output); unsigned char *in_ptr_start=input->pixels,*in_ptr=in_ptr_start; unsigned int *out_ptr_start=output->pixels,*out_ptr=out_ptr_start,*out_ptr_adj=out_ptr_start; output->depth = 1; unsigned int x=0,y=0; while (y<metrics[RESOLUTION_Y]) { x = metrics[RESOLUTION_X]; in_ptr += metrics[RESOLUTION_X]; out_ptr += metrics[RESOLUTION_X]; while (x>0) { --in_ptr; --out_ptr; --x; *out_ptr += *in_ptr; out_ptr_adj = out_ptr-1; if (x>0) *out_ptr_adj = *out_ptr; } in_ptr += metrics[RESOLUTION_X]; out_ptr += metrics[RESOLUTION_X]; ++y; } x=0; y=0; unsigned int last_val=0; while (x<metrics[RESOLUTION_X]) { y = metrics[RESOLUTION_Y]; out_ptr=out_ptr_start+metrics[RESOLUTION_MEMORY_LIMIT_1BYTE]+x; // You have subtract at least metrics[RESOLUTION_X]; to make it a usable pointer last_val = *out_ptr; while (y>0) { out_ptr -= metrics[RESOLUTION_X]; --y; *out_ptr += last_val; last_val=*out_ptr; } ++x; } EndTimer(COMPRESS_IMAGE_DELAY); // STATISTICS KEEPER FOR HYPERVISOR | START // THIS IS WRONG -> MarkRegistersAsSynced(input,output); output->time = input->time; // Instead of MarkRegistersAsSynced return 1; }