void Flea3Camera::Configure(Config& config) { // Video Mode SetVideoMode(config.video_mode, config.format7_mode, config.pixel_format, config.width, config.height); // Update CameraInfo here after video mode is changed camera_info_ = GetCameraInfo(camera_); // Frame Rate SetFrameRate(config.fps); // Raw Bayer SetRawBayerOutput(config.raw_bayer_output); // White Balance SetWhiteBalanceRedBlue(config.white_balance, config.auto_white_balance, config.wb_red, config.wb_blue); // Exposure SetExposure(config.exposure, config.auto_exposure, config.exposure_value); SetShutter(config.auto_shutter, config.shutter_ms); SetGain(config.auto_gain, config.gain_db); SetBrightness(config.brightness); SetGamma(config.gamma); // Strobe SetStrobe(config.strobe_control, config.strobe_polarity); // Trigger SetTrigger(config.trigger_source, config.trigger_polarity); // Save this config config_ = config; }
/*********************** * H263Encoder * Constructor de la clase ************************/ H263Encoder1996::H263Encoder1996() { // Set default values frame = NULL; codec = NULL; type = VideoCodec::H263_1998; format = 0; // Init framerate SetFrameRate(5,300,20); //Register all avcodec_register_all(); // Get encoder codec = avcodec_find_encoder(CODEC_ID_H263); // Check codec if(!codec) Error("No codec found\n"); //No estamos abiertos opened = false; //Alocamos el conto y el picture ctx = avcodec_alloc_context(); picture = avcodec_alloc_frame(); }
void TimeComputer::Init(float frameRate, bigtime_t realBaseTime) { fRealTime = realBaseTime; fPerformanceTime = 0; fDrift = 1; SetFrameRate(frameRate); }
void CPenguin::Spawn() { Precache(); SetModel( "models/w_penguinnest.mdl" ); FallInit(); SetSequence( PENGUINNEST_IDLE ); SetAnimTime( gpGlobals->time ); SetFrameRate( 1 ); }
long ProjectPrefsGUI::HandleCBChange(NativeControl Handle, NativeGUIWin NW, int CtrlID) { switch (CtrlID) { case IDC_DISTANCEUNITSDROP: { SetDistanceUnits(); break; } case IDC_HEIGHTUNITSDROP: { SetHeightUnits(); break; } case IDC_ANGLEUNITSDROP: { SetAngleUnits(); break; } case IDC_TIMEUNITSDROP: { SetTimeUnits(); break; } case IDC_POSLONDROP: { SetPosLonHemi(); break; } case IDC_LATLONDISPLAY: { SetLatLonDisplay(); break; } case IDC_GEOPROJDISPLAY: { SetGeoProjDisplay(); break; } case IDC_FRAMERATEDROP: { SetFrameRate(); break; } } // switch CtrlID return (0); } // ProjectPrefsGUI::HandleCBChange
void CoreEngine::Init(float frameRate) { SetFrameRate(frameRate); m_display.Init(m_game->GetTitle(), 800, 600); //TODO: width,height game parameters m_renderEngine.InitGraphics(); m_inputManager.Init(m_display.GetWindow()); m_game->Init(); //std::cerr << (m_game->GetInputManager() == nullptr) << std::endl; //std::cerr << (m_game->GetState()->GetInputManager() == nullptr) << std::endl; //std::cerr << (m_game->GetState() == nullptr) << std::endl; }
void V4SceneManager::LoadNew() { LoadCommon(); /* Create a BIFS stream with one AU with one ReplaceScene */ GF_StreamContext *sc = gf_sm_stream_new(m_pSm, 1, GF_STREAM_SCENE, 0); GF_AUContext *au = gf_sm_stream_au_new(sc, 0, 0, 1); GF_Command *command = gf_sg_command_new(m_pIs->graph, GF_SG_SCENE_REPLACE); gf_list_add(au->commands, command); SetLength(50); SetFrameRate(25); // reinitializes the node pool pools.Clear(); }
void V4SceneManager::LoadFile(const char *path) { LoadCommon(); GF_Terminal *term = m_gpac_panel->GetMPEG4Terminal(); /* Loading of a file (BT, MP4 ...) and modification of the SceneManager */ GF_SceneLoader load; memset(&load, 0, sizeof(GF_SceneLoader)); load.fileName = path; load.ctx = m_pSm; if (strstr(path, ".mp4") || strstr(path, ".MP4") ) load.isom = gf_isom_open(path, GF_ISOM_OPEN_READ, NULL); gf_sm_load_init(&load); gf_sm_load_run(&load); gf_sm_load_done(&load); if (load.isom) gf_isom_delete(load.isom); /* SceneManager should be initialized and filled correctly */ gf_sg_set_scene_size_info(m_pIs->graph, m_pSm->scene_width, m_pSm->scene_height, m_pSm->is_pixel_metrics); // TODO : replace with GetBifsStream GF_StreamContext *sc = (GF_StreamContext *) gf_list_get(m_pSm->streams,0); if (sc->streamType == 3) { GF_AUContext *au = (GF_AUContext *) gf_list_get(sc->AUs,0); GF_Command *c = (GF_Command *) gf_list_get(au->commands,0); //gf_sg_command_apply(m_pIs->graph, c, 0); /* This is a patch to solve the save pb: When ApplyCommand is made on a Scene Replace Command The command node is set to NULL When we save a BIFS stream whose first command is of this kind, the file saver thinks the bifs commands should come from an NHNT file This is a temporary patch */ if (c->tag == GF_SG_SCENE_REPLACE) { c->node = m_pIs->graph->RootNode; } } gf_sc_set_scene(term->compositor, m_pIs->graph); m_pIs->graph_attached = 1; // TODO : read actual values from file SetLength(50); SetFrameRate(25); // retrieves all the node from the tree and adds them to the node pool GF_Node * root = gf_sg_get_root_node(m_pIs->graph); // CreateDictionnary(); }
void Import::SetSceneParameters() { Interval range; range.SetStart(0); range.SetEnd(30); SetFrameRate(30); SetTicksPerFrame(160); range.SetStart(range.Start() * GetTicksPerFrame()); range.SetEnd(range.End() * GetTicksPerFrame()); m_ip->SetAnimRange(range); Point3 bkColor (0.0f, 0.0f, 0.0f); m_impip->SetBackGround(0, bkColor); Point3 amColor (0.3f, 0.3f, 0.3f); m_impip->SetAmbient(0, amColor); }
/************************************ * Main program * ************************************/ int32_t main() { int32_t quit = 0,i, correct,number; char buf[257]; char *langs[]={ "US\0","DE\0","SE\0","FR\0","IT\0", }; /* Read UAE configuration */ i = GetUaeConfig( &config ); while( quit == 0 ) { printf(" UAE-Control v0.1\n\n"); printf(" 1) Reset\n"); printf(" 2) Debug\n"); printf(" 3) Exit Emulator\n"); printf(" 4) Change framerate (Currently : %ld)\n", config.framerate); printf(" 5) Toggle sound (Currently : %s)\n", config.do_output_sound ? "ON" : "OFF"); printf(" 6) Toggle fake joystick (Currently : %s)\n", config.do_fake_joystick ? "ON" : "OFF"); printf(" 7) Change language (Currently : %s)\n", langs[config.keyboard]); printf(" 8) Eject a disk\n"); printf(" 9) Insert a disk\n"); printf("10) Exit UAE-Control\n\n"); correct = 0; while( correct == 0 ) { printf(" Command : "); gets( buf ); i = atoi( buf ); if ((i > 0) && (i < 11)) correct = 1; } switch( i ) { case 1: HardReset(); break; case 2: DebugFunc(); break; case 3: ExitEmu(); break; case 4: printf(" Enter new framerate (1-20) :"); gets( buf ); number = atoi( buf ); if (SetFrameRate (number)) GetUaeConfig(&config); else printf(" Illegal value, not changed.\n"); break; case 5: if (config.do_output_sound) DisableSound(); else EnableSound(); GetUaeConfig( &config ); break; case 6: if (config.do_fake_joystick) DisableJoystick(); else EnableJoystick(); GetUaeConfig( &config ); break; case 7: printf(" 1 = US, 2 = DE, 3 = SE, 4 = FR, 5 = IT\n"); printf(" What will it be : "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <= 5)) { ChangeLanguage( number-1 ); GetUaeConfig( &config ); } else { printf(" Illegal value, not changed.\n"); } break; case 8: print_drive_status(); printf(" Eject which drive (1-4): "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <=4 )) { EjectDisk( number-1 ); GetUaeConfig( &config ); } else { printf(" Illegal drive, not changed.\n"); } break; case 9: print_drive_status(); printf(" Enter disk to drive (1-4): "); gets( buf ); number = atoi( buf ); if ((number >= 1) && (number <= 4)) { printf("Name of diskfile :"); gets( buf ); InsertDisk( (UBYTE *)&buf, number - 1 ); GetUaeConfig( &config ); } else { printf(" Illegal drive, not changed.\n"); } break; case 10: quit = 1; break; } } quit_program(0, ""); return(0); }
/***************************************** * Main program * *****************************************/ int main() { int quit = 0, i; struct IntuiMessage *msg; struct Gadget *button; struct StringInfo *strinfo; char buf[257]; UWORD koodi, msgID; ULONG classi, number; APTR address; ULONG CycleTags[3]; CycleTags[0] = GTCY_Active; CycleTags[1] = (ULONG) & number; CycleTags[2] = TAG_DONE; /* Read UAE configuration */ i = GetUaeConfig(&config); i = setup_window(); if (i == 0) { quit_program(1, "Cannot setup a window!"); return 1; } while (quit == 0) { WaitPort(window->UserPort); while (msg = (struct IntuiMessage *) GT_GetIMsg(window->UserPort)) { classi = msg->Class; koodi = msg->Code; address = msg->IAddress; if (classi == IDCMP_GADGETUP) { msgID = ((struct Gadget *) msg->IAddress)->GadgetID; button = (struct Gadget *) msg->IAddress; if (button->SpecialInfo) { strinfo = (struct StringInfo *) button->SpecialInfo; } } else msgID = msg->Code; GT_ReplyIMsg((struct IntuiMessage *) msg); switch (classi) { case IDCMP_CLOSEWINDOW: quit = 1; break; case IDCMP_GADGETUP: switch (msgID) { case GAD_EXITEMU: ExitEmu(); break; case GAD_EJECT_DF0: EjectDisk(0); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF1: EjectDisk(1); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF2: EjectDisk(2); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_EJECT_DF3: EjectDisk(3); Delay(30); GetUaeConfig(&config); print_drive_status(); break; case GAD_SOUND: if (config.do_output_sound) DisableSound(); else EnableSound(); Delay(30); GetUaeConfig(&config); break; case GAD_JOYSTICK: if (config.do_fake_joystick) DisableJoystick(); else EnableJoystick(); Delay(30); GetUaeConfig(&config); break; case GAD_FRAMERATE: SetFrameRate(strinfo->LongInt); Delay(30); GetUaeConfig(&config); break; case GAD_INSERT_DF0: strcpy(buf, config.df0_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 0); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF1: strcpy(buf, config.df1_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 1); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF2: strcpy(buf, config.df2_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 2); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_INSERT_DF3: strcpy(buf, config.df3_name); if (get_string(buf, 255)) { InsertDisk((UBYTE *) buf, 3); Delay(30); GetUaeConfig(&config); print_drive_status(); } break; case GAD_LANGUAGE: number = config.keyboard; number++; if (number == 5) number = 0; ChangeLanguage(number); Delay(30); GetUaeConfig(&config); break; case GAD_RESET: ColdReboot(); break; case GAD_DEBUG: DebugFunc(); break; default: break; } break; default: break; } } } quit_program(0, ""); return (0); }
void CBasePlayer::PlayerDeathThink() { if( GetFlags().Any( FL_ONGROUND ) ) { const float flForward = GetAbsVelocity().Length() - 20; if( flForward <= 0 ) SetAbsVelocity( g_vecZero ); else SetAbsVelocity( flForward * GetAbsVelocity().Normalize() ); } if( HasWeapons() ) { // we drop the guns here because weapons that have an area effect and can kill their user // will sometimes crash coming back from CBasePlayer::Killed() if they kill their owner because the // player class sometimes is freed. It's safer to manipulate the weapons once we know // we aren't calling into any of their code anymore through the player pointer. PackDeadPlayerItems(); } if( GetModelIndex() && ( !m_fSequenceFinished ) && ( GetDeadFlag() == DEAD_DYING ) ) { StudioFrameAdvance(); m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands if( m_iRespawnFrames < 120 ) // Animations should be no longer than this return; } // once we're done animating our death and we're on the ground, we want to set movetype to None so our dead body won't do collisions and stuff anymore // this prevents a bug where the dead body would go to a player's head if he walked over it while the dead player was clicking their button to respawn if( GetMoveType() != MOVETYPE_NONE && GetFlags().Any( FL_ONGROUND ) ) SetMoveType( MOVETYPE_NONE ); if( GetDeadFlag() == DEAD_DYING ) SetDeadFlag( DEAD_DEAD ); StopAnimation(); GetEffects() |= EF_NOINTERP; SetFrameRate( 0.0 ); const bool fAnyButtonDown = ( GetButtons().Any( ~IN_SCORE ) ) != 0; // wait for all buttons released if( GetDeadFlag() == DEAD_DEAD ) { if( fAnyButtonDown ) return; if( g_pGameRules->FPlayerCanRespawn( this ) ) { m_fDeadTime = gpGlobals->time; SetDeadFlag( DEAD_RESPAWNABLE ); } return; } // if the player has been dead for one second longer than allowed by forcerespawn, // forcerespawn isn't on. Send the player off to an intermission camera until they // choose to respawn. if( g_pGameRules->IsMultiplayer() && ( gpGlobals->time > ( m_fDeadTime + 6 ) ) && !( m_afPhysicsFlags & PFLAG_OBSERVER ) ) { // go to dead camera. StartDeathCam(); } if( IsObserver() ) // player is in spectator mode return; // wait for any button down, or mp_forcerespawn is set and the respawn time is up if( !fAnyButtonDown && !( g_pGameRules->IsMultiplayer() && forcerespawn.value > 0 && ( gpGlobals->time > ( m_fDeadTime + 5 ) ) ) ) return; GetButtons().ClearAll(); m_iRespawnFrames = 0; //ALERT(at_console, "Respawn\n"); g_pGameRules->PlayerRespawn( this, !( m_afPhysicsFlags & PFLAG_OBSERVER ) );// don't copy a corpse if we're in deathcam. SetNextThink( -1 ); }