/* ================ DeclBrowserInit ================ */ void DeclBrowserInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the declaration editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_DeclDialog == NULL ) { InitAfx(); g_DeclDialog = new DialogDeclBrowser(); } if ( g_DeclDialog->GetSafeHwnd() == NULL) { g_DeclDialog->Create( IDD_DIALOG_DECLBROWSER ); /* // FIXME: restore position CRect rct; g_DeclDialog->SetWindowPos( NULL, rct.left, rct.top, 0, 0, SWP_NOSIZE ); */ } idKeyInput::ClearStates(); g_DeclDialog->ShowWindow( SW_SHOW ); g_DeclDialog->SetFocus(); if ( spawnArgs ) { } }
void LightEditorInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the light editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_LightDialog == NULL ) { InitAfx(); g_LightDialog = new CLightDlg(); } if ( g_LightDialog->GetSafeHwnd() == NULL ) { g_LightDialog->Create( IDD_DIALOG_LIGHT ); CRect rct; LONG lSize = sizeof( rct ); if ( LoadRegistryInfo( "Radiant::LightWindow", &rct, &lSize ) ) { g_LightDialog->SetWindowPos(NULL, rct.left, rct.top, 0,0, SWP_NOSIZE); } } idKeyInput::ClearStates(); g_LightDialog->ShowWindow( SW_SHOW ); g_LightDialog->SetFocus(); g_LightDialog->UpdateDialog( true ); if ( spawnArgs ) { // FIXME: select light based on spawn args } }
void SoundEditorInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the sound editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_SoundDialog == NULL ) { InitAfx(); g_SoundDialog = new CDialogSound(); } if ( g_SoundDialog->GetSafeHwnd() == NULL ) { g_SoundDialog->Create(IDD_DIALOG_SOUND); /* // FIXME: restore position CRect rct; g_SoundDialog->SetWindowPos( NULL, rct.left, rct.top, 0,0, SWP_NOSIZE ); */ } idKeyInput::ClearStates(); g_SoundDialog->ShowWindow( SW_SHOW ); g_SoundDialog->SetFocus(); if ( spawnArgs ) { const char *name = spawnArgs->GetString( "name" ); const idDict *dict = gameEdit->MapGetEntityDict( name ); g_SoundDialog->Set( dict ); } }
/* ================ AFEditorInit ================ */ void AFEditorInit( const idDict *spawnArgs ) { if( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the articulated figure editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if( g_AFDialog == NULL ) { InitAfx(); g_AFDialog = new DialogAF(); } if( g_AFDialog->GetSafeHwnd() == NULL ) { g_AFDialog->Create( IDD_DIALOG_AF ); } idKeyInput::ClearStates(); g_AFDialog->ShowWindow( SW_SHOW ); g_AFDialog->SetFocus(); if( spawnArgs ) { // select AF based on spawn args const char *name = spawnArgs->GetString( "articulatedFigure" ); if( name[0] == '\0' ) { name = spawnArgs->GetString( "ragdoll" ); } idDeclAF *decl = static_cast<idDeclAF *>( const_cast<idDecl *>( declManager->FindType( DECL_AF, name ) ) ); if( decl ) { g_AFDialog->LoadFile( decl ); } } }
void PDAEditorInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the PDA editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_PDAEditorDialog == NULL ) { InitAfx(); g_PDAEditorDialog = new CDialogPDAEditor(); } if ( g_PDAEditorDialog->GetSafeHwnd() == NULL ) { g_PDAEditorDialog->Create(IDD_DIALOG_PDA_EDITOR); /* // FIXME: restore position CRect rct; g_PDAEditorDialog->SetWindowPos( NULL, rct.left, rct.top, 0,0, SWP_NOSIZE ); */ } idKeyInput::ClearStates(); g_PDAEditorDialog->ShowWindow( SW_SHOW ); g_PDAEditorDialog->SetFocus(); if ( spawnArgs ) { // select PDA based on spawn args const char *name = spawnArgs->GetString( "pda" ); idDeclPDA *decl = static_cast<idDeclPDA *>( const_cast<idDecl *>( declManager->FindType( DECL_PDA, name ) ) ); // FIXME: select this PDA } }
void PDAEditorInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the PDA editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_PDAEditorDialog == NULL ) { InitAfx(); g_PDAEditorDialog = new CDialogPDAEditor(); } if ( g_PDAEditorDialog->GetSafeHwnd() == NULL ) { g_PDAEditorDialog->Create(IDD_DIALOG_PDA_EDITOR); } idKeyInput::ClearStates(); g_PDAEditorDialog->ShowWindow( SW_SHOW ); g_PDAEditorDialog->SetFocus(); }
/** * Initializes the material editor tool. */ void MaterialEditorInit( void ) { InitPropTree(win32.hInstance); com_editors = EDITOR_MATERIAL; Sys_GrabMouseCursor( false ); InitAfx(); InitCommonControls(); // Initialize OLE libraries if (!AfxOleInit()) { return; } AfxEnableControlContainer(); NONCLIENTMETRICS info; info.cbSize = sizeof(info); ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0); LOGFONT lf; memset(&lf, 0, sizeof (LOGFONT)); CWindowDC dc(NULL); lf.lfCharSet = (BYTE)GetTextCharsetInfo(dc.GetSafeHdc(), NULL, 0); lf.lfHeight = info.lfMenuFont.lfHeight; lf.lfWeight = info.lfMenuFont.lfWeight; lf.lfItalic = info.lfMenuFont.lfItalic; // check if we should use system font _tcscpy(lf.lfFaceName, info.lfMenuFont.lfFaceName); materialEditorFont = new CFont; materialEditorFont->CreateFontIndirect(&lf); // To create the main window, this code creates a new frame window // object and then sets it as the application's main window object meMainFrame = new MEMainFrame; // create and load the frame with its resources meMainFrame->LoadFrame(IDR_ME_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); // hide the doom window by default ::ShowWindow ( win32.hWnd, SW_HIDE ); // The one and only window has been initialized, so show and update it meMainFrame->ShowWindow(SW_SHOW); meMainFrame->UpdateWindow(); }
/* ================= RadiantInit This is also called when you 'quit' in doom ================= */ void RadiantInit( void ) { // make sure the renderer is initialized if ( !renderSystem->IsOpenGLRunning() ) { common->Printf( "no OpenGL running\n" ); return; } g_editorAlive = true; // allocate a renderWorld and a soundWorld if ( g_qeglobals.rw == NULL ) { g_qeglobals.rw = renderSystem->AllocRenderWorld(); g_qeglobals.rw->InitFromMap( NULL ); } if ( g_qeglobals.sw == NULL ) { g_qeglobals.sw = soundSystem->AllocSoundWorld( g_qeglobals.rw ); } if ( g_DoomInstance ) { if ( ::IsWindowVisible( win32.hWnd ) ) { ::ShowWindow( win32.hWnd, SW_HIDE ); g_pParentWnd->ShowWindow( SW_SHOW ); g_pParentWnd->SetFocus(); } } else { Sys_GrabMouseCursor( false ); g_DoomInstance = win32.hInstance; CWinApp* pApp = AfxGetApp(); CWinThread *pThread = AfxGetThread(); InitAfx(); // App global initializations (rare) pApp->InitApplication(); // Perform specific initializations pThread->InitInstance(); qglFinish(); //qwglMakeCurrent(0, 0); qwglMakeCurrent(win32.hDC, win32.hGLRC); // hide the doom window by default ::ShowWindow( win32.hWnd, SW_HIDE ); } }
/* ================ ParticleEditorInit ================ */ void ParticleEditorInit( const idDict *spawnArgs ) { if ( renderSystem->IsFullScreen() ) { common->Printf( "Cannot run the particle editor in fullscreen mode.\n" "Set r_fullscreen to 0 and vid_restart.\n" ); return; } if ( g_ParticleDialog == NULL ) { InitAfx(); g_ParticleDialog = new CDialogParticleEditor(); } if ( g_ParticleDialog->GetSafeHwnd() == NULL) { g_ParticleDialog->Create( IDD_DIALOG_PARTICLE_EDITOR ); /* // FIXME: restore position CRect rct; g_AFDialog->SetWindowPos( NULL, rct.left, rct.top, 0, 0, SWP_NOSIZE ); */ } idKeyInput::ClearStates(); g_ParticleDialog->ShowWindow( SW_SHOW ); g_ParticleDialog->SetFocus(); if ( spawnArgs ) { idStr str = spawnArgs->GetString( "model" ); str.StripFileExtension(); g_ParticleDialog->SelectParticle( str ); g_ParticleDialog->SetParticleVisualization( static_cast<int>( CDialogParticleEditor::SELECTED ) ); } cvarSystem->SetCVarBool( "r_useCachedDynamicModels", false ); }
/* ================= RadiantInit This is also called when you 'quit' in doom ================= */ void RadiantInit( void ) { // make sure the renderer is initialized if ( !renderSystem->IsOpenGLRunning() ) { common->Printf( "no OpenGL running\n" ); return; } g_editorAlive = true; // allocate a renderWorld and a soundWorld if ( g_qeglobals.rw == NULL ) { // jmarshall // g_qeglobals.defaultEditorMaterial = declManager->FindMaterial( "_editordefault" ); RadiantInitTestWindow(); // jmarshall end g_qeglobals.rw = renderSystem->AllocRenderWorld(); g_qeglobals.rw->InitFromMap( NULL ); } if ( g_qeglobals.sw == NULL ) { g_qeglobals.sw = soundSystem->AllocSoundWorld( g_qeglobals.rw ); } if ( g_DoomInstance ) { if ( ::IsWindowVisible( win32.hWnd ) ) { ::ShowWindow( win32.hWnd, SW_HIDE ); g_pParentWnd->ShowWindow( SW_SHOW ); g_pParentWnd->SetFocus(); } } else { sys->GrabMouseCursor( false ); g_DoomInstance = win32.hInstance; CWinApp* pApp = AfxGetApp(); CWinThread *pThread = AfxGetThread(); InitAfx(); // App global initializations (rare) pApp->InitApplication(); // Perform specific initializations pThread->InitInstance(); qglFinish(); //qwglMakeCurrent(0, 0); renderDevice->BindDeviceToWindow(win32.hDC); // hide the doom window by default ::ShowWindow( win32.hWnd, SW_HIDE ); // jmarshall toolInterfaceLocal.ShowDebugConsole(); // jmarshall end } }