static void DoNewCamera( idCameraPosition::positionType type ){ CCamera *cam = AllocCam(); if ( cam ) { char buf[128]; sprintf( buf, "camera%i", cam->GetCamNum() ); cam->GetCam()->startNewCamera( type ); cam->GetCam()->setName( buf ); cam->GetCam()->buildCamera(); sprintf( buf, "Unsaved Camera %i", cam->GetCamNum() ); cam->SetFileName( buf, false ); SetCurrentCam( cam ); RefreshCamListCombo(); // Go to editmode Add gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( g_pEditModeAddRadioButton ), TRUE ); // Show the camera inspector DoCameraInspector(); // Start edit mode (if not initiated by DoCameraInspector) if ( !g_bEditOn ) { DoStartEdit( GetCurrentCam() ); } } else { g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "No free cameras available.", "Create Camera Error", MB_OK, NULL ); } }
void QERPlug_Dispatch (const char* p, float* vMin, float* vMax, bool bSingleBrush) { if( !strcmp( p, "New Fixed Camera" ) ) DoNewFixedCamera(); else if( !strcmp( p, "New Interpolated Camera" ) ) DoNewInterpolatedCamera(); else if( !strcmp( p, "New Spline Camera" ) ) DoNewSplineCamera(); else if( !strcmp( p, "Camera Inspector..." ) ) DoCameraInspector(); else if( !strcmp( p, "Preview Camera" ) ) DoPreviewCamera(); else if( !strcmp( p, "Load Camera..." ) ) DoLoadCamera(); else if( !strcmp( p, "About..." ) ) g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, PLUGIN_ABOUT, "About", MB_OK, NULL ); }
virtual void activate() const { DoCameraInspector(); }